push button door question


(MindConfusion) #1

I think I know what to do but am also confused abit.

I want a push button (like the rtcw alarm buttons) that will slide in and out.
Then I want it to target a door which will open. And if button pushed again the doors will close.

Whats the best way to go about this? I’ve gone through tuts and small search here but not helping too much.

Any tuts out there I don’t have or something to help me more please.


(flashkillaman) #2

I think its best to use a scriptmover but i’m not that experienced in mapping


(Erik-Ftn) #3

Here is one way of doing it:

Make one script mover with an origin (like you do rotating door).
Give it these keyvalues
scriptname door
targetname door

Make one func_invisible_user, one func_door and one target_script_trigger,

Give the trigger these keyvalues
scriptname button
targetname button
target pressed

give the func_door this value
targetname button

and then point the invis_user at the trigger. (it should point at the door also when u do this)

The door is your visual button, put the func_invis_user in front of it.

(You don’t always need having both script- and targetname like this, though SD recommends it.)

use this script:

door
{
 spawn
 {
  wait 200
  accum 1 set 0
 }

 trigger toggle
 {
  accum 1 trigger_if_equal 0 door open
  accum 1 trigger_if_equal 1 door close
 }

 trigger open
 {
  faceangles 0 90 0 1000  // or whatever u need
  accum 1 set 1
  resetscript // stops ET from going back to "toggle" when finished here
 }

 trigger close
 {
  faceangles 0 0 0 1000
  accum 1 set 0
 }
}

button
{
 spawn
 {
  wait 200
 }

 trigger pressed
 {
  trigger door toggle
 }
}

(Drakir) #4

The easiest way is to make a door that triggers the door.

Make a very small door as the button, the door actually moves and acts like a button, give it a target and the door a targetname with the same values.

If you want to have other sounds then the door sounds for the button just add a target_speaker and target it with the button using the same name as the targetname of the door. Rember to set the button type to 0 so that it wont make any sound.


(MindConfusion) #5

Thanks guys, gonna have to try it out in a couple hours. Thanks gawd I asked first before I tried to do it myself lol.


(MindConfusion) #6

Ok its half working kinda, I’m doing what you said Drakir its alot easier :slight_smile:

I’ve got the button part working, but when its pressed the 2 doors don’t open, they have been targeted with the same name (door)
Also I have the 2 doors I want open with func_door_rotating.

Do I need to add something to the script or am I missing something?

Button Code:
classname - func_door
target - door

Main Door Code:
classname - func_door_rotating
speed - 150
targetname - door

Oh and what angle is needed to make the button move inwards instead of outwards?


(Drakir) #7

Sorry dude, my misstake! Seems they have done something with the code so it dont work anymore. I tried it this morning but it seems u cannot target a door anymore, the targetet door will stay locked and not open. BAAAAD misstake from developers IMO.

So i guess u have to use scripting anyway to get a simple button to open a door. As you´re probably not living close to me i´ll give myself a couple of spanks on the but!


(Erik-Ftn) #8

You’ll have to add

key 0

to a targeted door, or it’s locked when targeted by anything but a func_invis_user. It’s some remaining key-issue (like red key for red door etc) which prob. don’t work in ET.

If you ever get a door or rotating door

  1. toggleable
  2. targetable and not openable by pressing usekey on the door itself
  3. dameagable with hp (not just one shot)

post your findings.


(MindConfusion) #9

Yup it works by adding the Key - 0 to the door, now it opens, with a few bugs easy to fix I hope.

Thanks for the help guys.


(Drakir) #10

Ah, great then…