How to create a route in CSV Part 1 (rewrite)

Pages: (1/1)

ipaclansite:

How to create a route in CSV Part I

We'll just get right to it.  A CSV file for BVE has 5 major declarations

With Route
With Train
With Texture
With Structure
With Track

Each one has its own different purpose

With Route - Defines all general information of the route
With Train - Defines the train the route will use
With Texture - Defines any textures the route will be using, including ground, and backgrounds here you'll be writing the library of textures
With Structure - Defines the indexes of all object files, in turn this is where you will be writing your library of objects
With Track - Defines where all the structures are placed, and what you will see in BVE

So lets get started
Code:
--
With Route
.comment Second Avenue Subway Local by ipaclansite/kevin from BVEStation.com | DAY! Stations are empty in this route!
.gauge 1435,

--
.comment displays what you see in this picture below

.gauge simply defines the track gauge, 1435 is standard gauge.

Code:
--
With Train
.folder R160B,

--
.folder defines the train you will be using, the folder name of the train is the one BVE will attempt to access.
Code:
--
With Texture
.background(1) 2ndAveT\bg.bmp,
--

Here we are building the library of textures hence the id number of the background (1), here is the format:
.background(#) <directory of file>,

During different sections of the route we may want to switch backgrounds in which case the With Track section would define where we would use another background, we will discuss that later in this tutorial.

Next is the With Structure
Code:
--
With Structure
.rail(0) 2ndAveT\Ballast3RL.b3d,
.rail(1) 2ndAveT\Ballast3RR.b3d,
.freeobj(1) 2ndAveT\125thSt\Platform.b3d,

--
Here we are building our library of objects along with their id numbers.  There are several commands that go under With Structure each with their own purposes.
First off is the .rail command which defines the type of rail (or the rail object) we will be using.
.rail(0) 2ndAveT\Ballast3RL.b3d,
The number defines its id number, while the 2ndAveT\Ballast3RL.b3d defines the directory of where this object is located in.
The .freeobj command defines a static object and can be anything.
.freeobj(1) 2ndAveT\XR25L.b3d,
The number defines its id number just like the .rail command, while the 2ndAveT\XR25L.b3d also defines the directory of where this object is located in.

BVE's internal object limit is 65535, so you cannot exceed that number of objects in the With Structure section, but I highly doubt that will happen...

Next is probably the most tedious part
Code:
--
0,
.back 1,
.sta Lenox Ave. Layup;08.2655;08.2700;0;0;0;0;;0;45;;,
.railtype 0;1,
.freeobj 0;1;-0.5;-0.5;0,
5,
.stop 1,
--

With Track begins the placing of structures in BVE.
The number by itself with the comma is a location mark.  Then under that we are defining what happens at that location.  Here at position 0, we are placing a background, a station, setting a railtype, and placing a free object.  Next at location 5, we are placing a stop position for a station.

Please remember that the semi-colons seperate each parameter, so dont forget to place them.

.back 1, tells BVE to go back to the with texture section and looks for a background with the id number 1.  If it is successful, BVE goes on to read the next line.
Code:
--
.sta Lenox Ave. Layup;08.2655;08.2700;0;0;0;0;;0;45;;,
--

.sta is the station command, one of the longest lines, the station generator on BVEStation can assist you in creating these lines. Otherwise I'll explain it anyway.
Where you see Lenox Ave Layup, that is the name of the station. The Semi-colon seperates each declaration. 08.2655 specifies the time the train should arrive at the station. 08.2700 specifies the time the train should depart at the station. The first 0 is a pass alarm used for like safety systems if the train your using has one. The next 0 is the side the door opens on (-1 = left) (1 = right) (0 = No doors open) The next 0 specifies whether the signal after the end of the station should be red or green (1 = red) (0 = green) The next 0 is a safety system and is once again used if your train has a safety system installed. That blank area betwee the 2 ;'s is the place where you would add the arrival sound, technically this can be left blank. The next 0 is the minimum time in seconds the train is allowed to wait. So in the sample code above its set for 0 seconds. The 45 is the passenger load. 0-250 The higher the number the more crowded that train will be, and then you'd have people stuck on that door! Then we have the departing sound, which should be filled in, similar to how specifying the objects above, only the Sound folder would be the base folder. And finally the last one before the comma, the Timetable index, more used in BVE 4 routes, where they use bitmap images as timetables.

Next is the railtype command.  Since all track on BVE also has its own id numbers, the railtype command is useful for changing the type of track you see.  The track that the train will be running on is ALWAYS 0, so now we'll analyze the .railtype command, its nice and simple.
The 0 represents the rail id number, in this case its the rail we'll be running on.
The 1 represents the rail object id number defined in With Structure.

Next is the freeobj command which places a freeobj
Code:
--
.freeobj 0;1;-2.2;-0.5;0,
--
The first 0 represents the rail id number
The 1 represents the object id number defined in With Structure.
The -0.5 represents where the object will be placed on the X-axis relative to the rail id number's position.
The -0.5 represents where the object will be placed on the Y-axis relative to the rail id number's position.
The final 0 represents the object rotation on the X-axis.

Next we begin at position 5.
And there we simply place a stop position. the 1 tells BVE to place a sign on the right, while a -1 tells BVE to place one on the left, while 0 doesn't place one at all.

Now we'll add another station further down in the route since BVE requires us to have more than 1 station in the route.
Code:
--
With Track
0,
.back 1,
.sta Lenox Ave. Layup;08.2655;08.2700;0;0;0;0;;0;45;;,
.railtype 0;1,
.freeobj 0;1;-0.5;-0.5;0,
5,
.stop 1,
100,
.sta 125th Street;08.2740;08.2750;0;0;0;0;;0;55;;,
.freeobj 0;1;-0.5;-0.5;0,
115,
.stop 1,

--

And thats basically it.  We'll get started on part 2.

Pages: (1/1)