Interfering threads in a script?
Posted: Sat May 24, 2003 10:27 pm
I made a map with a bunch of secret passages, and in the secred passage "control" room i have 2 switches, one called rd_switch1 with a trigger called rd_trigger1 that opens a secret door (remote_door) , and one called rd_swichlock with a trigger called rd_triggerlock that lockes the main passageway door (rd_doorlock). Here is my code for it so far:
When i go to use the switch in remote_door1 all i hear is the sound of the door closing every time i click it, the switch dosent move, and the door does nothing. The switch that locks the door however, works. Are the threads interfering somehow?
Zimmy
Code: Select all
level waittill prespawn
level.rdoorpos = 0
level.passlock = 0
thread remote_door1
thread lockdoors
remote_door1:
$rd_trigger1 waittill trigger
if (level.rdoorpos == 0)
{
$rd_switch1 playsound alarm_switch
$rd_switch1 anim turn
$remote_door open
level.rdoorpos = 1
goto remote_door1
}
if (level.rdoorpos == 1)
{
$rd_switch1 playsound alarm_switch
$rd_switch1 anim idle
$rd_switch2 anim idle
$remote_door close
level.rdoorpos = 0
goto remote_door1
}
end
lockdoors:
$rd_triggerlock waittill trigger
if (level.passlock == 0)
{
$rd_swichlock playsound alarm_switch
$rd_swichlock anim turn
$rd_doorlock lock
level.passlock = 1
goto lockdoors
}
if (level.passlock == 1)
{
$rd_swichlock playsound alarm_switch
$rd_swichlock anim idle
$rd_doorlock unlock
level.passlock = 0
goto lockdoors
}
end
Zimmy