I need help with spawning a second elevator in my map. I can spawn the first one and it works fine, but when I add a second elevator it does not show up. Can someone help me with the correct way to continue scripting multiple elevators. Thank you!
Here is what I put:
lift:
//=============================ELEVATOR 1===============================
local.lift1 = spawn script_model
local.lift1 model "static/indycrate.tik"
local.lift1 targetname elevator
local.lift1.origin = ( -3610.50 4850 -447.88 )
local.lift1.angle = 0
local.lift1 time 3
local.lift1 light 0 0 0 30
while (1)
{
wait 5
local.lift1 speed 150
local.lift1 moveUp 250
local.lift1 loopsound elevator_run
local.lift1 waitmove
local.lift1 stoploopsound
wait 5
local.lift1 moveDown 250
local.lift1 loopsound elevator_run
local.lift1 waitmove
local.lift1 stoploopsound
}
Elavator help... Please!
Moderator: Moderators
Never did one, but wouldn't it be local.lift2.......new coords... etc. ?
or make each one a script origin something or other ?
maybe
http://www.modtheater.com/forum/showthread.php?t=28556
http://www.modtheater.com/forum/showthr ... t=elevator
Click on this link........
http://www.modtheater.com/forum/search. ... hid=389395
or make each one a script origin something or other ?
maybe
http://www.modtheater.com/forum/showthread.php?t=28556
http://www.modtheater.com/forum/showthr ... t=elevator
Click on this link........
http://www.modtheater.com/forum/search. ... hid=389395
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
This should work
lift:
//=============================ELEVATOR 1===============================
local.lift1 = spawn script_model
local.lift1 model "static/indycrate.tik"
local.lift1 targetname elevator
local.lift1.origin = ( -3610.50 4850 -447.88 )
local.lift1.angle = 0
local.lift1 time 3
local.lift1 light 0 0 0 30
while (1)
{
wait 5
local.lift1 speed 150
local.lift1 moveUp 250
local.lift1 loopsound elevator_run
local.lift1 waitmove
local.lift1 stoploopsound
wait 5
local.lift1 moveDown 250
local.lift1 loopsound elevator_run
local.lift1 waitmove
local.lift1 stoploopsound
}
end
lift2:
//=============================ELEVATOR 2===============================
local.lift2 = spawn script_model
local.lift2 model "static/indycrate.tik"
local.lift2 targetname elevator2
local.lift2.origin = ( xxx xxx xxx )//add new coords
local.lift2.angle = 0
local.lift2 time 3
local.lift2 light 0 0 0 30
while (1)
{
wait 5
local.lift2 speed 150
local.lift2 moveUp 250
local.lift2 loopsound elevator_run
local.lift2 waitmove
local.lift2 stoploopsound
wait 5
local.lift2 moveDown 250
local.lift2 loopsound elevator_run
local.lift2 waitmove
local.lift2 stoploopsound
}
end
You can do it like Green Beret said in two threads . If you use two while loops you have to use two threads
main:
thread lift
thread lift2
end
In the threads that Green Beret posted though he put local.lift1 time 3 and also local.lift1 speed 150 you should use one or the other really not both . Time 3 means when you move something no matter how far it will take 3 seconds so depending on the distance the speed will not be the same if the distances are different . The farther you have to move it the faster it will go so that it can do it in 3 seconds . local.lift1 speed 150 on the other hand means 150 units per second so a far distance takes longer because the speed is set at 150 so the time it takes maybe more or less than 3 seconds depending on distance . There is a way to combine the two threads into one but there is no real advantage to it . One other thing local.lift1 light 0 0 0 30 there is no black light in mohaa Green Beret so that won't work .
main:
thread lift
thread lift2
end
In the threads that Green Beret posted though he put local.lift1 time 3 and also local.lift1 speed 150 you should use one or the other really not both . Time 3 means when you move something no matter how far it will take 3 seconds so depending on the distance the speed will not be the same if the distances are different . The farther you have to move it the faster it will go so that it can do it in 3 seconds . local.lift1 speed 150 on the other hand means 150 units per second so a far distance takes longer because the speed is set at 150 so the time it takes maybe more or less than 3 seconds depending on distance . There is a way to combine the two threads into one but there is no real advantage to it . One other thing local.lift1 light 0 0 0 30 there is no black light in mohaa Green Beret so that won't work .
Can you say ORGASM ? AHHHhhh - ( insert lyrics to a famous Pink Floyd song here ), ........ This one works. Thanks bdbodger
COPY AND PASTE for test...............................
// STALINGRAD
// ARCHITECTURE: ZIED, POWZER
// SCRIPTING: POWZER
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Stalingrad"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" "MONGO'S"
setcvar "g_obj_axistext3" "LIFT TEST"
setcvar "g_scoreboardpic" "mohdm6"
// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread
level waittill prespawn
//-496 111 -147//-409 104 -148
thread lift
thread lift2
end
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/door_locked.scr::lock
level.script = maps/dm/mohdm6.scr
exec global/ambient.scr mohdm6
level waittill spawn
lift:
//=============================ELEVATOR 1===============================
local.lift1 = spawn script_model
local.lift1 model "static/indycrate.tik"
local.lift1 targetname elevator
local.lift1.origin = ( -409 104 -148 )
local.lift1.angle = 0
//local.lift1 time 3
local.lift1 light 0 10 0 300
while (1)
{
wait 5
local.lift1 speed 150
local.lift1 moveUp 250
local.lift1 loopsound elevator_run
local.lift1 waitmove
local.lift1 stoploopsound
wait 5
local.lift1 moveDown 250
local.lift1 loopsound elevator_run
local.lift1 waitmove
local.lift1 stoploopsound
}
end
lift2:
//=============================ELEVATOR 2===============================
local.lift2 = spawn script_model
local.lift2 model "static/indycrate.tik"
local.lift2 targetname elevator2
local.lift2.origin = ( -138 145 -144 )//add new coords
local.lift2.angle = 0
//local.lift2 time 3
local.lift2 light 10 0 0 300
while (1)
{
wait 5
local.lift2 speed 150
local.lift2 moveUp 250
local.lift2 loopsound elevator_run
local.lift2 waitmove
local.lift2 stoploopsound
wait 5
local.lift2 moveDown 250
local.lift2 loopsound elevator_run
local.lift2 waitmove
local.lift2 stoploopsound
}
end
//-----------------------------------------------------------------------------
roundbasedthread:
// Can specify different scoreboard messages for round based games here.
level waitTill prespawn
level waittill spawn
// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw
level waittill roundstart
end
COPY AND PASTE for test...............................
// STALINGRAD
// ARCHITECTURE: ZIED, POWZER
// SCRIPTING: POWZER
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Stalingrad"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" "MONGO'S"
setcvar "g_obj_axistext3" "LIFT TEST"
setcvar "g_scoreboardpic" "mohdm6"
// call additional stuff for playing this map round based is needed
if(level.roundbased)
thread roundbasedthread
level waittill prespawn
//-496 111 -147//-409 104 -148
thread lift
thread lift2
end
//*** Precache Dm Stuff
exec global/DMprecache.scr
exec global/door_locked.scr::lock
level.script = maps/dm/mohdm6.scr
exec global/ambient.scr mohdm6
level waittill spawn
lift:
//=============================ELEVATOR 1===============================
local.lift1 = spawn script_model
local.lift1 model "static/indycrate.tik"
local.lift1 targetname elevator
local.lift1.origin = ( -409 104 -148 )
local.lift1.angle = 0
//local.lift1 time 3
local.lift1 light 0 10 0 300
while (1)
{
wait 5
local.lift1 speed 150
local.lift1 moveUp 250
local.lift1 loopsound elevator_run
local.lift1 waitmove
local.lift1 stoploopsound
wait 5
local.lift1 moveDown 250
local.lift1 loopsound elevator_run
local.lift1 waitmove
local.lift1 stoploopsound
}
end
lift2:
//=============================ELEVATOR 2===============================
local.lift2 = spawn script_model
local.lift2 model "static/indycrate.tik"
local.lift2 targetname elevator2
local.lift2.origin = ( -138 145 -144 )//add new coords
local.lift2.angle = 0
//local.lift2 time 3
local.lift2 light 10 0 0 300
while (1)
{
wait 5
local.lift2 speed 150
local.lift2 moveUp 250
local.lift2 loopsound elevator_run
local.lift2 waitmove
local.lift2 stoploopsound
wait 5
local.lift2 moveDown 250
local.lift2 loopsound elevator_run
local.lift2 waitmove
local.lift2 stoploopsound
}
end
//-----------------------------------------------------------------------------
roundbasedthread:
// Can specify different scoreboard messages for round based games here.
level waitTill prespawn
level waittill spawn
// set the parameters for this round based match
level.dmrespawning = 0 // 1 or 0
level.dmroundlimit = 5 // round time limit in minutes
level.clockside = kills // set to axis, allies, kills, or draw
level waittill roundstart
end
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
lighthouse
"elevator_run" only works in singleplayer maps. Try using this one ---> lighthouse_run
That works Thank you. Made this into pk3 for futrure reference
http://www.modtheater.com/forum/showthr ... 30&t=29260
http://www.modtheater.com/forum/showthr ... 30&t=29260


