Entity Properties (Developing System)

Discussion in 'Mapping Questions & Discussion' started by Crimson, May 25, 2008.

  1. Crimson

    Crimson L3: Member

    Messages:
    119
    Positive Ratings:
    1
    Alright, so I have been working on a serverside mod for TF2 for quite a while, doing both custom maps and custom coded mods to change the gameplay. Now, I have come to the most difficult part so far, and I need you guys insight.

    I am developing a powerups system, with powerups such as quad damage, invisibility, haste, etc. Creating a custom entity type from scratch with code is absolutely ridiculously hard, if even possible I am not sure. So, basically I need to find an entity, preferably with OnTouch properties, that I can use for a template. My maps use health packs and ammo packs, but aside from that map entities don't play a huge role. I was thinking of using the Intel briefcase, but im not sure yet, as in the future I might make a CTF game type and wouldn't want to have to deal with that.

    Also, I need to find someway to communicate what client has just touched the entity. Can you actually find a client's ID within a map, or am I going to have to do more of this through code?

    I just woke up, so my thoughts are completely collected. I hope I got my point across as to what im trying to do, and any help you guys can give me would be great.
     
  2. rt3407v06p909

    rt3407v06p909 L1: Registered

    Messages:
    30
    Positive Ratings:
    17
    I'll offer some suggestions that have worked for me. What I've done is use parented sprites for glow effects, and tied them to the head of the player to mark them as unique visually. (this is regarding showing someone has quad or haste, for example)

    Entity wise, I used an AddOutput on the !activator to rename a player from player to some unique name that fired off a failsafe timer to rename them back to player after a given interval. This is the simplest way I know to uniquely identify a player for a limited time period without custom modules.

    The downside to this, because the logic_playerproxy does not appear to fire the PlayerDied Output in Multiplayer (and is not even in the Valve Wiki, despite being in the Hammer Help files) is that you need to do a name-filtered trigger_multiple on each spawn point to rename uniquely-named players and perform clean-up tasks when/if they die.

    When you have a spawn room, no big deal, not a ton of effort, it just gets tedious when you have several dozen spawn points all over the place.

    Regarding OnTouch, I parent a trigger_multiple to an arbitrary prop entity and then use the point_template and env_entity_maker to spawn them in place and control respawn and filters, etc. Use the OnStartTouch of the trigger_multiple to enable/disable/parent-to-player the prop and desired effects.

    If that's not what you were looking for, feel free to ignore. =)