How to create a route in CSV! Part 1 by ipaclansite

Pages: (1/1)

ipaclansite:

If you want to learn how to code in RW, you might as well learn the "modern" CSV first. It is very similar to RW so it shouldn't take anytime to transition to learn both ways. I'll be the first to say there are many ways to create a route, there are quite a different ways on how you can write up the route, there is no 1 way on how to do it. There are different variations if you explore these routes, but overall, they're quite similar using some basic logic and common sense. Anyway enough of my garbage talk lets get started.

A CSV file consists of major declarations needed for the route to run, without it, the route is useless.

With Route
With Train
With Texture
With Structure
With Track

With Route specifies the general information of the route, like basic information of the route, and the track gauge, you can also define a developer's ID and a timetable.
Some examples of the With Route below.

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

Above I used the With Route declaration, everything under it goes as the With Route. .comment displays what you see in this picture below



.gauge 1435, is simple, .gauge and then the gauge number. The standard gauge in the United States is 1435.

Also note that every line ends with a , or comma. Without the comma you will experience errors when you run your route, causing some things you may want to appear not appear. The exceptions are the major declarations above, which do not require a comma.

With train specifies the train that we will be using. You must specify the name of the folder the train is called. So if the train is a R160B, and the folder is named R160B, then we would put something like this in the route file.
With Train
.folder R160B,

.folder specifies the name of the folder like I stated above. If the folder name is something else, then change it to that. If my R160B had the folder named "NiceTrain" then we'd have to put .folder NiceTrain,

With Texture is quite an easy declaration, under it you simply specify the background image of the route, this declaration isn't really that major and can be placed under the With Structure declaration. It works the same way. I just hope I dont confuse you with this.
With Texture
.background(1) 2ndAveT\bg.bmp,

.background begins the .background command
(1) is the index number, we'll be using it later when we're actually making the route.
2ndAveT\bg.bmp, is the location of our texture file. Beginning from the Object folder. So if it was just bg.bmp then that would mean bg.bmp is in the Object Folder.

With Structure easy enough to put it in the route file, everything below this is quite tedious so hold on and pay attention.
Code:
--
With Structure
.rail(0) 2ndAveT\Ballast3RL.b3d,
.rail(1) 2ndAveT\Ballast3RR.b3d,
.freeobj(1) 2ndAveT\XR25L.b3d,
.freeobj(2) 2ndAveT\XL25R.b3d,
--

.rail is the rail command obviously it specifies the index numbers of the rail that will be used in the route.
(0) is the index number.
2ndAveT\Ballast3RL.b3d, is once again the location of the rail, and Beginning from the Object folder again.
.freeobj is the free object command, and specifies the index numbers for each object that will be used in the route.
(1) is the index number.
2ndAveT\XR25L.b3d is once again the location of the object we will be placing on the route.

Of course we can have hundreds of free objects and rails, depending on the detail and length of your route. The maximum amount of objects you can have is 65535. So go figure, .freeobj(65535) somefolder\someobject.b3d,

Hopefully that wasn't so bad. Now on to the actual route, the With Track declaration.
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;2;-2.2;-0.5;0,
5,
.stop 1,
--

The first thing you should do is specify the distance. See that 0, thats distance 0. The distances are in meters for your information.
.back is the background command 1 is the index number to read from.
Remember our .background(1) 2ndAveT\bg.bmp, ?
.back 1, reads from that line. And will set the background to bg.bmp. Should we have another background image, we would have another index number, and we would have to specify another number for .back

.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.

Now that we got that out of the way the .railtype 0;1, .railtype specifies the type of rail that we will be laying. 0 is the rail index. 0 will ALWAYS be the rail the train is on. Finally the 1 is the rail index, specified from the indexed .rail above. Thats how a majority of route creation works, if you dont understand this concept of indexing files, and then using them, then go back and try to grasp it again. Everything else should be easier after this.

.freeobj is the free object command again. There is a difference between the .freeobj for With Structure and With Track, so observe the 2 lines and see the difference. One specifies the index, and the other uses the index. I'll explain it now.
0 specifies the rail index, or the rail the train is on. 2 is the object we indexed under With Structure. -2.2 is the X axis, -2.2 in meters is the distance from track 0 on the X axis. Since the track we're on is 0, and the X-axis for this object is -2.2meters it means that this object is 2.2 meters to the left of rail 0. If the number was positive, then it would be 2.2 meters to the right of rail 0. Next is the Y-Axis, and is the same concept of the X-axis. A positive number is further up, and the negative number is further down. Finally the last 0 is the rotation of the object, from 0-360 obviously.

Finally its the 5, 5 meters. Technically these numbers can be considered the Z axis if you want to consider it that way.

.stop is the stop command or the end of the station. The 1 specifies the stop position of the stop marker (-1 for left) (1 for right) (0 for none.)

And thats basically it. The basics, there is alot more to learn.

Pages: (1/1)