Page 1 of 1

Contoll a gate with a switch

Posted: Tue Jul 29, 2003 3:22 pm
by martijn_NL
I did not know if i post this by mapping or scripting, b

I want to make a door / gate that is can close / open with a switch (just like in mp_ardennes_TOW

i understand the script file


ardennes_gate_switch:

if( level.bGateSwitchUp == 1 )
{
$ardennes_gate_switch_origin speed 1.0
$ardennes_gate_switch_origin rotatexdownto 180
$ardennes_gate_switch_origin waitmove
$ardennes_gate_switch_originplaysound levator_run
level.bGateSwitchUp = 0
}
else
{
$ardennes_gate_switch_origin rotatexupto 0
$ardennes_gate_switch_origin waitmove
level.bGateSwitchUp = 1
}

end




But how do i make the doorand switch in radiant, so that it can open / close with a switch

Martijn_NL

Posted: Tue Jul 29, 2003 5:28 pm
by jv_map
Well I think what you posted there is only the switch code. I think you need a script_object with targetname 'ardennes_gate_switch_origin' for the switch.

Note
$ardennes_gate_switch_originplaysound levator_run

should be

$ardennes_gate_switch_origin playsound elevator_run

gates

Posted: Wed Jul 30, 2003 7:30 am
by tltrude
You can make your gates just like any other door but set the flag called "targeted", so it wont open with the use key. Give both gates a targetname. In your script you can put something like this:

$mygate open // or close


This tutorial map has a door with two switches to open and close it. So you can just copy what you need.

http://pages.sbcglobal.net/tltrude/Temp ... ngdoor.zip

Posted: Thu Jul 31, 2003 7:43 pm
by martijn_NL
It worked out, but tltrude u need to add a script orgin witg a targetname so mohaa knows which way the will open.

and u need to add this to the script

&mygate open / close $scriptorgin

It has two

Posted: Fri Aug 01, 2003 1:13 am
by tltrude
It has two script origins, "fake_player1" and "fake_player2" on either side of the door. But, you really only need one, if there is only one switch.