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

Any way to know the exact index of the terminal station of a route in animated?

2 posters

Go down

Any way to know the exact index of the terminal station of a route in animated? Empty Any way to know the exact index of the terminal station of a route in animated?

Post by NYCT_Railer Wed Jul 01, 2020 5:20 am

Hey, I have been working on some destination-related animated stuff for trains, but it seems as if there is no way I can return the index of the terminal station, is there actually a way or can it be a possible addition? Sad
NYCT_Railer
NYCT_Railer

Posts : 9
Join date : 2020-04-25

Back to top Go down

Any way to know the exact index of the terminal station of a route in animated? Empty Re: Any way to know the exact index of the terminal station of a route in animated?

Post by leezer3 Wed Jul 01, 2020 10:59 pm

That's an easy one for once Razz

Build from today will add the instruction TerminalStation to animated files.
This returns as follows:
* Working downwards from the last station, the first station of type Terminal.
* If no station with the type terminal is defined, returns the last station.

(An alternative nasty workaround would be to check the distance to station indices. If a station index does not exist, the distance returned is *exactly* zero, and it'd be possible to determine the final station by starting at say station 15 and working downwards to the first non-zero distance. Wouldn't reccomend this though for obvious reasons)

Edit:
Just found a minor bug as a consequence of this.
The first station in a route cannot be set as a Terminal type. This will now generate a warning & reset the station to a standard type.

Edit 2:
The first station can't be set to Change Ends or Jump either, again both will now generate warnings.
(None of these cases worked in any sensible way to start with, either froze or generated a spurious terminal station message, so no loss)

leezer3

Posts : 1961
Join date : 2011-08-23

http://www.bvecornwall.co.uk

Back to top Go down

Any way to know the exact index of the terminal station of a route in animated? Empty Re: Any way to know the exact index of the terminal station of a route in animated?

Post by NYCT_Railer Thu Jul 02, 2020 2:59 pm

Thank you so much! I really appreciate it, works flawlessly to my needs, I will report any mishaps hereĀ  Very Happy
NYCT_Railer
NYCT_Railer

Posts : 9
Join date : 2020-04-25

Back to top Go down

Any way to know the exact index of the terminal station of a route in animated? Empty Re: Any way to know the exact index of the terminal station of a route in animated?

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