BVE WorldWide
Would you like to react to this message? Create an account in a few clicks or log in to continue.

.section command

3 posters

Go down

.section command Empty .section command

Post by Dexter Tue Apr 16, 2013 7:23 am

Hello everyone,

well, everybody has his thing and this seems to be mine. Very Happy I am considering adding train-dependent signalling into my route, but in fact, I have never worked with these commands. So, if I assume right - the section can have three states (go / stop / next is stop) and this can be train-dependent, based on the ".pretrain" command?

D.
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 39
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

.section command Empty Re: .section command

Post by graymac Tue Apr 16, 2013 9:35 am

There's a LOT of 'official' documentation, here's a part of it:

Track.Section a0; a1; a2; ...; an

ai: A non-negative number specifying one of the section's aspects.
This command starts a section, the functional part of signalling, to be
used in conjunction with Track.SigF, which creates a visual
representation of a section (a signal). The ai
parameters specify the aspects the section can bear. An aspect of 0
corresponds to a red section which must not be passed by a train. The a0 term is mandatory.


Default versus simplified section behavior
There are two different modes of behavior on how to interpret the ai
parameters. The mode can be set via Options.SectionBehavior. The
following are separate descriptions for default and simplified behavior.


Default behavior:
The ai terms specify
the aspect the section should bear depending on how many sections ahead
are clear until a red one is encountered. The order of the terms is
relevant. The same aspect may occur multiple times.
▸ Meanings of the ai terms:

a0: The aspect to show when this section is occupied by a train or otherwise hold at red.
a1: The aspect to show when this section is clear, but the immediately following section is red.
a2: The aspect to show when this section and the
following section are clear, but the one immediately following the
latter one is red.
an: The aspect to show when n sections are clear before a red one is encountered.
In the case more sections ahead are clear than indicated by the ai terms, the section will bear the aspect of an.

Simplified behavior:
The ai terms specify the repertoire of aspects the section can have. A section will bear the smallest of the ai which is greater than the current aspect of the upcoming section. If no such ai exists, the section will bear the aspect of an. The order of the ai is irrelevant. If the same aspect occurs multiple times, this has no effect.


Example of a Track.Section command in conjunction with a Track.SigF command:
With Track
1000, .Section 0;2;4, .SigF 3;0;-3;-1

Don't forget the effect of the 'interval' instruction at the beginning of the route.csv file. The value chosen acts on the time needed for section to clear. I think 'pretrain' over-rides 'interval' but it's not something I understand in great depth.
graymac
graymac

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

http://www.celtictrainsim.com

Back to top Go down

.section command Empty Re: .section command

Post by Dexter Tue Apr 16, 2013 9:47 am

Thank you for the explanation, Gray. I think I get the point, the only thing I am confused with is WHERE exactly is that signal you are talking about shown. I have a feeling it might be similar to the "marker" system...? In the route itself (like physically on the pole), I was thinking about implementing animated signal, which would reflect the section states described above. I think it should be possible to put ".section" commands into the condition of animation as well...?
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 39
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

.section command Empty Re: .section command

Post by graymac Tue Apr 16, 2013 10:07 am

In the section example:

With Track
1000, .Section 0;2;4, .SigF 3;0;-3;-1

1000 is location; .Section 0;2;4 is the signal aspect states for this section (0=red) - next section (2=amber) - section after (4=green). That's a three aspect signal, right? OK, the actual signal OBJECT, located at 1000, is whatever is listed in the Signals listing as signal item 3.

I think the example in the official documentation might refer to program generated signal objects (default??) which configure like this:

▸ Options for Type:

