Two new entities that can be used in mapping

Discussion in 'Mapping Questions & Discussion' started by 404UserNotFound, Jan 28, 2016.

  1. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    Not sure if this was posted here by a wonderful fellow named "frostbite305" who did the work and posted it on Reddit, but I figured I'd link to it and briefly explain it to the best of my ability. If this was posted here by frostbite305, I do apologize in advance for this thread. All praise be to frostbite305.

    Seems there's two new entities that have been in the game for a short time, but they weren't added to the FGD files. One can easily create a custom FGD file specifically for these two things (that's what I did), but for now I'm thinking maybe Boojum can toss these two entities into the Ultimate Mapping Resource Pack's FGD as part of an update.

    https://www.reddit.com/r/tf2/comments/42uawc/psa_for_mappers_i_added_the_documentation_for_a/

    (Click the entity names below to view the Valve Developer Wiki article for the entity. At the bottom of both articles is the custom FGD code you can copy and paste into "tf.fgd", "tf-abs.fgd" (if you use the UMRP) or a custom-made FGD file)

    First up we have "trigger_add_or_remove_tf_player_attributes". Similar in function to SourceMod's TF2Items extension and how that allows us plugin coders to add/remove attributes to players, this brush does basically the same thing. Apparently the "Remove" portion isn't functional at this point in time, but the Add portion does allow you to set a duration for the attribute chosen.

    Secondly, this one has been in since a recent PASS Time update, "filter_tf_class". Does exactly what the name suggests. Allows filtering based on the PLAYER's class. Do not get this confused with "filter_activator_class". filter_tf_class could be used for restricting entry to an area unless you're a specific class.

    Attached to this post is my own custom made FGD file containing both the trigger_add_or_remove_tf_player_attributes and filter_tf_class entities. Once you've downloaded tf-hidden.fgd, drop it into "C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\bin". Fire up Hammer, click "Tools" and then click "Options". To the right of the Game Data files box are some buttons. Click "Add" and select "tf-hidden.fgd". Restart Hammer and you'll be able to access both brush entities.

    [​IMG]
     

    Attached Files:

    • Thanks Thanks x 2
    • Like Like x 1
  2. EArkham

    aa EArkham Necromancer

    Messages:
    1,555
    Positive Ratings:
    2,158
    Your FGD doesn't display the attribute correctly. For example, instead of showing "damage penalty" for the attribute, it shows "%s1% damage penalty." This makes it quite hard to tell which one you're using, since many are "No Description" etc.

    I also tried to give myself ammo regen with this entity in a test map, and instead it just slays me and leaves a running ragdoll behind. So... something is off. Was hoping this would be the secret to finally getting the "disintegrate" effect working fully.
     
    • Useful Useful x 1
  3. radarhead

    aa radarhead Hands out ratings like cheap cigars

    Messages:
    1,002
    Positive Ratings:
    533
    Here's hoping Valve is still working on that one. It'll be fun to play around with (new AF gimmicks anyone?).
     
  4. Geit

    aa Geit 💜 I probably broke it 💜

    Messages:
    597
    Positive Ratings:
    1,110
    • Thanks Thanks x 2
  5. Frosty Scales

    aa Frosty Scales

    Messages:
    83
    Positive Ratings:
    34
    I made that FGD. (and the reddit post mentioned by OP) I did it by copying a chart over to excel, and there isn't exactly much I could do with it there without manually going through each entity. Also, regarding the percentage variables, I left those in to clarify what the value would do. I'll see about improving on it eventually though.
     
  6. Izotope

    aa Izotope Never releases maps

    Messages:
    592
    Positive Ratings:
    540
    They should just add that as a trigger_hurt damage type. (the cowmangler one, not the hl2 one)
     
  7. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    One could also use a SourceMod plugin to disintegrate things. Hook into a named brush and-oh...wait....there's an entity for dissolving things and it's present in TF2...

    I just now noticed this in the code of a snippet I released on AlliedMods a few years ago (under an old, banned account, long story)

    Code:
    public OnPluginStart()
    {
        HookEvent("player_death", Event_PlayerDeathPost, EventHookMode_Post);
    }
    
    
    public Action:Event_PlayerDeathPost(Handle:event, const String:name[], bool:dontBroadcast)
    {
      new victim = GetClientOfUserId(GetEventInt(event, "userid"));
    
      if (IsValidEntity(victim))
      {
        CreateTimer(0.1, Timer_DissolveRagdoll, any:victim);
      }
      return Plugin_Continue;
    }
    
    
    public Action:Timer_DissolveRagdoll(Handle:timer, any:victim)
    {
      new ragdoll = GetEntPropEnt(victim, Prop_Send, "m_hRagdoll");
    
      if (ragdoll != -1)
      {
        DissolveRagdoll(ragdoll);
      }
    }
    
    
    DissolveRagdoll(ragdoll)
    {
      new dissolver = CreateEntityByName("env_entity_dissolver");
    
      if (dissolver == -1)
      {
        return;
      }
    
      DispatchKeyValue(dissolver, "dissolvetype", "0");
      DispatchKeyValue(dissolver, "magnitude", "1");
      DispatchKeyValue(dissolver, "target", "!activator");
    
      AcceptEntityInput(dissolver, "Dissolve", ragdoll);
      AcceptEntityInput(dissolver, "Kill");
    
      return;
    }
    
    So basically, either try setting up env_entity_dissolver in a map, or use a SourceMod plugin with a modification of the above code to dissolve anything that enters the brush.

    (And yes, the above code does work in TF2 which is how I know the entity should be present in TF2)


    Correction: I made the FGD in the main post that you can download, but you were the one who created the entity code used within the FGD.

    And yes, give all your Thanks and Likes and such to Frosty Scales, he's the guy who added this stuff to the VDW.
     
    Last edited: Jan 29, 2016
  8. Izotope

    aa Izotope Never releases maps

    Messages:
    592
    Positive Ratings:
    540
    ^ I know about this and it's not the cowmangler dissolve.
     
    • Agree Agree x 1
  9. Luigi1000

    Luigi1000 L2: Junior Member

    Messages:
    65
    Positive Ratings:
    10
    Honestly it really sounds like someone can come up with some wacky combinations using this and it fills me with dread. I can only assume this would organically feel right in a map which either has a feature based around it or one of the random type maps where anything can happen.
     
  10. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,071
    Positive Ratings:
    832
    So what you're saying is, there should be a point to the map, or it should be pointless.
     
  11. Anreol

    Anreol L6: Sharp Member

    Messages:
    262
    Positive Ratings:
    273
    Or you can use this just for april fools.
     
    • Agree Agree x 2
  12. Luigi1000

    Luigi1000 L2: Junior Member

    Messages:
    65
    Positive Ratings:
    10
    I did not say that and don’t make it sound like I did. I’m just saying that maps which have objectives/mods to them are less likely to make use of this than those which don’t like dm, idle, achievement and trade maps.
     
  13. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    It's the same type of dissolve from what I can tell. I'm watching the official tf2 wiki's video on the Cow Mangler and unless they updated the dissolve effect recently (I forget), it's the exact same dissolve as used in HL2.

    Actually, IIRC, I think they updated it to have team-colored fizzles instead of the HL2 bluish-green fizzle. After doing some Googling I don't think it's been figured out yet. It's something I will look into now, to see if it's possible to reproduce the cow mangler team-colored dissolve in a plugin.

    Pretty sure it's the exact same entity/function though.
     
  14. Izotope

    aa Izotope Never releases maps

    Messages:
    592
    Positive Ratings:
    540
    It's not just the color, it's the painful death animation as well.
     
  15. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    Hook player_death event in a plugin. Set customkill to TF_CUSTOM_PLASMA or TF_CUSTOM_PLASMA_CHARGED...I think. Should be the CHARGED variant.

    That's something I need to test. I believe setting the customkill should result in that effect, but again, haven't tested it.