Community Forum

New Trains

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created24.04.2020 07:47


Emincan YaĞiz (Emincan) 24.04.2020 07:47
Hello everybody,
How can i add new trains?(without replace data folder)
I want add new trains into mod directory. Is this possible?
I tried but result was failure.

Bilbo Beutlin (BBeutlin) 24.04.2020 10:47
Each train must have its own i3d and xml. Usually the train system is included in the map folder. The trains are inserted at game start by the defaultItems. See game default maps for reference.

If you want to add a train to a default map, make at first a mod copy of the map: Giants editor -> new mod from game.
With this mod version you can fiddle around.

An external train system (separate mod) will probably not work. The path description $moddir$ is not always evaluated properly (in opposite to $data)

Kervin Horst (Unknown) 27.01.2021 23:51
Im getting this error can anyone help Warning (mapdir$/trains/trains/train7/locomotive04.xml): Could not create trainsystem vehicle!

Bilbo Beutlin (BBeutlin) 28.01.2021 00:36
Forget it! For some reason you cannot use train vehicles from your map folder.
The FS path evaluation with placeholders is nearly completely buggy and inconsistent.

All you can use is a custom "trainSystem.xml" with train vehicles from default game folders.

Gtx | Andy (GtX_Andy) 28.01.2021 06:15
(◔_◔) There is nothing wrong with the way 'Utils.getFilename' works nor is it buggy, you just need to use the correct formating.

The trains are a placeable spline system that load vehicles using the 'SplineVehicle' specialisation. So with this in mind there is no requirement to use the '$mapdir$' prefix in the xml just as you would not for any other vehicle. The only time you would us the '$' prefix (i.e $data/) is if you wish to load a base game i3d.

Loading vehicle i3d's from an XML differes from loading items (xml files) from the savegame or defualt items XML where instead it uses the 'NetworkUtil.convertFromNetworkFilename' function allowing the use of '$moddir$' or '$mapdir$' or $'pdlcdir' and this is to reduce the path length in the XML, byte size over a network and custom mod folder locations.

So @Kervin to fix your issue adjust the filepath to match the location of the i3d. (trains/trains/train7/locomotive04.xml).
Make sure to also add the (trains/trains/train7/locomotive04.xml) to the storeItems section of the modDesc :-)

Have fun ;-)

Bilbo Beutlin (BBeutlin) 28.01.2021 06:42
I didn't say 'Utils.getFilename' is wrong. It is the inconsistent usage what makes trouble.
Ever tried "$data/PATH" in defaultItems? Very funny that it works with "data/PATH". Is this consistent?
Ever tried "$mapdir$" in certain files like pedestrianSystem, baleTypes, treeTypes, .. and many more linked directly in map.xml?

And NO .. for some reason only Giants knows (perhaps), it doesn't work anymore if you have a custom trainSystem.xml with train vehicles in the map folder. Neither $mapdir$ nor relative paths work.

Have fun.

Kervin Horst (Unknown) 28.01.2021 21:28
well i got it to work using custom trains and train cars so yes it does work when the train and train cars are the map folder


Kervin Horst (Unknown) 28.01.2021 21:29




Bilbo Beutlin (BBeutlin) 28.01.2021 21:51
You have the train i3d's also in map? That's probably the reason.

But with the xml's only and usual reference <filename>$data/vehicles/train/.. I got some serious crashes just recently on the map "Ravensberg".
I'm quite sure, this worked in earlier FS19 revisions.


Note: Log in to post. Create a new account here.