.section command Illustration_signals_small
2: A two-aspect (type A) signal having aspects red and yellow.
-2: A two-aspect (type B) signal having aspects red and green.
3: A three-aspect signal having aspects red, yellow and green.
4: A four-aspect (type A) signal having aspects red, ●●yellow-yellow, yellow and green.
-4: A four-aspect (type B) signal having aspects red, yellow, yellow-green and green.
5: A five-aspect (type A) signal having aspects red, ●●yellow-yellow, yellow, yellow-green and green.
-5: A five-aspect (type B) signal having aspects red, yellow, yellow-green, green and ●●green-green.
6: A six-aspect signal having aspects red, ●●yellow-yellow, yellow, yellow-green, green and ●●green-green.
This command creates a functional signal. You can choose from the available options for Aspect to create any of the default Japanese signals. Setting X to 0 creates a functional but invisible signal similar to Track.Section. Setting X to a non-zero number and Y to a negative number resets the y-coordinate to 4.8 meters and attaches a default signal post.

Example of a four-aspect type B signal without a post at x=-3 and y=5:
1000, Track.Signal -4;;-3;5

Example of a four-aspect type B signal including a post at x=-3 and y=4.8:
1000, Track.Signal -4;;-3;-1
Track.Signal is similar to using Track.Section and Track.SigF in one command.


I never used this method, tending to go for BRSigsOpen / graysigs animated or modified NWM items.
graymac
graymac

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

http://www.celtictrainsim.com

Back to top Go down

.section command Empty Re: .section command

Post by Dexter Tue Apr 16, 2013 11:52 am

Yes, I get the point.
Well, I would like to use my modified signal as well, I have found it would be possible. But obviously I don't want any crappy default objects loaded... I will have to figure that out.
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 39
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

.section command Empty Re: .section command

Post by Quork Tue Apr 16, 2013 12:20 pm

Well, you simply load your signal file in the beginning (below the "Structure" section) like this:

Signal(3).Load BlockSignal

for BlockSignal.ANIMATED. Inside the .animated you need to define formulae for all aspect values (variable is called "section") which can occur in the route file, which would e.g. be 1, 2, 3 and 5 if you insert the signal like this:

1000
.Section 1,2,3,5
.SigF 3,0,x,y,yaw,pitch,roll
Quork
Quork

Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

.section command Empty Re: .section command

Post by Dexter Tue Apr 16, 2013 12:34 pm

Yes. I was thinking about something like that.
If I am not mistaking the "section" thing can be directly influenced by the "pretrain" command, right? Someone was mentioning it in another discussion here...
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 39
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

.section command Empty Re: .section command

Post by Quork Tue Apr 16, 2013 1:40 pm

