Adding call triggers to Erick's 2-floor elevator script.

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
StarGeneral
Sergeant
Posts: 67
Joined: Wed Oct 17, 2007 5:21 am

Adding call triggers to Erick's 2-floor elevator script.

Post by StarGeneral »

All right, heres the deal. I need to add call triggers into my map on the top and bottom floors. I wont be using switches though, i will only use triggers placed in front of some static models. I need to what and where to add lines of code to make the call triggers work they are named

bottom_call

top_call

simply tell me where and what I need to add to my script, I followed erick's two floor elevator tut.
"Si vis pacem, para bellum."
"If you want peace, prepare for war."
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

no script elevator

Post by tltrude »

It would be easier to just use an elevator that does not need anything in the script.

http://gronnevik.se/rjukan/index.php?n= ... veElevator

The link to my door2 map is broken in the totorial, but you can get it by clicking on my signature logo below.

Image
Tom Trude,

Image
User avatar
erick
Major
Posts: 280
Joined: Wed May 30, 2007 1:14 am
Location: USA

Post by erick »

For call triggers on a 2 floor setup like yours just add your static models and trigger_use's on the top and bottom floor. Then give them setthreads of top_floor or bottom_floor depending on the floor.

Then add this to your code:

Code: Select all

top_floor:
if (level.elepos==1) //put in your level variable
{
end
}
else
{
$elevator_cab moveto $topfloor // use the name of the elevator cab in here and the name of your top floor waypoint
$elevator_cab loopsound lighthouse_run
$elevator_cab waitmove
$elevator_cab stoploopsound
level.elepos++
goto elevator_standby //this is the heading of the line for when the elevator is not in motion
end

bottom_floor:
if (level.elepos==0)
{
end
}
else
{
$elevator_cab moveto $bottomfloor // use the name of the elevator cab in here and the name of your top floor waypoint
$elevator_cab loopsound lighthouse_run
$elevator_cab waitmove
$elevator_cab stoploopsound
level.elepos--
goto elevator_standby
end
This should work...if you followed the tutorial
Post Reply