I have two switches that move things, a bridge rotates up and a walkway thing moves horizontally.
The errors come when the switch gets hit repeatedly in quick succession, so as the bridge is lowering someone hits the switch before the bridge completes its movement and it either gets stuck in mid air, rotates in the completely wrong direction or strangely gets confused as to which direction it should move, its meant to lower for allies raises for axis( hope that made some sense ).
So I was thinking is there a way to disable the switch for say 2 seconds after its been hit, then it complete its movement and hopefully not get confused when its hit again ? Or maybe theres another way around it ?
Heres the script for these two switches:
//--------------------------------------------------------------
//The lock gate
//--------------------------------------------------------------
artillerystrike_switch:
if( level.bArtillerySwitchUp == 1 )
{
$lockgate moveSouth 544 // To open it
$lockgate move // or waitmove
$artillerystrike_origin speed 1.0
$artillerystrike_origin rotatexdownto 180
$artillerystrike_origin waitmove
$artillerystrike_origin playsound switchbox
level.bArtillerySwitchUp = 0
}
else
{
$lockgate moveNorth 544 // To close it
$lockgate move // or waitmove
$artillerystrike_origin rotatexupto 0
$artillerystrike_origin waitmove
level.bArtillerySwitchUp = 1
}
end
//--------------------------------------------------------------
//The Bridge
//--------------------------------------------------------------
airstrike_switch:
if( level.bAirStrikeSwitchUp == 1 )
{
$bridge rotateZdown 90
$bridge move
$airstrike_origin speed 1.0
$airstrike_origin rotatexdownto 180
$airstrike_origin waitmove
$airstrike_origin playsound switchbox
level.bAirStrikeSwitchUp = 0
}
else
{
$bridge rotateZup 90
$bridge move
$airstrike_origin rotatexupto 0
$airstrike_origin waitmove
level.bAirStrikeSwitchUp = 1
}
end