The OpenBVE sections work just like real life blocks. It either is free or it isn't. If it is free, the signal is showing a permission aspect; if it isn't, the signal is at danger. Now that's perfectly enough for simple two aspect block signals, but not for signals with more aspects; that's why you can specify an aspect number for the case that the section is free. This way, you can have one .animated signal object (let's have it the index "1") and yet use it in different positions, so that it e.g. shows "proceed (40km/h)" if placed before a short switch, "proceed (80km/h)" if placed before a longer one or simply "proceed" if there's no speed limit applying; just by using (e.g.)

.section 2
.signal(1) 0,...

or

.section 3
.signal(1) 0,...

or

.section 1
.signal(1) 0,...

with "1" being the aspect number for "proceed free", "2" "proceed (40km/h)" and "3" "proceed (80km/h)".

However, while that's enough for classical one-section-signals, modern signalling systems often provide the possibility of gradual speed reduction by multisectional signalling, which increases the capacity of a route, both by giving the driver more data for a provident driving style and by decreasing minimum section length (that's why early appliences of that system also were called "half block signalling"). This would mean e.g. that you let the driver proceed freely when the route is free for at least three sections, decrease his speed to 80km/h if there's a train two sections ahead and decrease his speed to 40km/h if there's a train one section ahead (and, of course, stop, if there's a train in the next section). This would look like this:

.section 2,3,1
.signal(1) 0,...

It is, afaik, of no relevance whether you use .RunInterval or .PreTrain; however .RunInterval has far more options for you as the route dev, allows for much more realistic timetables, and also it is visible, while .PreTrain is invisible and doesn't follow a realistic physical model.
Quork
Quork

Posts : 1438
Join date : 2012-05-05
Age : 33
Location : Hofheim a.T., Hessen (Hesse), European Union

Back to top Go down

.section command Empty Re: .section command

Post by Dexter Wed May 01, 2013 2:48 pm

Hello everyone,

done a bit of experimenting and I have one more question - is there any way how to get rid of the default signal post?
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 39
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

.section command Empty Re: .section command

Post by Dexter Wed May 01, 2013 4:48 pm

I am furious.

I put this:

Code:
With Structure

    Signal(0).Load FirstBrnoTrack\Signals\Navestidlo_cervene;
    Signal(2).Load FirstBrnoTrack\Signals\Navestidlo_Oranzove;
    Signal(4).Load FirstBrnoTrack\Signals\Navestidlo_Zelene;

Code:
20
    .Section 0;2;4, .SigF 2;0;3;-1

And all I get is a standalone pole without the signal on its top. I don't want the crappy pole anyway, so probably there is any way to get rid of it, but why is nothing being shown? I do not get any errors / warnings. I have also tried with extensions - *.csv and *.animated


Last edited by Dexter on Wed May 01, 2013 9:55 pm; edited 1 time in total
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 39
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

.section command Empty Re: .section command

Post by graymac Wed May 01, 2013 7:23 pm

Signal(2).Load FirstBrnoTrack\Signals\Navestidlo_Oranzove;

try a plain , instead of ;

I don't know where the pole is coming from, that object is a plain signal lamp unit when I opened it in object viewer. Signal poles are usually a separate freeobj inserted at the same distance as the sig
graymac
graymac

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

http://www.celtictrainsim.com

Back to top Go down

.section command Empty Re: .section command

Post by Dexter Wed May 01, 2013 7:31 pm

I know, that is what confuses me. I think it is defined in the source code to add a pole whenever a "SigF" command is used. However, it is alredy working... I have no idea what was wrong, I only changed the index of the custom loaded signal to 1. apparently 0 is not allowed or something.

I now have a working 3-aspect autoblock. :-)


Last edited by Dexter on Wed May 01, 2013 9:56 pm; edited 1 time in total
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 39
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

.section command Empty Re: .section command

Post by graymac Wed May 01, 2013 8:29 pm

Perhaps there is some difference between your signal object and the type of sig I'm using, maybe a difference which means that you signal object isn't recognised as such, resulting in a bve default object appearing, i.e. the post.

Have you looked at the brsigs or the BrSigs_open as used in NWM / Ballyfeckin routes?? Maybe try one and see if it shows in your route, then maybe work out what that difference is.
graymac
graymac

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

http://www.celtictrainsim.com

Back to top Go down

.section command Empty Re: .section command

Post by Dexter Wed May 01, 2013 8:37 pm

I was able to follow it in the Welsh route; this is your only work I have here at work. I have to be careful. Smile

I figured it out, it is displaying my custom signal now.:-) I am thinking about the glow now, I could make that quite easily. :-) It will be awesome.


Last edited by Dexter on Wed May 01, 2013 9:56 pm; edited 1 time in total
Dexter
Dexter

Posts : 2153
Join date : 2011-07-08
Age : 39
Location : Brno, Czech republic

http://www.brnobve.eu

Back to top Go down

.section command Empty Re: .section command

Post by graymac Wed May 01, 2013 9:00 pm

Happy you got that sorted. Yes, a glow is fairly easy to add.
The Welsh route is split files and not easy to follow the code, even for experienced users. For any beginners who might want to experiment on some route code it would be as well to start with the simpler IWR route from celtictrainsim. It's a single .csv route file and not complicated at all. I would love to see more players getting involved in creating new work for all to enjoy.
graymac
graymac

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

http://www.celtictrainsim.com

Back to top Go down

.section command Empty Re: .section command

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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