Train-Sim.Com
BVE

CSV Randomisation - Info / Tutorial post

Notice to all visitors and members of the Train-Sim.Com message forums:
If you plan on using a signature banner in your posts, we would like to remind you that there is a maximum size for banners. That maximum is 450 pixels wide by 120 pixels high, and not to exceed 25k. Your compliance is appreciated. FORUM RULES Problems? There are two common reasons for problems with logging in and posting messages. The first is that you are running a firewall that prevents your messages from being sent to the server. The other is that you have cookies disabled; the DCForum software requires cookies to work properly.

Previous Topic | Next Topic

Printer-friendly copy Email this topic to a friend

Reading Topic #985

Charter Member · 327 posts

CSV Randomisation - Info / Tutorial post – image 1

LAST EDITED ON Oct-31-03 AT 07:28 AM (EST) by Wulf_9 (moderator)

RandomizationA tricky topic, very little is known about it by many people and therefore it's very little used. Allows simple randomization of routes without having to use BRR. I am not trying to 'compete' with BRR or anything, but I just wish to post a little info about this little known topic).The $RND command will return a random number between two given integers.For example$RND(1;8) will output a random number between 1 and 8.The $RND command can be dropped into a CSV file. For example, you may have a yard on your route. You could use the $RND command to set up a train on one of the tracks..freeobj $RND(2;9);6,If 2 to 9 are the yard tracks and freeobject 6 is the train. A random number between 2 and 9 will be generated by BVE and used where the $RND command is, therefore it selects which track to place the train on.You can also go a lot further, such as the following. Freeobjects 171 to 180 are single people and this will place them on a platform :-.freeobj 2;$RND(171;180);$RND(3;5);0.6;$RND(1;25),Another variant :-$RND(20;24),.freeobj 2;$RND(171;180);$RND(3;5);0.6;$RND(1;25),Will place one of the people objects at a random distance both along the route and to the left.Back on the train object example. Some trains are in different sections, each 25m long.Say we have track 0 our running track, and tracks 1, 2 and 3 which are yard tracks. Freeobject 1 is a locomotive, freeobject 2 is an MGR wagon. We can use the $RND command to pick a random track to place the train on. However if we use a different command for each object, you might get a loco on track 1, wagon on track 2, another wagon on track 3 etc. Therefore you need to generate one random number and then have the object placement statements reading from the one generated random number. To do this you use another of the $ commands, even less known than $RND, it is $SUB.Before the With Track statement, insert the following$SUB(0)=$RND(1;3)This means that the variable 0 is now a random number between 1 and 3. So when you come to your train you reference the variable as a track number100,.freeobj $SUB(0);1,
125,.freeobj $SUB(0);2,
etcAll the statements look for variable 0 when finding where to place it, look in the variable 0 section and the variable is the random number, the same random number is used for them all.Hope this is of some use!--
Tom Beevers
http://brj.rr.nu

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

RE: CSV Randomisation - Info / Tutorial post, Wulf_9, Oct-30-03, 01:16 PM, (1) RE: CSV Randomisation - Info / Tutorial post, tof63, Oct-30-03, 04:00 PM, (2) RE: CSV Randomisation - Info / Tutorial post, TomBeevers2000, Oct-30-03, 04:15 PM, (3) RE: CSV Randomisation - Info / Tutorial post, bassv, Oct-30-03, 05:01 PM, (4) RE: CSV Randomisation - Info / Tutorial post, Anthony_B, Oct-30-03, 07:22 PM, (5) RE: CSV Randomisation - Info / Tutorial post, bassv, Oct-31-03, 10:32 AM, (10) RE: CSV Randomisation - Info / Tutorial post, Stooopid_person, Oct-31-03, 01:43 AM, (6) RE: CSV Randomisation - Info / Tutorial post, TomBeevers2000, Oct-31-03, 03:30 AM, (7) RE: CSV Randomisation - Info / Tutorial post, Routemaster J, Oct-31-03, 03:56 AM, (8) RE: CSV Randomisation - Info / Tutorial post, Wulf_9, Oct-31-03, 07:27 AM, (9)

Conferences | Topics | Previous Topic | Next Topic

Member since Apr-8-03 · 22 posts

RE: CSV Randomisation - Info / Tutorial post

CSV Randomisation - Info / Tutorial post – image 5

