Quote:
Originally Posted by Megahurt
Is there a way to make a train spawn when a player gets close to it, via a trigger perhaps?
Secondly, Is there a way to make a train run in a loop continuosly?
|
|
1. Yes. You need to set a trigger in FMB (called say "PlayerCloseBy") for when the player gets close enough. Then something like the script below for the trigger event.
Code:
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
//call base classes OnTrigger method.
base.OnTrigger(missionNumber, shortName, active);
//if the trigger that was called is the trigger that we're looking for
if (shortName.Equals("PlayerCloseBy") && active)
{
GamePlay.gpPostMissionLoad("missions/Multi/Dogfight/mymission/train.mis"); // start the train mission
GamePlay.gpHUDLogCenter("Train just spawned"); // tell train spawned
GamePlay.gpGetTrigger(shortName).Enable = false; // turn trigger off
}
}
2. No. You can attach trains to "rail" spline roads, but they only go in one direction, unlike vehicles which turn around & go up & down the spline road continously. The best you can do is to destroy the train after it finishes it's journey in one direction & spawn another train going back again.