Help me plan this demoman thing

bob+M|M+

L6: Sharp Member
Mar 31, 2008
346
394
I have limited time when I can use a PC, so I'd like to plan this in advance.

I want to make a glass window that will break and explode upon a sticky/pipe TOUCH, but not allow a player to pass unless broken. The glass will respawn a couple seconds later. I also want the sticky/pipe to dissapear upon impact.

a3cccec274.jpg


a lot of this stuff will be new to me so I'm not really sure where to start. (Is this even possible?) Any comments greatly appreciated. I just need something to point me in the right direction. (maybe an entity list?)

Thanks,
bob
 

Pseudo

L6: Sharp Member
Jan 26, 2008
319
150
I think this is possible. The window will be a func_breakable. Set the "Material Type" to Glass and check the "Only Break on Trigger" flag.

Make a trigger_multiple in front of the window. Stickybombs and pipes are physics objects, so they will activate a trigger_multiple with the "Applies to Physics Objects" flag checked. Uncheck the "Applies to Clients" flag so that players will not trigger it. OnStartTouch send the window a Break input.

To remove the object that hit the window, have OnStartTouch with the target !activator. Send this target a Kill input. Break might work for these also. To make it so the trigger doesn't kill bombs after the window is broken, have it send itself a Disable input.

To make the window respawn, create a point_template. For the Template01 keyvalue, select the window. Check both the "Don't remove template entities" and "Preserve entity names" flags. Add another OnStartTouch to the trigger_multiple to send the point_template a ForceSpawn input. Give this input a delay of however many seconds you want. The point_template would then have an output OnEntitySpawned Enable the trigger_multiple.
 

DJive

Cake or Death?
aa
Dec 20, 2007
1,465
741

bob+M|M+

L6: Sharp Member
Mar 31, 2008
346
394
Ok so I tried out what you suggested Psuedo. Unfortunately the trigger_multiple can't be activated by the stickies/pipes under any condition. (internal hammer/tf2 problem I assume)

func_breakable DID however break quite nicely from the pipes/stickies when you check "only physics objects" and I got everything to work from using the OnBreak output.

The problem I'm dealing with now is if a sticky/pipe or player is in the respawn area of the window when it respawns, the game crashes. ~_~

(btw "kill" worked perfectly in conjunction with !activator to silently remove the pipes/stickies. "break" did nothing though)
 
Last edited:

Pseudo

L6: Sharp Member
Jan 26, 2008
319
150
The problem I'm dealing with now is if a sticky/pipe or player is in the respawn area of the window when it respawns, the game crashes. ~_~

Two ideas: A trigger_push in the window area maybe. Start it disabled. Check the "applies to clients" and "applies to physics objects" flags. Set the push direction and speed. When you want the window to respawn, Enable the trigger_push, have a delay of a second or two, then disable the trigger_push and spawn the window. I'm not sure if it will push a sticky that is attached to a wall. You can make the area around the window a func_brush to prevent stickies from sticking to it.

Another option, and it may work better if you used both the trigger_push and this, would be to use a env_entity_maker. This is like a more advanced version of the point_template (you'll need to keep the point_template though). Set it up to spawn your point_template. In the maker's flags, check "ForceSpawn: Only if there's room". You'll then be sending the env_entity_maker the ForceSpawn input instead of the template. You could add a OnEntityFailedSpawn output to the maker with a delay of several seconds to ForceSpawn again, so that it will keep trying to spawn the window until the area is clear.
 
Last edited:

bob+M|M+

L6: Sharp Member
Mar 31, 2008
346
394
wow tf2 for hammer is really buggy. trigger_push also doesn't work for pipe/stickies under any circumstance -_-

but I used the env_entity_maker and now it doesn't crash anymore so it's all good

For some reason the window still spawns on you regardless if you are in the way resulting in you getting stuck, but in that situation you can bottle yourself out which is fine.

much thanks Pseudo :)