While working on a level set, I couldn't find a way to let the player drop trapdoors if he didn't have an enabled sword equipped, so I developed this workaround. It's a little ugly and takes a lot of behind-the-scenes work (might cause lag on slow computers), but it gets the job done. This script will let the player drop trapdoors
and toggle any trapdoor gates.
_trapdoorFinder
Click here to view the secret text
×
Imperative 15
Imperative 14
Set var "_MyScriptX" = 0
Set var "_MyScriptY" = 0
Set var "trapdoor" = 0
Label 1
If ...
Wait until var "_MyScriptY" < 16
If ...
Wait until var "_MyScriptX" < 16
If ...
Wait for item Trapdoor (over pit),0,0,0,0
Generate entity trapdoorPit,0,0,northwest
Set var "trapdoor" + 1
If End
If ...
Wait for item Trapdoor (over water),0,0,0,0
Generate entity trapdoorWater,0,0,northwest
Set var "trapdoor" + 1
If End
Set var "_MyScriptX" + 1
Else
Set var "_MyScriptY" + 1
Set var "_MyScriptX" = 0
If End
Else
Go to 2
If End
Go to 1
Label 2
If ...
Wait until var "trapdoor" = 0
Set var "trapdoor" - 1
If End
_reddoorFinder
Click here to view the secret text
×
Imperative 15
Imperative 14
Set var "_MyScriptX" = 0
Set var "_MyScriptY" = 0
Wait until var "trapdoor" = 0
Label 1
If ...
Wait until var "_MyScriptY" < 16
If ...
Wait until var "_MyScriptX" < 16
If ...
Wait for item Trapdoor gate,0,0,0,0
Build Trapdoor gate (open),0,0,0,0
Else
If ...
Wait for item Trapdoor gate (open),0,0,0,0
Build Trapdoor gate,0,0,0,0
If End
If End
Set var "_MyScriptX" + 1
Else
Set var "_MyScriptY" + 1
Set var "_MyScriptX" = 0
If End
Else
Go to 2
If End
Go to 1
Label 2
trapdoorPit
Click here to view the secret text
×
End on room exit
Wait for player to touch me
Set var "_MyScriptX" = _X
Set var "_MyScriptY" = _Y
Wait while entity is Player 0,0,0,0
Build Pit,0,0,0,0
Set var "trapdoor" - 1
End
trapdoorWater
Click here to view the secret text
×
End on room exit
Wait for player to touch me
Set var "_MyScriptX" = _X
Set var "_MyScriptY" = _Y
Wait while entity is Player 0,0,0,0
Build Water,0,0,0,0
Set var "trapdoor" - 1
End
How to use: In whatever room you want to start this, just put down a character with the following script:
Generate entity _trapdoorFinder,0,0,northwest
Generate entity _reddoorFinder,0,0,northwest
and it'll work its magic throughout the rest of the hold. Have fun!
____________________________
spacelike
[Last edited by superluminal at 07-02-2016 09:01 PM]