An elevator with moving buttons?


(Aikon) #1

It’s raining problems here, omg!

Ok, so far I have my elevator, it moves, it’s got a whole script and everything…//00+. Nope, the buttons stay where they are, because they are entities, and when made script movers…they aren’t buttons anymore.

A pic for more clearification:

The 2 buttons are:
-Left
-The button itself:

lip 2
target down
angles 360 0 0
classname func_button

-The Target_script_trigger

scriptname elevator_move
targetname down
target move_down
classname target_script_trigger

-Right
-The button itself:

lip 2
target up
angles 360 0 0
classname func_button

-The Target_script_trigger

scriptname elevator_move
targetname up
target move_up
classname target_script_trigger

What you are looking at here, left=button to go down, right=button to go up. BUT…the buttons stay where they are.

My question: How do I make the buttons go down and up with the elevator itself?

I couldn’t find anything on this, maybe no one has ever tried this before…but I sure hope someone can tell me some way to do this?.


(Softwar) #2

I don’t know much about elevators, but Drakir made an elevator in ‘Navarone’. That elevator has got moving buttons, you can download the map and the script on his site =>

http://www.drakir.tk

Hope it helps :smiley:


(Malverik) #3

hmm, the thing is your buttons cannot be script_movers and func_buttons at the same time.

I think one way to do it would be to make your visible buttons part of the same entity as the elevator. Then you make your func_button with a clip_brush, one set at your first elevator position, and another set at the second elevator postition, etc. Now all you gotta do is target all of those transparent func_button to to the right target_script_trigger (all the up button to the up trigger, etc)
But that will mean that you wont be able to operate the elevator while it is moving since the “buttons” dont actually move with it. And be sure to check where the elevator is at in your script so the elevator wont go through the roof, squishing the players!


(Aikon) #4

The one in Navarone which drakir made had an elevator, but this one was merely a platform, not an actual one, and it did not have any buttons to press that went with it. As I’ve said already, the elevator is done.

Malverik, are you meaning that I should make it some sort of thingy which would be setstate button_up default/invisible? Cause that would be a cool idea…but how to do it when the elevator is fully down?


(Malverik) #5

you’re talking about the elevator still going up after it reaches the top?
You can have an accum that is equal to 1 on first floor and 2 on second floor. Then in you do something like


spawn
{
   accum 0 set 1   // at start im down  (or 2 if im up at start)
}

trigger up
{
   accum 0 abort_if_equal 2      // dont do anything if already up
   accum 0 set 2                        // make the script know im up now
   move and stuff
}

trigger down
{
   accum 0 abort_if_equal 1      // dont do anything if already down
   accum 0 set 1                        // make the script know im down now
   move and stuff
}

that way he can still press the switch but it wont move unless it can. But if you only have to floors, just make one button, when its up the button makes it go down, otherwise it goes up


(Aikon) #6

Aaah!! Now I know what the hell “Accum” means! Thank you for your information, Malverik, it’s extremely usefull! I’ll be testing it as soon as I get home! :banana:

You deserve a cookie! But…since there’s no smiley for cookies…I’ll just give you a :beer: :slight_smile: (can I just send it via airmail or do you prefer by ship? :-D)