Need help with oven mechanic

OctoBlitz

Sabotage related, and Tak approved!
aa
Jan 15, 2016
357
193
Hi everyone,

I am currently working on the oven mechanic for my 72hr map in order to save me some time on figuring it out during the jam.

In my map, there is an oven that will open when the point is capped containing health for the player to use, if the player stays in the oven too long, they take damage for 2 - 3 seconds and is then killed by the oven's heat. I'd like some help figuring out a way for me to set a trigger system to make this concept work properly before the jam begins. Anyone got any suggestions to help with my problem?
 

Idolon

they/them
aa
Feb 7, 2008
2,107
6,116
While this wouldn't do exactly as you want, I'd recommend just using a trigger_hurt set to a value that won't kill players instantly but is dangerous over time ("Doubling w/ forgiveness" may be helpful for this). If players walk into the oven and aren't immediately hurt by it, they might decide to stay in there without realizing that it will hurt them over time.

If you want to have the delay, what you can do is use the same trigger_hurt setup but filter it for a specific name. Then, you can add a trigger_multiple that uses AddOutput to set the targetname of !activator to whatever the trigger_hurt filters for. Give this input a delay of your choosing. Also use the same method when the player leaves the trigger to set their targetname to something else that won't get hurt by the trigger_hurt.

It's possible this method won't work if a player enters and leaves the trigger faster than your delay, as the delayed input will come after the "cancel" input, meaning they will start hurting instantly when they re-enter the oven. In that case, move the delayed input to a logic_relay and have the "cancel" input also send CancelPending to the logic_relay.