Trapdoor Hallway.
Posted: Sat Nov 24, 2012 12:19 am
I'm trying to put in a classic sort of trap door feature where there's a single width hallway with a bunch of trap doors. They open one by one in sequence and reset themselves all at once. The player has to wait for them to be all closed and then dash forward with the doors opening up behind them. Classic dungeon stuff and it also cuts the player off from the previous area because it's impossible to go in reverse without falling in a pit.
I'm having a hard time figuring out the scripting though. The reset is easy enough just connect a timer to a script entity so it activates this script every five or so seconds.
I'm having a hard time figuring out the scripting though. The reset is easy enough just connect a timer to a script entity so it activates this script every five or so seconds.
Halltrapreset would probably be a hidden pressure plate that closes all the trap doors. The opening of the doors would be on increasing timers 1;2;3;etc. what I can't quite figure out is how keep them from getting out of sequence. I was thinking of maybe doing a second timed script that checks the doors every half second and deactivates the door timers if the door is open. It's also possible that I'm going about this completely wrong, I think that script would look like thisfunction halltrap()
if halltrap1:isOpen() and
halltrap2:isOpen() and
halltrap3:isOpen then
halltrapreset:activate()
end
end
Also is there a way to make that one script check all of the traps or would I need a separate one for each? I have no scripting experience all I know is what I've read in the script reference page and from watching those komag youtube videos.function halltraprun()
if halltrap1:isOpen() then
halltimer1:deactivate()
else
halltimer1:activate()
end
end