Here's a subroutine for checking whether a force arrow/orthosquare is crossable given a particular orientation.
To call it:
(First copy the code into the character script)
Set _MyScriptX,Y,W,H to the specific square you want to check
Set .inputO variable to the orientation that you want to check
012
3.5
678
Call the subroutine 'GoSub ArrowCheck'
The .outputIsBlocked variable will contain 1 if the arrow blocks movement, 0 otherwise.
Remember to reset the MyScript variables back to -9999 afterwards.
Example room attached. Orientation is taken from where Beethro is facing, top character is checking the arrow, bottom character is checking the orthosquare.
Click here to view the secret text
×Label ArrowCheck
Set var ".outputIsBlocked" = 0
Set var "_MyScriptF" = 45
If ...
Wait for item Ortho square,0,0,0,0
Set var ".ArrowOCheck" = .inputO % 2
If ...
Wait until var ".ArrowOCheck" = 0
Set var ".outputIsBlocked" = 1
If End
Return
If End
If ...
Wait until var ".inputO" <= 2
Set var ".ArrowOCheck" = .inputO + 2
Else If
Wait until var ".inputO" = 3
Set var ".ArrowOCheck" = 1
Else If
Wait until var ".inputO" = 6
Set var ".ArrowOCheck" = 0
Else If
Wait until var ".inputO" = 8
Set var ".ArrowOCheck" = 6
Else
Set var ".ArrowOCheck" = .inputO
If End
Set var "_MyScriptF" = (.ArrowOCheck % 8) + 13
If ...
Wait for item Force arrow (east),0,0,0,0
Set var ".outputIsBlocked" = 1
If End
Set var "_MyScriptF" = ((.ArrowOCheck + 1) % 8) + 13
If ...
Wait for item Force arrow (east),0,0,0,0
Set var ".outputIsBlocked" = 1
If End
Set var "_MyScriptF" = ((.ArrowOCheck + 2) % 8) + 13
If ...
Wait for item Force arrow (east),0,0,0,0
Set var ".outputIsBlocked" = 1
If End
Return
[Last edited by Rabscuttle at 02-28-2020 01:17 AM]