Very nice Tom! And how about randomising the pretrain command? This will add delays to the route. For example:
.pretrain 12$RND(10;14)00;This will cause that the preceding train is at this point between 12:10 and 12:14. When you randomise the pretrain command, it can happen that you run into a red signal instead of having always a green signal ahead. It also prevends the fact that you won't brake at a yellow signal, because you know (because you've driven the route more than once) that the signal will turn green when you aproach it, like in Birmingham South route of Steven Green.Well, I hope you understand what I mean... I'm not that good in explaining something in English... Cheers,BassV

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 29 posts

RE: CSV Randomisation - Info / Tutorial post

CSV Randomisation - Info / Tutorial post – image 6

On Cross-City South (built by me ), I experimented with randomising .Pretrain commands to control the signalling, and I didn't like having to listen to the wrong AWS sound effects half the time, so I deliberately left it out, and probably always will do unless something that works like a fully functioning UK Automatic Warning System is built into BVE itself.Incidentally the signals that change from red to green (called approach controlled signals) are designed to ensure a train driver slows down in time for the points beyond the signal and it's a safety measure.Btw great guide Tom!Cheers,
Anthony.
--
www.railsimroutes.co.uk
www.bvetrains.co.uk
www.railsimroutes.co.uk/bvehelp/

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Apr-8-03 · 22 posts

RE: CSV Randomisation - Info / Tutorial post

CSV Randomisation - Info / Tutorial post – image 7

>On Cross-City South (built by me I'm sooo sorry Anthony!! Of course I meant the route built by you and not by Steven...>I experimented with
>randomising .Pretrain commands to control the signalling,
>and I didn't like having to listen to the wrong AWS sound
>effects half the time, so I deliberately left it out, and
>probably always will do unless something that works like a
>fully functioning UK Automatic Warning System is built into
>BVE itself. You're right about this. I didn't realise this when I wrote my post.>Incidentally the signals that change from red to green
>(called approach controlled signals) are designed to ensure
>a train driver slows down in time for the points beyond the
>signal and it's a safety measure.
>
Never thought of that while I was driving the route Cheers,BassV

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 3194 posts

RE: CSV Randomisation - Info / Tutorial post

CSV Randomisation - Info / Tutorial post – image 8

>You can also go a lot further, such as the following.
>Freeobjects 71 to 80 are single people and this will place
>them on a platform :-
>
>.freeobj 2;1$RND(71;80);$RND(3;5);0.6;$RND(1;25),
>
>Another varient :-
>
>327$RND(20;24),.freeobj
>2;1$RND(71;80);$RND(3;5);0.6;$RND(1;25), Why is there a "1" before the $RND? Or is it just a typo?

-----You are reading my signature now, don't waste your time reading it!-----
Or probably, maybe you should waste your time reading it.
Eh, where did my signature go?
Oh, here it is, the one you are reading right now? Can't you see it? I know I know, it's probably too bright to see it.
Hey, look at my avatar, nice right? I drew it with my own hands holding the mouse in Paint, with the pencil tool(and the Filling tool!)!
It's a picture of me in Planet Stooopid, where everything is the same as what you call "Earth" except that we are called "aliens" in your planet.
Anyway, I warned you not waste time reading my signature! You have just wasted probably about 30 seconds reading it, where you could have spent the time doing better things, like maybe reading the next post below if there is one...

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 327 posts

RE: CSV Randomisation - Info / Tutorial post

CSV Randomisation - Info / Tutorial post – image 9

There is a typo, but it's the "Freeobjects 71 to 80 are single people and..." bit. Should read "Freeobjects 171 to 180 are single people and..." which is true for that code since I took it streight out of Picc v4.Could Wulf or another mod please correct this? Thanks.--
Tom Beevers
http://brj.rr.nu

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Apr-14-03 · 304 posts

RE: CSV Randomisation - Info / Tutorial post

CSV Randomisation - Info / Tutorial post – image 10

This is VERY helpful, I have been wondering how to use it to place more random vehicles for the bus route, and well, you have definitely answered it! Looks like you can look forward to random traffic lights and vehicles and some other effect I had up my sleeve! Also I think this can also be used in the DLR for something, best to keep that a surprise for now, now to start experimenting...

Joshim,
currently constructing the DLR Route for BVE & Oxford Street BUS ROUTE! Check out my website http://joshimsbveroutes.gamehorizons.net/

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Restored from the Train-Sim.Com archive, captured January 26, 2004. About this archive.