[Release] Trains.xml File Streamed

Finally, a released Trains.xml file, here it is all streamed up and ready to go, you can create custom train configs, here in a couple of days I will put out a update to this where there will be a BNSF pack. If you have any questions I can answer them here. Have fun!
Download is under pictures.

Notes -

Trains above 60 total vehicles (Locomotives+Cars) may start to unsync with other players.
Polygon counts can also really start to add up when you have detailed train cars x40+.

Works best with TrainSportation
First Custom Config Train ID is 25


trainconfigs.zip (1.0 KB)

19 Likes

I should kiss you in the mouth for this!!! thanks so much

5 Likes

I can see a lot of people welcoming the release of this, good job!

1 Like

Amazing release, this will help a lot of servers to have trains in the server.

2 Likes

Do you ever release a script that would make synchronized trains so that everyone can see them the same way on onesync?

The script I use in my server is TrainSportation and so far its worked with 64/64 on onesync, the only issue and I have forgot to list it is trains above 60 total cars may start to unsync.

I would suggest you use fxmanifest.lua as __resource.lua is deprecated.

Additionally this resource does nothing, the file is streamed but in order to use the configs inside the streamed file you need to replace the level meta with the trainconfig file path pointing to the streamed file.

First part I will when I mess with it again, secondly, not really, it streams the trains.xml which is a train configurations file, once you finish making a configuration you can put ID 25+ into the TrainSportation script and it will plop that train down for you. I’m not sure what you mean by it does nothing?

1 Like

Is it possible to spawn metro trains on coords and their able to drive the tracks and i can setup the trainstations to hold?

This will be nice for RP Servers. Everybody can use AI Trains which are fully synced with easy setup cause i want to use this for my liberty city server which will be really nice and get some atmospheric GTA 4 vibes.

let me know please :wink:

You can drive trains using the trainsportation script I have linked on the post.

Im not 100% sure about AI, it seems to be a little buggy when it loads in and out of players

*Read it a bit wrong, the metro trains with AI just keep going, they work the same with driving though

Hey question, does the script allow you to spawn more than 1 train type? and does it allow you to spawn both a freight and metro train?

:wave: Good evening,

I have custom train files (French TGV)
I have :

  • stream folder : tgv01.yft, .ytd tgv02… for each part of the train.
  • data folder : carcols, carvariations… and trains.xml + traintracks.xml

For the manifest, I put :

files({

    'data/carcols.meta',
    'data/carvariations.meta',
    'data/caraddoncontentunlocks.meta',
    'data/handling.meta',
    'data/vehicles.meta',

    'data/trains.xml',
    'data/traintracks.xml'

})

data_file('CONTENT_UNLOCKING_META_FILE')('data/caraddoncontentunlocks.meta')
data_file('HANDLING_FILE')('data/handling.meta')
data_file('VEHICLE_METADATA_FILE')('data/vehicles.meta')
data_file('CARCOLS_FILE')('data/carcols.meta')
data_file('VEHICLE_VARIATION_FILE')('data/carvariations.meta')
data_file('TRAINCONFIGS_FILE')('data/trains.xml')
data_file('TRAINTRACK_FILE')('data/traintracks.xml')

:point_right: How to spawn the whole TGV correctly?

This is how my resource file (manifest for you) looks like for my train models. (There is a } between data/carcols.meta’, and data_file. For some reason its not there on the picture)

This is all you need to do for the trains.xml file, where it says “MODEL NAME” just put the name of your train models, for example “tgv1”.

Next step is to go over to the trainsportation script I have linked at the top. At the bottom of the Client.lua you will find this. Insert ALL of the tgv model name into this area. For example, RequestModelSync(“tgvfront”)
RequestModelSync(“tgvmiddle”)
RequestModelSync(“tgvback”)
image

The last step is to go to config.lua of the trainsportation script. All you have to do is change the “trainid” to 25 (or 26 if you have the LS Tuners update). And then find the spawn ingame and it should work.

If it does not then it would be something related to how you are streaming your train models, if you would like to send them to me I can set it up for you if it doesnt work.

:wave: Hi,

Thank you for your answer and your explanations.
I make a different script from Trainsportation

Here is what I did:

-- for load model
function loadModel(name)
    local limitWaitForLoad = 0
    local nameHash = GetHashKey(name)
    RequestModel(nameHash)
    while (not HasModelLoaded(nameHash)) do
        RequestModel(nameHash)
        Citizen.Wait(50)
    end
end

-- for spawn train
-- Location are correct, direction too, the IDModel i test with 1 to 23
CreateMissionTrain(Config.IDModel, Config.LocationSpawn[1], Config.LocationSpawn[2], Config.LocationSpawn[3], Config.DirectionTrain)

and for the name (each of them are called) :
{“freight”, “freightcar”, “freightcont2”, “freightcont1”, “freightgrain”, “tankercar”, “freighttrailer”, “tgv01”, “tgv02”, “tgv03”, “tgv04”, “tgv05”, “tgv06”, “tgv07”, “tgv08”, “tgv09”}

:point_right: I manage to load in memory all the tgv01, 02…
But, every time the train appears in a different size, it doesn’t have any part of the TGV, not even a car, still the basic GTA train.

and here is the trains.xml an traintracks.xml :
trains.xml (46.4 KB)
traintracks.xml (2.7 KB)

what script works to control the trains as the trainsportation seems to be outdated.

What are the first 24 train combos that are native?

how do i install it ?

1 Like

It Outdate But Still Works Great