need help with elevator

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

need help with elevator

Post 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?
Last edited by HDL_CinC_Dragon on Sat Jan 28, 2006 10:10 pm, edited 1 time in total.
Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

Ok ill elaborate on my question:

Image
the elevator moves to whatever floor the trigger is pressed at
Image
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?
Image
Classic
Corporal
Posts: 39
Joined: Thu Dec 08, 2005 8:24 pm
Location: Some where in GA
Contact:

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

Floors

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

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

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

triggers

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

Image
User avatar
HDL_CinC_Dragon
Brigadier General
Posts: 574
Joined: Mon Dec 22, 2003 8:32 pm

Post by HDL_CinC_Dragon »

ohhhhhhh i didnt realize test_pointer came with the .map file! now ill have no problem with this :D :D
Image
Post Reply