Page 1 of 1

Interfering threads in a script?

Posted: Sat May 24, 2003 10:27 pm
by TechZimmy
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:

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
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

end

Posted: Sun May 25, 2003 12:41 am
by tltrude
You need an "end" here:

thread lockdoors

end

remote_door1:

Posted: Sun May 25, 2003 2:35 pm
by TechZimmy
No change. The same thing happens.

targetnames

Posted: Sun May 25, 2003 3:13 pm
by tltrude
If you are sure the targetnames in the map match the ones in the script, and there are no setthreads in the triggers, you can try this.

Place a script_origin near the door face and targetname it "remote_key1" or whatever.

In your script change this line:

$remote_door open $remote_key1 // remote_key1 is a fake player

If it is an alarm switch, you need to use these lines to move it:

$rd_switch1 anim turnoff // arm moves down
$rd_switch1 anim turnon

Posted: Sun May 25, 2003 3:25 pm
by TechZimmy
YAHOOOOOOO! Thank you! It works! Wooohooooooo!
(Ive been stuck on this for about a week)