vehicle flypaths
Moderator: Moderators
vehicle flypaths
ok part of my script that I converted from an original game script looks like this:
//////////////////////////
//TRAIN/////////////////
//////////////////////////
start_train:
$engine loopsound armoredtrain_rolling
$engine thread movecar_path
end
//*********************************************
// Thread for moving train cars on path
//*********************************************
movecar_path:
// speed, acceleration, look_ahead
self flypath $train_path 325 160 300
self move
end
How do I set up the flypath so I can see where the train is going in mohradiant?
//////////////////////////
//TRAIN/////////////////
//////////////////////////
start_train:
$engine loopsound armoredtrain_rolling
$engine thread movecar_path
end
//*********************************************
// Thread for moving train cars on path
//*********************************************
movecar_path:
// speed, acceleration, look_ahead
self flypath $train_path 325 160 300
self move
end
How do I set up the flypath so I can see where the train is going in mohradiant?
PFC.Butch
B Company, 2nd Ranger Battalion
US Army
B Company, 2nd Ranger Battalion
US Army
logical
That seems logical because, when you use a spline path for airplanes, the plane flys smoothly along the node paths. It starts turning in the direction of the next path before it even gets to the the next node. You can also set pitch and roll at the nodes and it will lookahead for those too. But, you only need yaw for a train unless it climbs mountains. Read the "bomber.scr" script for more info about spline paths for planes.
-
Desert Eagle
- Captain
- Posts: 237
- Joined: Mon Jan 13, 2003 1:05 am
- Location: Mapping Bunker
- Contact:
Heres how I got my train moving
Here is how I got mine working, but no sound...
the_train:
wait 10
local.origin = $train.origin + (0 0 64)
local.soundent = spawn script_origin origin local.origin
local.soundent notsolid
local.soundent thread the_trainsound
$train show
$train solid //so players will be killed if they are hit by train
$train anim smoke_on
thread the_trainsound
thread hidetrain
$train time 5
$train moveto $trainend
$train move
$train time 6
$train waitmove
$train.corona = 0 //makes sure the light on train looks right
waitframe
waitframe
end
//had to hide train after finishing its run, or it shows up on opposite side of map
hidetrain:
wait 7
$train hide
$train notsolid
end
the_trainsound:
self time 6
self move
self show
dprintln "Playing train sound!"
self svflags "+broadcast"
// Use loopsound to have the sound travel with the object.
self loopsound armoredtrain_rolling
// delete it 7 seconds later so it doesn't loop...
wait 7
self delete
End
the_train:
wait 10
local.origin = $train.origin + (0 0 64)
local.soundent = spawn script_origin origin local.origin
local.soundent notsolid
local.soundent thread the_trainsound
$train show
$train solid //so players will be killed if they are hit by train
$train anim smoke_on
thread the_trainsound
thread hidetrain
$train time 5
$train moveto $trainend
$train move
$train time 6
$train waitmove
$train.corona = 0 //makes sure the light on train looks right
waitframe
waitframe
end
//had to hide train after finishing its run, or it shows up on opposite side of map
hidetrain:
wait 7
$train hide
$train notsolid
end
the_trainsound:
self time 6
self move
self show
dprintln "Playing train sound!"
self svflags "+broadcast"
// Use loopsound to have the sound travel with the object.
self loopsound armoredtrain_rolling
// delete it 7 seconds later so it doesn't loop...
wait 7
self delete
End
Desert-Eagle
....The Eagle Has Landed...
....The Eagle Has Landed...
$train sound
The train itself can play the sound:
$train loopsound armoredtrain_rolling
to stop the sound:
$train loopsound armoredtrain_rolling wait
if you also want engine sounds then just make the engine a different targetname and "bind" it to the train.
$engine bind $train
By the way, "armoredtrain_rolling" does not normally work in multiplayer maps. You'll need an ubersound.scr script work around.
$train loopsound armoredtrain_rolling
to stop the sound:
$train loopsound armoredtrain_rolling wait
if you also want engine sounds then just make the engine a different targetname and "bind" it to the train.
$engine bind $train
By the way, "armoredtrain_rolling" does not normally work in multiplayer maps. You'll need an ubersound.scr script work around.

