BEERman@Posted: Sat Nov 27, 2004 6:46 pm :
MAKING A MULTI-STOP RIDEABLE TRAIN:

This Tutorial assumes you already know how to make a func_mover following a Nurbs Path, It also assumes you know the basics of GUI scripting. As well as
basic scripting knowledge:
If you don't read these first:

http://www.doom3world.org/phpbb2/viewto ... ving+train
http://www.doom3world.org/phpbb2/viewtopic.php?t=2808 <--scroll down to the GUI Scripting section


Step 1: Start with everyone's good ole favorite Cube Map. Make it a little bigger for this exercise, I'm using 1024x1024 to give our Train some elbow room.



Step 2: Now we're going to start by creating the first NURBS Path for the Train. This will be the first stop.

-Right-Click to Create a func_static (use the "NoDraw" texture)
-then switch to the ENTITY TAB and click "CURVE", select NURBS..
-Set your path up to do a Half-loop of your cube.

-Name the func_static "spline1"

Image




Step 3: Now make a second NURBS path for the train which goes from the end of the first path and loops back to the starting station. This will be the second stop

-Name this func_static "spline2"

Image



Step 4: Now we're going to make the train itself.

-Create a "func_mover" with the "NoDraw" texture. Name it "train_1"

-Line it's Origin up perfectly with the Origin of our func_static "spline1"

-Now add the following to the func_mover:

key "model"
value "models/mapobjects/loadtrans/loadtranscomp.lwo"

**IMPORTANT NOTE** IF YOU WANT THE TRAIN TO BE RIDEABLE, YOU MUST USE THE MODEL TAB IN THE FUNC_MOVER. If you bind a "func_static"
train model to the Func_mover instead of having the model a part of the func_mpver itself the player will slide off the train when it moves like a carpet being pulled from under his feet.

key "solid"
value "1"

key "gui"
value "guis/A_BEER/beer_trainstart.gui" //This is a stock GUI that I tweaked to run the train

key "gui_parm1"
value "train_start1" //uses the GUI to call the trains first movement script

key "gui_parm2"
value "train_start2" //uses the GUI to call the trains 2nd movement script

Image


Step 5: Open up Notepad/Wordpad and make a file called *urmapname*.script
-add the following

void train_start1()

{
$train_1.time(45);
$train_1.accelTime(10);
$train_1.decelTime(5);

$train_1.startSpline($spline1);

}

void train_start2()

{
$train_1.time(45);
$train_1.accelTime(10);
$train_1.decelTime(5);

$train_1.startSpline($spline2);

}

void main()

{

}

//These are the functions that will be activated by GUI parm 1/2 to activate the train

Step 7: Compile and Enjoy your Multi-Stop train! (make sure you place the GUI you made and the *urmapname*.script in the appropriate folders)


Download the testmap (with the mapscript and the GUI):
http://hosting.mismith7.com/beerman/Doo ... _train.zip



KungFuGuy@Posted: Mon Nov 29, 2004 7:05 am :
???



bb_matt@Posted: Mon Nov 29, 2004 12:36 pm :
Great tutorial Beerman ! - I'll add it to the list ASAP.



BEERman@Posted: Mon Nov 29, 2004 11:22 pm :
Ya i'm going to be making an update to it when I get my Multi-Stop / Multi-Lock GUI scripted and working. (It'll run the train through multiple stops, but recquires the GUI be "unlocked" at each stop by a remote GUI panel) I think I can do that, I was stumped but I had an epiphany at work today and I think I can do it now.