unlock door from somewhere else
Moderator: Moderators
Alarm switch
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.
$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.
sound
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.
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:
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:
How's that look? I also can't figure where to put the animation part of the script. I'm thinking something like this: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
Something like that, but I know there's probably some error there.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
why
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?
You will have to take the setthread off the trigger for this script to work.
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

