Page 2 of 2

Posted: Sat Jun 29, 2002 11:10 pm
by Moal
G3mInI wrote:Well I just read this thread real quick but let me give yall some insight. In scripting you can use the command triggerable and nottriggerable. So for instance if your door has a targetname of door1. You can do $door1 triggerable and/or $door1 nottriggerable. That will in effect activate and/or deactivate the door trigger as needed.

Hope that helps

G3mInI
well G3mInI unless you know something we don't I can't find
those options on the Func_Door Func_rotatingdoor or Script_Door
so if they are avaiavle and you know know how to use them
Please explain.
As I tried them as

$door1 nottriggerable
level waitTill prespawn
end
//////////////
doorbit:
$door1 triggerable

thread reset
end
/////////////
reset:
wait 10
$door1 nottriggerable
end
nothing happened and the door worked as normal

Posted: Sun Jun 30, 2002 2:50 am
by G3mInI
Tell me again what it is you are trying to do and I will post a script that should accomplish it. I have been confused by all the posts. So just explain what you want to happen in the game as if I were playing it.

G3mInI

Posted: Sun Jun 30, 2002 9:54 am
by Moal
G3mInI wrote:Tell me again what it is you are trying to do and I will post a script that should accomplish it. I have been confused by all the posts. So just explain what you want to happen in the game as if I were playing it.

G3mInI
ok let say I have Doora
I want doora to be locked unuseable unitll I use a trigger someplace else on the map then I hit the trigger I want doora to act like a normal door for say 10 sec then I have 10 sec to get to the doora after the 10 sec it goes back to
a unuseable or locked state

Posted: Sun Jun 30, 2002 4:45 pm
by G3mInI
Ok I understand what you want to do now unfortunately as of yet I do not know how to script a 'timer' function. So to make it work for only 10 seconds is beyond me, but I do know there is a way to do this using the level.time command. I will look into it further and see if I can come up with anything.

G3mInI

Posted: Sun Jun 30, 2002 5:01 pm
by Moal
G3mInI wrote:Ok I understand what you want to do now unfortunately as of yet I do not know how to script a 'timer' function. So to make it work for only 10 seconds is beyond me, but I do know there is a way to do this using the level.time command. I will look into it further and see if I can come up with anything.

G3mInI
Well I can do the timer
but I dont know how to make it lock and unload
timer is easy part
wait 10
thats it
how do you lock and unlock

Posted: Sun Jun 30, 2002 9:26 pm
by G3mInI
well if I were to make a door lock and unlock I would do this. Now remember this is without a timer. And wait 10 will not work for how I would script it. First I would make my door a script object. No origin brush. Give it a targetname of door1. Then I would place two trigger-uses on each side of the door. One a targetname of doortiggerA and the other doortriggerB. Next for the trigger to trigger these doors I would make another trigger-use and a targetname of doorlocktrigger. Thats it for the mapping stuff. Now to scripting:

$doortriggerA nottrigerable // turns off doortriggerA
$doortriggerB nottrigerable // turns off doortriggerB
$door1 time 3 // sets the time in seconds for door1 to move
thread door1 /start the main thread

door1:
$doorlocktrigger waittill trigger // waits for someone to trip this trigger
thread doora // once trigger is tripped this thread is active
thread doorb // simultaneously this thread also becomes active
end //should always put an end statement at the end of each thread

doora:
$doortriggerA triggerable // now this trigger is active and waiting
$doortriggerA waittill trigger // waiting for trip
$doortriggerB nottriggerable // when someone activates triggerA we shut off triggerB so as not to mess up the script
$door1 movewest 80 // moves the door 80 grid units to the west
$door1 waitmove // this command actually executes the move
wait 4 //wait 4 seconds
$door1 moveeast 80 // move the door back to its original position
$doortriggerA nottriggerable // turn off the trigger
thread door1 // go back and wait for the doorlocktrigger again

doorb:
$doortriggerB triggerable
$doortriggerB waittill trigger
$doortriggerA nottriggerable
$door1 moveeast 80 // note on this thread the move is exactly opposite since the player would be facing in opposite direction
$door1 waitmove
wait 4
$door1 movewest 80
$doortriggerB nottriggerable
thread door1

This script would in effect lock and unlock the door until someone tripped the doorlocktrigger trigger. There would be no waiting of 10 seconds. It would just allow the door to be used one time until someone triggered off the doorlocktrigger again. Now then as far as those commands movewest moveast. There is also movenorth movesouth. Along with rotatex rotatey rotatez. You would have to play around with what command you desire for your door. Also you could insert a sound for the door to make while opening and closing if you like. You would use a line like:

$door1 playsound gate_iron_open3

Insert this line before the waitmove command


Hope that helps you out



G3mInI

Posted: Mon Jul 01, 2002 10:40 pm
by Moal
Well G3mInI after I removed
$doortriggerA nottrigerable // turns off doortriggerA
$doortriggerB nottrigerable // turns off doortriggerB
$door1 time 3 // sets the time in seconds for door1 to move
thread door1 /start the main thread
then the script partly works
with that part in none of the maps scritps worked
seems for some reason they are nottriggerable anyway till you click the trigger_use
the only thing is the door dont close

Posted: Tue Jul 02, 2002 2:40 am
by Wombat
I would set up the door as normal.

Set the trigger_use to nottriggerable ( door )

trigger_use for door unlock should be set to triggerable

then the trigger_use that unlocks the door for ten seconds, would setthread unlockdoor1
targetname door1unlock

script--------

unlockdoor1:
$door1unlock nottriggerable // don't let it trigger until thread finished
$doortrigger triggerable // allow door to open
wait 10
$doortrigger nottriggerable // turn off door
$door1unlock triggerable // reset unlockdooor1 trigger
end

Wombat

Posted: Tue Jul 02, 2002 5:14 am
by Moal
only problem I see what that Wombat is only trigger commands use
nottriggerable and triggerable not doors

Posted: Tue Jul 02, 2002 4:17 pm
by Wombat
Maybe i didn't say that properly.

Setup a door, rotating, sliding your choice

setup a trigger_use to activate the door

setup a trigger_use to allow door to become unlocked for 10 seconds

TRIGGER_use( activate door )
set nottriggerable
set targetname doortrigger

TRIGGER_use( unlock door )
set triggerable
set setthread unlockdoor1
set targetname door1unlock

add this to your script


unlockdoor1:
$door1unlock nottriggerable // don't let it trigger until thread finished
$doortrigger triggerable // door is now unlocked
wait 10
$doortrigger nottriggerable // lock it
$door1unlock triggerable // turn on unlockdoor1 trigger
end

check out my script, in the scripting forum, "flying trucks, huh you ask" :wink:

Posted: Tue Jul 02, 2002 6:32 pm
by Moal
ok that sounds better :)
will test soon and let you know

Posted: Sun Jul 14, 2002 3:01 pm
by sir_millwall
Got a simpler soloution to what i think you want to do.

1st give the door a Key/Value of Targetname / door_1
when creating the door in the editor

then just use the lines "$Door_1 Lock" to lock and "$Door_1 Unlock" to unlock the door

Tried this built a long room with a partition with doors in, and played a Trigger_use at the opposite end.
when trigger used door_1 unlocks for 10 seconds, then relocks afterwoods.

Below is the script i used.

//sample door locking script


exec global/ai.scr
exec global/loadout.scr maps/test_door.scr

main:
level waittill prespawn
exec global/ambient.scr test_door

level waittill spawn
fadein 2 0 0 0 1
$door_1 lock // locks the door
end


objective1:
$door_1 unlock //unlocks the door when trigger hit
iprintln_noloc "Door is unlocked "
$corona_1 hide // hides the corona on light
$player stopwatch 10 //displays the stopwatch counts down 10
wait 10 //waits 10 seconds till locking door

$door_1 lock //locks the door
$corona_1 show //shows the corona.

Iprintln_noloc "Door Now locked"

end

hope that helps you achive what you needed.
i can email across the files if that would help.

Posted: Sun Jul 14, 2002 5:19 pm
by Moal
done got it working a week ago thanks