Post your scripting questions / solutions here
Moderator: Moderators
TechZimmy
Corporal
Posts: 36 Joined: Tue Feb 18, 2003 12:55 am
Contact:
Post
by TechZimmy » Sat May 24, 2003 1:19 pm
I am making a map with TONS of secret passages, and in the "passage control room" i want to have a switch that will lock them all. I have the switch, its called rd_swichlock (i forgot the t on purpose). The triggger is called rd_triggerlock, and the door (there is only 1 right now) is rd_doorlock. Here is my script:
Code: Select all
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
for some reason, this does not work at all. Whenever i press use at the trigger, nothing happens at all. Any suggestions?
Zimmy
jv_map
Site Admin
Posts: 6521 Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:
Post
by jv_map » Sat May 24, 2003 1:46 pm
Either set level.passlock = 0 at level start up or use if(level.passlock != 1) instead of if(level.passlock == 0).
You may use 'else' for the other compound_statement 8)
tltrude
Chuck Norris
Posts: 4774 Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:
Post
by tltrude » Sat May 24, 2003 3:29 pm
You must also arm the trigger (thread) under prespawn with this line:
level waittill prespawn
level.passlock = 0
thread lockdoors
It is not a good idea to arm it with a setthread in the trigger in this case. I hope jv-map agrees.
Tom Trude,
jv_map
Site Admin
Posts: 6521 Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:
Post
by jv_map » Sat May 24, 2003 3:39 pm
I couldn't agree more
TechZimmy
Corporal
Posts: 36 Joined: Tue Feb 18, 2003 12:55 am
Contact:
Post
by TechZimmy » Sat May 24, 2003 5:59 pm
ok it worked, but now it messes up the first part of my script. It is called remote_door1 (yes, copied from explodingdoor). It uses a switch to open and close a door. Here is my new script
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 "door closed" sound, the switch dosent move, and the door does nothing. Any suggestions?
Zimmy
Last edited by
TechZimmy on Sat May 24, 2003 6:17 pm, edited 1 time in total.
tltrude
Chuck Norris
Posts: 4774 Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:
Post
by tltrude » Sat May 24, 2003 6:14 pm
yes
Tom Trude,