Page 1 of 1
need help with elevator
Posted: Fri Jan 27, 2006 8:19 pm
by HDL_CinC_Dragon
Hey guys, I have a question. Ive been away from MOHAA for quite some time and my knowledge has deteriorated.
Do i use info>Waypoint and give it a name or pathnode or something like that?
does:
$elevator moveTo $way1
work?
Posted: Sat Jan 28, 2006 6:17 pm
by HDL_CinC_Dragon
Ok ill elaborate on my question:

the elevator moves to whatever floor the trigger is pressed at

using pathnodes labeled corresponding to the floor (node1, node B1, nodeB2, nodeB3, nodeB4)
im going to add the triggers and stuff later and then make my elevator a script object.
i need to know what script i need for this to work. Any help?
Posted: Mon Jan 30, 2006 4:13 pm
by Classic
your script will make it move up at the beging of the game and stay there.
Okay you will need something like this.
This is an example from my script.
lift_prep: //Thins thread binds the Trigger to the Script object
$lift_lift bind $lift
$lift time 8
end
lift_mover: // Thread started by setthread on triggers
$lift_lift1 nottriggerable
$lift loopsound lighthouse_run
$lift moveto $lift_down
$lift waitmove
$lift stoploopsound
wait 5
$lift loopsound lighthouse_run
$lift moveto $lift_up
$lift waitmove
$lift stoploopsound
$lift_lift1 triggerable
//place a waypoint named $lift_up at the up location
//and lift down at down location
//and replace the names I have with your own or change yours to mach.
end
Floors
Posted: Mon Jan 30, 2006 10:46 pm
by tltrude
Classic's example is for a two floor elevator. When you get into multi-floor elevators the scripting gets complacated real quick--even more if you add doors. But, there are examples around that you can copy or study. My explodingdoor tutorial map has a 3 floor one (with doors). My test_pointer map has a 4 story one with call buttons on each floor and inside the cab--probably the closest example of what you are looking for.
The easiest two floor elevator is one that uses func_door and requires no scripting, waypoints, or triggers. An example of that one can be seen in my door2 map--press your use key near the manhole.
My signiture logo is a link to the web page with my maps.
Posted: Tue Jan 31, 2006 9:49 am
by lizardkid
it's also possible to be really very algorithmeticwith your commands and do something like this.
make the entire elevator a script_object and give it a targetname. lets say you have 10 floors (unlikely).
with the conventional system it's impossible, just wont work. your entire script would be gigantic. place this thread in your script.. somewhere. you'll also need to declare a level variable somewhere called currentFloor.
to use it, just specify the distance between floors (this assumes they're even) and the floor number that the player wants to go to. as long as you initialized the level.currentFloor to whatever floor the elevator starts, there wont be a problem.
Code: Select all
moveElevator local.floor local.distance:
local.difference = (local.floor - level.currentFloor)
if(local.floor > level.currentFloor)
{
$elevator moveUp (local.distance * local.difference)
}else
{
$elevator moveDown -(local.distance * local.difference)
}
currentFloor += local.difference
end
of course this isnt perfect but as long as you declare everything and set the floors equally apart (why not?) then it'll work... i might expound on this and make an exec file for it... but for now that's all you'll need to do to make lots of floors. i would suggest using Tom's pointer thingy with this and just passing a bunch of numbers via that as opposed to a lot of buttons.
Posted: Tue Jan 31, 2006 6:01 pm
by HDL_CinC_Dragon
I would DEFINATLY like to use Tom's test_pointer! But i dont know what each of the triggers are. i can figure out the floor ones but theres a few i dont know what theyre supposed to do... care to help me on this one Tom?
triggers
Posted: Wed Feb 01, 2006 4:08 am
by tltrude
It is easy to find out what a tigger is by highlighting it and hitting key N. It uses trigger_clickitem for the buttons inside. Normally they are used with the binoculars, but there are extra files in the pk3 that creates a new pointer to use with them--the big trigger_multiple inside the cab is for the pointer. The outside buttons are trigger_use.
Posted: Wed Feb 01, 2006 5:41 pm
by HDL_CinC_Dragon
ohhhhhhh i didnt realize test_pointer came with the .map file! now ill have no problem with this
