How do you have a working track follower to the route?
+3
mrknowitall
S520
Tadek40
7 posters
Page 1 of 1
How do you have a working track follower to the route?
Hi all. This is my first post. I have a problem. I wan to having on the Polish route track follower. Reading all threads related to this and I did it. I created the file needed to make Husarz luzak.animated and typed in accordance with the instructions.
I do not know what to do to make the track follower work. Help me. Cheers.
[Object]
Launch in Openbve Poc_Os.RW and I can not see this train anywhere. And I do not know what this track follower has to be typed in the route file or whether to go in the folder to give the route.position = -4,0,0States = PKP\Siemens ES64U4 Taurus\ext_view\ES64U4.B3DStateFunction = if[value + delta > 20, -1,0]TrackFollowerFunction = if[value == 0, value + 1000, if[trackdistance > -200,if[value < 0, value, value - 10 * delta], value]]
I do not know what to do to make the track follower work. Help me. Cheers.
Tadek40- Posts : 2
Join date : 2017-12-03
Age : 20
Location : Poland :)
Re: How do you have a working track follower to the route?
That looks approximately right.
I assume you've placed your object in the world?
It needs to be placed as a .freeobj command, and won't just appear
Other than that, the following sequence should happen:
A couple of basic things to check:
I assume you've placed your object in the world?
It needs to be placed as a .freeobj command, and won't just appear
Other than that, the following sequence should happen:
- Your object is first loaded by the renderer (e.g. If you place the object at 1,000m and have a viewing distance of 500m, it will first be loaded when the player reaches 500m)
- It is moved 1000m along the line
- It should then move back towards the player
- After 20s, it'll vanish
A couple of basic things to check:
- This only works in openBVE, not Route Viewer.
- You've definitely got your object path right (No errors in the log file)
Re: How do you have a working track follower to the route?
I have worked a little and the effect is satisfying. Thank you
Tadek40- Posts : 2
Join date : 2017-12-03
Age : 20
Location : Poland :)
Re: How do you have a working track follower to the route?
- Code:
Position = 8.5,0,0
StateFunction = if[value + delta > 100, -1,0]
TrackFollowerFunction = if[value == 0, value + 250, if[trackdistance > -150,if[value < 0, value, value - 10 * delta], value]]
this code works fine in terms of an approaching train into a station, but how would i add the correct code for the train to progressively slow down? rather than an immediate stop from 15mph or so.
mrknowitall- Posts : 824
Join date : 2011-07-09
Age : 32
Location : W. Yorkshire
Re: How do you have a working track follower to the route?
Short answer is not easily
TrackFollowingObjects (essentially a lightweight AI train) are a little more suited to this, but are a somewhat more recent addition:
https://openbve-project.net/documentation_hugo/en/routes/xml/trackfollowingobject.html
TrackFollowingObjects (essentially a lightweight AI train) are a little more suited to this, but are a somewhat more recent addition:
https://openbve-project.net/documentation_hugo/en/routes/xml/trackfollowingobject.html
Re: How do you have a working track follower to the route?
leezer3 wrote:Short answer is not easily
TrackFollowingObjects (essentially a lightweight AI train) are a little more suited to this, but are a somewhat more recent addition:
https://openbve-project.net/documentation_hugo/en/routes/xml/trackfollowingobject.html
From the link provided, would that mean i dont use the .animated file and switch to a XML instead?
mrknowitall- Posts : 824
Join date : 2011-07-09
Age : 32
Location : W. Yorkshire
Re: How do you have a working track follower to the route?
No.
Specify the train folder with the Train attribute in XML.
The train folder contains train.dat, sound.cfg and extensions.cfg like a normal train.
Please see the thread below for a concrete sample.
https://bveworldwide.forumotion.com/t1770-openbve-1-6-0-train-coupling-full-animation-demo-of-tohoku-shinkansen-at-morioka-series-e5-and-e6-using-the-trackfollowingobject
Specify the train folder with the Train attribute in XML.
The train folder contains train.dat, sound.cfg and extensions.cfg like a normal train.
Please see the thread below for a concrete sample.
https://bveworldwide.forumotion.com/t1770-openbve-1-6-0-train-coupling-full-animation-demo-of-tohoku-shinkansen-at-morioka-series-e5-and-e6-using-the-trackfollowingobject
Re: How do you have a working track follower to the route?
S520 wrote:No.
Specify the train folder with the Train attribute in XML.
The train folder contains train.dat, sound.cfg and extensions.cfg like a normal train.
Please see the thread below for a concrete sample.
https://bveworldwide.forumotion.com/t1770-openbve-1-6-0-train-coupling-full-animation-demo-of-tohoku-shinkansen-at-morioka-series-e5-and-e6-using-the-
Your concrete example doesn’t show code only a video, can you spare the time to dum it down so that new developers as such can understand it? I haven’t really dabbled with XML before and cannot find a detailed explanation of what goes where etc.
mrknowitall- Posts : 824
Join date : 2011-07-09
Age : 32
Location : W. Yorkshire
Re: How do you have a working track follower to the route?
I'm sorry.
I did n’t review the posts well.
Did you see the page shown by leezer3?
Specific examples can be found in the Basic Principles section.
I did n’t review the posts well.
Did you see the page shown by leezer3?
Specific examples can be found in the Basic Principles section.
Re: How do you have a working track follower to the route?
Yeah I did but I presumed that was for a .animated file? Are we still talking about animated files or XML like keeper states above?
mrknowitall- Posts : 824
Join date : 2011-07-09
Age : 32
Location : W. Yorkshire
Re: How do you have a working track follower to the route?
.animated is referenced from extensions.cfg.
Re: How do you have a working track follower to the route?
If you wish, have my friend provide a concrete sample, what do you do?
Re: How do you have a working track follower to the route?
S520 wrote:If you wish, have my friend provide a concrete sample, what do you do?
The code I placed above enables a train to approach the starting point of a route and stop at a platform. But it goes from 5mph to 0mph without slowing down first. I see in your video your trains stops gradually. I’m wishing to know the code or learn what code goes where in relation to the animated file. And an explanation of the XML file, as to date, I have not had any experience with XML files so unsure where to place them or how to relate to them in a route file etc.
mrknowitall- Posts : 824
Join date : 2011-07-09
Age : 32
Location : W. Yorkshire
Re: How do you have a working track follower to the route?
I asked my friend to post a sample on the forum.
It seems that it takes several days to post for translation.
This is open to the Japanese community.
Well, before that, I want to answer your questions as much as possible.
First, the previous video uses a different file than the document example.
The following is an example of file placement.
The syntax for specifying XML from a route file is as follows:
Finally thanks for your interest in this feature.
I am very happy as a developer.
It seems that it takes several days to post for translation.
This is open to the Japanese community.
Well, before that, I want to answer your questions as much as possible.
First, the previous video uses a different file than the document example.
The following is an example of file placement.
- Code:
Railway---route---ExampleRoute-+-ExampleRoute.csv
|
+-Example.xml
|
+-ExampleTrain-+-train.dat
|
+-extensions.cfg
|
+-sound.cfg
|
+-Example.animated
The syntax for specifying XML from a route file is as follows:
- Code:
Route.TfoXml("Relative path to the xml file")
Finally thanks for your interest in this feature.
I am very happy as a developer.
Re: How do you have a working track follower to the route?
First, thanks to S520 for this feature
I'm not sure if I'll confuse things further or not, but let's start.....
A TrackFollowingObject is essentially a lightweight AI train, which may run on any rail defined in a route.
This feature is controlled by an XML file.
The first thing we need to do is to create our XML file, which defines how the object behaves.
Let's take the example from the page linked above:
Working downwards, we first have the definition of when the object should appear:
This should be relatively self-explanatory- The object should appear at 1 minute past midnight, if our camera position is between 50m and 100m. It will then be visible for 5 minutes before disappearing.
Our second definition is that of the train folder:
It will search both the OpenBVE train folder, and the Object folder if the train does not exist there. Again, relatively self-explanatory.
The final section defines a set of steps to control what the train actually does:
This is a little more complex, but still hopefully relatively easy to follow.
There are a total of 4 {Stop} sections in this part.
Each one represents on action for the object to perform.
Let's take the first:
As this is the first instruction, the absolute track position where the object first appears is controlled here:
{StopPosition}200{/StopPosition}
In subsequent {Stop} sections, this then controls the target destination for the AI to move to.
You'll note the {Decelerate}0.0{/Decelerate} value above this- This means that our AI will start stopped, as opposed to in motion.
{Doors}1{/Doors} is easy, and just controls the side the doors will open. (And will therefore be displayed on the train objects via the animated file)
Next is {StopTime}00.0020{/StopTime} and again, this is straightforward, defining the time to remain stopped (20s).
The final part of this instruction controls the behaviour of the AI *after* it has stopped.
{Accelerate}1.71{/Accelerate} - This controls how fast the AI will accelerate in km/h/s
{TargetSpeed}30{/TargetSpeed} - The target speed for the AI to reach is 30km/h, after which it will stop accelerating. (Note: If a subsequent instruction is hit, the train will not necessarily get to this speed)
{Direction}1{/Direction} - Easy, we're going forwards
{Rail}2{/Rail} - Again easy, we're running on Rail 2.
The subsequent {Stop} sections just add additional waypoints for the AI to follow.
When the last waypoint is reached, it'll continue following the instructions in this until it is removed by the {LeaveTime} in the first section.
NOTE:
I've had to replace the < & > with curly braces in the text here to stop the forum software eating them....
I'm not sure if I'll confuse things further or not, but let's start.....
A TrackFollowingObject is essentially a lightweight AI train, which may run on any rail defined in a route.
This feature is controlled by an XML file.
The first thing we need to do is to create our XML file, which defines how the object behaves.
Let's take the example from the page linked above:
- Code:
<?xml version="1.0" encoding="utf-8"?>
<openBVE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<TrackFollowingObject>
<Definition>
<!--Time when the object appears[hh.mmss]-->
<AppearanceTime>00.0100</AppearanceTime>
<!--In-game distance of the starting point at which the object appears[m]-->
<AppearanceStartPosition>50</AppearanceStartPosition>
<!--In-game distance of the end point at which the object appears[m]-->
<AppearanceEndPosition>100</AppearanceEndPosition>
<!--The duration for which the object appears[hh.mmss]-->
<LeaveTime>00.0500</LeaveTime>
</Definition>
<Train>
<!--Relative path of Train folder-->
<Directory>TrainDirectory</Directory>
</Train>
<Stops>
<!--Start-->
<Stop>
<!--Deceleration[km/h/s]-->
<Decelerate>0.0</Decelerate>
<!--In-game distance of stop position[m]-->
<StopPosition>200</StopPosition>
<!--Door that open at this point-->
<Doors>1</Doors>
<!--Time to keep stopping[hh.mmss]-->
<StopTime>00.0020</StopTime>
<!--Acceleration[km/h/s]-->
<Accelerate>1.71</Accelerate>
<!--Speed after acceleration[km/h]-->
<TargetSpeed>30</TargetSpeed>
<!--Progress direction [1: forward, -1: backward]-->
<Direction>1</Direction>
<!--Traveling track-->
<Rail>2</Rail>
</Stop>
<!--Maximum speed change-->
<Stop>
<Decelerate>0</Decelerate>
<StopPosition>400</StopPosition>
<StopTime>00.0000</StopTime>
<Accelerate>0</Accelerate>
<TargetSpeed>60</TargetSpeed>
<Direction>1</Direction>
<Rail>2</Rail>
</Stop>
<!--Return-->
<Stop>
<Decelerate>1.71</Decelerate>
<StopPosition>1000</StopPosition>
<Doors>B</Doors>
<StopTime>00.0010</StopTime>
<Accelerate>1.71</Accelerate>
<TargetSpeed>30</TargetSpeed>
<Direction>-1</Direction>
<Rail>1</Rail>
</Stop>
<!--Goal-->
<Stop>
<Decelerate>1.71</Decelerate>
<StopPosition>200</StopPosition>
<Doors>R</Doors>
<StopTime>00.0030</StopTime>
<Accelerate>0</Accelerate>
<TargetSpeed>0</TargetSpeed>
<Direction>1</Direction>
<Rail>1</Rail>
</Stop>
</Stops>
</TrackFollowingObject>
</openBVE>
Working downwards, we first have the definition of when the object should appear:
- Code:
<Definition>
<!--Time when the object appears[hh.mmss]-->
<AppearanceTime>00.0100</AppearanceTime>
<!--In-game distance of the starting point at which the object appears[m]-->
<AppearanceStartPosition>50</AppearanceStartPosition>
<!--In-game distance of the end point at which the object appears[m]-->
<AppearanceEndPosition>100</AppearanceEndPosition>
<!--The duration for which the object appears[hh.mmss]-->
<LeaveTime>00.0500</LeaveTime>
</Definition>
This should be relatively self-explanatory- The object should appear at 1 minute past midnight, if our camera position is between 50m and 100m. It will then be visible for 5 minutes before disappearing.
Our second definition is that of the train folder:
- Code:
<Train>
<!--Relative path of Train folder-->
<Directory>TrainDirectory</Directory>
</Train>
It will search both the OpenBVE train folder, and the Object folder if the train does not exist there. Again, relatively self-explanatory.
The final section defines a set of steps to control what the train actually does:
- Code:
<Stops>
<!--Start-->
<Stop>
<!--Deceleration[km/h/s]-->
<Decelerate>0.0</Decelerate>
<!--In-game distance of stop position[m]-->
<StopPosition>200</StopPosition>
<!--Door that open at this point-->
<Doors>1</Doors>
<!--Time to keep stopping[hh.mmss]-->
<StopTime>00.0020</StopTime>
<!--Acceleration[km/h/s]-->
<Accelerate>1.71</Accelerate>
<!--Speed after acceleration[km/h]-->
<TargetSpeed>30</TargetSpeed>
<!--Progress direction [1: forward, -1: backward]-->
<Direction>1</Direction>
<!--Traveling track-->
<Rail>2</Rail>
</Stop>
<!--Maximum speed change-->
<Stop>
<Decelerate>0</Decelerate>
<StopPosition>400</StopPosition>
<StopTime>00.0000</StopTime>
<Accelerate>0</Accelerate>
<TargetSpeed>60</TargetSpeed>
<Direction>1</Direction>
<Rail>2</Rail>
</Stop>
<!--Return-->
<Stop>
<Decelerate>1.71</Decelerate>
<StopPosition>1000</StopPosition>
<Doors>B</Doors>
<StopTime>00.0010</StopTime>
<Accelerate>1.71</Accelerate>
<TargetSpeed>30</TargetSpeed>
<Direction>-1</Direction>
<Rail>1</Rail>
</Stop>
<!--Goal-->
<Stop>
<Decelerate>1.71</Decelerate>
<StopPosition>200</StopPosition>
<Doors>R</Doors>
<StopTime>00.0030</StopTime>
<Accelerate>0</Accelerate>
<TargetSpeed>0</TargetSpeed>
<Direction>1</Direction>
<Rail>1</Rail>
</Stop>
</Stops>
This is a little more complex, but still hopefully relatively easy to follow.
There are a total of 4 {Stop} sections in this part.
Each one represents on action for the object to perform.
Let's take the first:
- Code:
<Stop>
<!--Deceleration[km/h/s]-->
<Decelerate>0.0</Decelerate>
<!--In-game distance of stop position[m]-->
<StopPosition>200</StopPosition>
<!--Door that open at this point-->
<Doors>1</Doors>
<!--Time to keep stopping[hh.mmss]-->
<StopTime>00.0020</StopTime>
<!--Acceleration[km/h/s]-->
<Accelerate>1.71</Accelerate>
<!--Speed after acceleration[km/h]-->
<TargetSpeed>30</TargetSpeed>
<!--Progress direction [1: forward, -1: backward]-->
<Direction>1</Direction>
<!--Traveling track-->
<Rail>2</Rail>
</Stop>
As this is the first instruction, the absolute track position where the object first appears is controlled here:
{StopPosition}200{/StopPosition}
In subsequent {Stop} sections, this then controls the target destination for the AI to move to.
You'll note the {Decelerate}0.0{/Decelerate} value above this- This means that our AI will start stopped, as opposed to in motion.
{Doors}1{/Doors} is easy, and just controls the side the doors will open. (And will therefore be displayed on the train objects via the animated file)
Next is {StopTime}00.0020{/StopTime} and again, this is straightforward, defining the time to remain stopped (20s).
The final part of this instruction controls the behaviour of the AI *after* it has stopped.
{Accelerate}1.71{/Accelerate} - This controls how fast the AI will accelerate in km/h/s
{TargetSpeed}30{/TargetSpeed} - The target speed for the AI to reach is 30km/h, after which it will stop accelerating. (Note: If a subsequent instruction is hit, the train will not necessarily get to this speed)
{Direction}1{/Direction} - Easy, we're going forwards
{Rail}2{/Rail} - Again easy, we're running on Rail 2.
The subsequent {Stop} sections just add additional waypoints for the AI to follow.
When the last waypoint is reached, it'll continue following the instructions in this until it is removed by the {LeaveTime} in the first section.
NOTE:
I've had to replace the < & > with curly braces in the text here to stop the forum software eating them....
Re: How do you have a working track follower to the route?
This is a sample TFO route data for OpenBVE1.6.0.
It needs to run for my Tohoku-Shinkansen's Object and route(for object check).
Please read readme.txt.
My route is created by UTF-8.
Please do not use WINZIP, use 7-zip.
https://www.7-zip.org/
This demo is parallel dual lines, the opposite side's TFO train moves from final station to begining station.
stopping and door operation, and finally, back to the final station.
I wrote how to create several stations and stop at each station, and how to change to the rails.
Please read XML file's comment.
It needs to run for my Tohoku-Shinkansen's Object and route(for object check).
Please read readme.txt.
My route is created by UTF-8.
Please do not use WINZIP, use 7-zip.
https://www.7-zip.org/
This demo is parallel dual lines, the opposite side's TFO train moves from final station to begining station.
stopping and door operation, and finally, back to the final station.
I wrote how to create several stations and stop at each station, and how to change to the rails.
Please read XML file's comment.
- Attachments
Midnight Express Ginga81- Posts : 154
Join date : 2016-09-25
Re: How do you have a working track follower to the route?
Dear Mr. mrknowitall,
My friend Ginga81 prepared a sample of TFO.
Please try the sample.
My friend Ginga81 prepared a sample of TFO.
Please try the sample.
Re: How do you have a working track follower to the route?
S520 wrote:Dear Mr. mrknowitall,
My friend Ginga81 prepared a sample of TFO.
Please try the sample.
As soon as I get home I will, thankyou!
mrknowitall- Posts : 824
Join date : 2011-07-09
Age : 32
Location : W. Yorkshire
Re: How do you have a working track follower to the route?
Chris, in your previus post you said about the {directory} entry:
It will search both the OpenBVE train folder, and the Object folder if the train does not exist there. Again, relatively self-explanatory.
In my experience OpenBVE couldn't find the AI trains in the Object folder, and it crashed. Neither could it find them if they were in the root of the Object folder nor if they were in a subdirectory.
This seems to be true for any recent OpenBVE version.
It will search both the OpenBVE train folder, and the Object folder if the train does not exist there. Again, relatively self-explanatory.
In my experience OpenBVE couldn't find the AI trains in the Object folder, and it crashed. Neither could it find them if they were in the root of the Object folder nor if they were in a subdirectory.
This seems to be true for any recent OpenBVE version.
Re: How do you have a working track follower to the route?
You're entirely right.
Updated it to match the documentation, and fixed the crashing.....
There will be another version 'soon' to squeeze a bit more performance out of the new renderer, hopefully get the old renderer back to where it was (on my list to look at this week) and deal with a few more miscellaneous bits and pieces.
Updated it to match the documentation, and fixed the crashing.....
There will be another version 'soon' to squeeze a bit more performance out of the new renderer, hopefully get the old renderer back to where it was (on my list to look at this week) and deal with a few more miscellaneous bits and pieces.
Re: How do you have a working track follower to the route?
When I start this route, the openBVE programme (version v1.7.1.0)cannot run.Midnight Express Ginga81 wrote:This is a sample TFO route data for OpenBVE1.6.0.
It needs to run for my Tohoku-Shinkansen's Object and route(for object check).
Please read readme.txt.
My route is created by UTF-8.
Please do not use WINZIP, use 7-zip.
https://www.7-zip.org/
This demo is parallel dual lines, the opposite side's TFO train moves from final station to begining station.
stopping and door operation, and finally, back to the final station.
I wrote how to create several stations and stop at each station, and how to change to the rails.
Please read XML file's comment.
kwchan- Posts : 3
Join date : 2012-08-04
Re: How do you have a working track follower to the route?
OpenBVE 1.7.1.0 crashes if it cannot find the XML based TFO trains. In that version of OpenBVE they must be in the Train folder and they must be linked from there in the .xml files (meaning simply inputting the directory names, without anything else from the folder structure).
NB: Newer development versions of OpenBVE can find XML based TFO trains in other places as well.
NB: Newer development versions of OpenBVE can find XML based TFO trains in other places as well.
Re: How do you have a working track follower to the route?
Hello, mr.kwchan.
What way were you install Series-E6 and TFO demo route?
I can't recognize what happened your error by your question.
Please upload errorlog.
How to:
Please push OpenBVE's mainmenu, at left under's button 'Report Problem'.
Press 'Report Problem' button.
OpenBVE create a .zip file.
Upload zip file.
What way were you install Series-E6 and TFO demo route?
I can't recognize what happened your error by your question.
Please upload errorlog.
How to:
Please push OpenBVE's mainmenu, at left under's button 'Report Problem'.
Press 'Report Problem' button.
OpenBVE create a .zip file.
Upload zip file.
Midnight Express Ginga81- Posts : 154
Join date : 2016-09-25
Similar topics
» Trying to get a route working in BVE5
» Working On New Route Or Train?
» Cannot load a route, fails with "The selected route is corrupt: No objects defined."
» Variable track block lengths throughout the route
» Proposal to add ROUTE VIEWER function to view track information of OPENBVE.
» Working On New Route Or Train?
» Cannot load a route, fails with "The selected route is corrupt: No objects defined."
» Variable track block lengths throughout the route
» Proposal to add ROUTE VIEWER function to view track information of OPENBVE.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum