Page 2 of 2
Posted: Sat May 24, 2003 3:23 pm
by solar
Actually, I have in place the alarm switch with the lever that goes up and down. I was going to try "switch anim turn". Will that not work?
Alarm switch
Posted: Sat May 24, 2003 3:47 pm
by tltrude
For one of those it would be
$switch anim turnoff
Provided you alarm switch is target named "switch". Acctually, the word switch is a command word and it might be better to targetname it "door_lock_switch". If you highlight the switch in the editor and click on key N and the "Anim:" pluse and minus buttons, you will see all the test animation words you can use for it.
Posted: Sat May 24, 2003 4:09 pm
by jv_map
A door will automatically play the locked sound when it's triggered but locked

(works for all doors - rotating / sliding).
Like tltrude said don't use 'switch' as a targetname.
sound
Posted: Sat May 24, 2003 4:23 pm
by tltrude
Yes, but it would be nice if it, or the switch, made a sound to tell the player it is now unlocked. Could also use a red cage light. Too bad there is not green cage light.
Posted: Sat May 24, 2003 6:50 pm
by solar
Well, here's what I have so far:
1. func_rotating door with
"targetname - locked_door"
2. alarm switch model with
"targetname - plansdoor_switch" and
"testanim - idle"
3. door trigger_use covering the alarm switch with
"targetname - door_switch_trigger" and
"setthread- door_switch"
So far the relevant parts of my script look like this:
script:
main:
level waittill prespawn
$locked_door lock
$locked_door.locked = 1
end
level waittill spawn
door_switch:
if ($locked_door.locked)
{
$locked_door.locked = 0
$locked_door unlock
}
else
{
$locked_door.locked = 1
$locked_door lock
}
end
How's that look? I also can't figure where to put the animation part of the script. I'm thinking something like this:
door_switch:
$door_switch_trigger waittill trigger
$door_switch_trigger remove
$plansdoor_switch anim turnoff
$plansdoor_switch playsound alarm_switch
if ($locked_door.locked)
{
$locked_door.locked = 0
$locked_door unlock
}
else
{
$locked_door.locked = 1
$locked_door lock
}
end
Something like that, but I know there's probably some error there.
why
Posted: Sat May 24, 2003 7:02 pm
by tltrude
Jv_map's thread can both unlock and lock the door, so why are you removing the trigger? Do you want the door to be relockable or not?
Code: Select all
main:
level waittill prespawn
$locked_door lock
thread door_switch
level waittill spawn
end
door_switch:
$door_switch_trigger waittill trigger
$door_switch_trigger remove
$plansdoor_switch playsound alarm_switch
$plansdoor_switch anim turnoff
$locked_door unlock
end
You will have to take the setthread off the trigger for this script to work.
Posted: Sat May 24, 2003 8:59 pm
by jv_map
Your 'level waittill spawn' is a little loose solar

, tltrude has it better
