RailIndex vs RailType

View previous topic View next topic Go down

RailIndex vs RailType

Post by lonelyinardwick on Sun Oct 09, 2011 3:23 am

I'm reading Michelle's guide on Rails, and I'm a little confused with the difference between the two. Could someone help me here?

lonelyinardwick

Posts : 375
Join date : 2011-07-24

https://about.me/lonelyinardwick

Back to top Go down

Re: RailIndex vs RailType

Post by Dexter on Sun Oct 09, 2011 8:00 am

RailIndex is a constant that assigns an index to a rail for its lifetime. It is useful when you want to associate an object (and also dikes etc.) to that rail, and also when you want to change the RailType.

RailType on the other hand modifies the rail as it is displayed, provided that we have different objects defined in the "With Structure" section of the route.
avatar
Dexter

Posts : 1795
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: RailIndex vs RailType

Post by velaro on Sun Oct 09, 2011 8:03 am

Derryck beat me to it ... some additions:

Put another way, RailIndex is just the number of the rail or rather the track. The train (currently) always runs on rail number 0. For instance, you might build a four-track line with rails 0 through 3 (though the numbers do not need to be consecutive).

The objects displayed depending on your choice of RailType are defined in Structure.Rail. RailType also indirectly determines the track sound played as the sounds are linked to them in Train.Run.
avatar
velaro

Posts : 23
Join date : 2011-08-02
Age : 41
Location : Reutlingen, Germany

Back to top Go down

Re: RailIndex vs RailType

Post by lonelyinardwick on Sun Oct 09, 2011 4:32 pm

Could you put it in more simple words please, kinda getting the hang of it but..

lonelyinardwick

Posts : 375
Join date : 2011-07-24

https://about.me/lonelyinardwick

Back to top Go down

Re: RailIndex vs RailType

Post by graymac on Sun Oct 09, 2011 5:01 pm

When you start off you have only the rail you run on, it is indexed 0
So every command in the route will refer to rail 0, such as .freeobj 0;99 where 0 is the rail the object is referenced to in space and 99 is the index of the object.
Add another track and you give it a rail index. So, add a track 4 metres to the right of the running rail the instruction is .Railstart 1;4;y;t
1 is the number you have given for the rail, 4 is distance to right (x axis) y is distance up or down (y axis) and t is the railtype listed in your With structure space.
You will see once you have started the new rail 1 it will follow the running rail 0 as long as it is allowed to exist. The distance from rail 0 can be changed up, down and sideways by using With track instruction .rail 1;x;y;t at any 25mtr interval along the way. The instruction .Railend 1
ends the rail. You can reuse /restart the rail 1 later on if you want.

However many rails you have over and above rail 0, they are only virtual rails as the train itself only runs on rail 0 You can attach freeobjs to these extra rails in the same way that you would with the running rail. Just put the rail index as the first number in the freeobject instruction. If the object was one metre to the left of rail 1 the instruction would be: .freeobj 1;99;-1 where object 99 is put 1metre left of rail 1

See also:http://www.eezypeazy.co.uk/]http://www.eezypeazy.co.uk and get Denis Lance's Routebuilding Tutorial to learn how to tackle a basic route.

avatar
graymac

Posts : 1737
Join date : 2011-08-28
Location : Co Mayo, Eire

http://www.celtictrainsim.com

Back to top Go down

Re: RailIndex vs RailType

Post by joeyfjj on Sun Oct 09, 2011 5:46 pm

RailIndex = a number, like a name you give to a track

RailType = a command.

joeyfjj

Posts : 262
Join date : 2011-07-30
Location : Singapore

http://openbve.joeyfoo.com

Back to top Go down

Re: RailIndex vs RailType

Post by Dexter on Sun Oct 09, 2011 5:52 pm

It is good that a few of us have put their knowledge together to provide as much information as possible. That is a pleasing attitude. Thanks to all.
avatar
Dexter

Posts : 1795
Join date : 2011-07-08
Age : 31
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

Re: RailIndex vs RailType

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum