Contoll a gate with a switch

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Contoll a gate with a switch

Post 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
Mapping 4 life
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

gates

Post 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
Tom Trude,

Image
User avatar
martijn_NL
Map Reviewer
Posts: 156
Joined: Mon Apr 14, 2003 5:33 pm
Location: The Netherlands
Contact:

Post 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
Mapping 4 life
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

It has two

Post 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.
Tom Trude,

Image
Post Reply