[RELEASE] FiveM Freight train (AI) and enterable trams (as passenger) (Suited for Roleplay to)

The new (updated) version at my github, now logs to console which train(s) are loaded and even if it needs to wait to load the model. However you should have been able to see the peds (traindrivers) somewhere on or near the track (idling), since that happened to us everytime we forced the error situation to happen.

If they don’t spawn then it means it didn’t run the script at all though.

Looks fine to me

2 Likes

Yeah for most part it also works great for us to (except for the part where it takes ages to wait for the Metro (but okay there are only one or two (depending on your setting) on the rail haha)).

But we did indeed encounter the same issue now when doing a longer session where we intentionally
did RP sessions as far away from the railtracks to see if it would cause a ‘de-spawn’ if people didn’t came
near the rail roads.

HOWEVER: The freight train seems to have the least problems and kept going quite long without issues. It did started ‘trippin’ when i used the /XNLforcetrains command to respawn them all
(making the carts just ‘de-spawn’ while we where on it DAFUQ? haha

Hmm also Wondering now if different gamemodes (ESX, vRP, VenmousFreemode etc) could cause/have a different effect (for example when doing vehicle/mission cleanups.
Same goes for traffic density settings (would they affect it)??
Will definitly look into those asap tomorrow (first working on the Character Creation screen now (fully functional like GTA:O itself :D)

Forgot to reply to this, yes it’s possible, i have already had it (randomly) that it had a massive length haha,
will see when the main issue has been solved IF i can make it ‘override’ in the settings part of the
script so users can define their min and max length for the Freight (no promises yet though).

That would be amazing !

I am going to start working on a YMAP for the ticket boxes so that they can be added and used above ground or at stations that do not have working ones.

1 Like

Thanks would be great, since it can take some time due to the fact i still have lots of stuff to do to build up everything here from scratch (by own choice :wink: ).

But PLEASE do not put to much effort in it, since i have already ‘wasted’ quite some hours
on it if it turns out that it isn’t syncable yet in this stage of FiveM.
Maybe even the FiveM team will comeup with a new native or ‘ped syncing’ mechanism
overtime which would improve it, so it’s never a full waste of time haha.

So far it works great (as long as the trains don’t get abducted by the UFO’s :P)
Hope to get it fully functional :slight_smile:

Now if I could just get the trains to move once they spawn.

Stupid question

have you?

Clear server cache ?
Clear your game cache ? ( cache folder delete everything but Game & Browser )

1 Like

just the server cache

Hmm that is a problem none of us had when we tested it and even produced problems on purpose, the trains will even move without a PED in it (since it’s a ‘scripted mission train’ from the original game it self). However this would mean that either:

  • The (mission train) script isn’t loading
  • The Mission is ‘canceled/aborted’ by another script
  • or that the XNL-Train… script is aborted due to a (local?) error.

Do the peds (despite that it doesn’t matter though if they are on the train) spawn?
Since if they do, the script is loaded (the train is even created with the native
createmissiontrain and THEN the ped is put in (just for looks though).
So if the ped is in the train it means that my script atleast worked till after creating
the train.

Do you have any errors in your (console) log? (F8?) for the XNL-Trains script?

If you need it … if not then maybe it might help some one later. ( how to clear game cache )

132
++++++
123
++++++
123123
++++++
1231312

2 Likes

Neither should matter though (unless in some weird instance the script got ‘corrupted’
or loaded incorrectly). Since this script functions nearly 95% (well even more) on client side, and then even ‘current session only’. Nothing (no objects, streamed stuff etc) is
being downloaded or cached (except the script itself).

I will check tomorrow for an error and the ped is in the train just sitting there. I kicked the train and he got out to fight.

I will also look through my scripts in case something is messing with it.

Hey venom great script mate!
love your attitude towards developing too, very nice to see a kind hearted skilled developer in the community.,
Kepe up the good work <3

2 Likes

:rofl::rofl::rofl: hahah i just finished my post, and suddenly this pops up with lots of
bold delete 's haha, i though : WHAT?? haha

Good info for people whom need it though :slight_smile:
Might help with issues, especially when having issues on servers which stream lots of
content or objects :slight_smile: +1

1 Like

Well thank you very much man, really appreciate it. Been a big part of the SA-MP community in my spare time for long, and guess (seeing it here so far) i haven’t made
a bad choice to move on to here :slight_smile: Only hoping (if my spare time allows me to haha) to
also post and contribute more code and pieces on here than i did in the past (FiveM
just makes it that little bit easier to make it OOP than SA-MP/Pawno did and thus easier to share :D)

2 Likes

THAT is a sign that something is going wrong or aborting my script! :slight_smile:
Since the ped should be set to ignore assault and even set to invincible :slight_smile:

Hmm just a ‘random thought’; Do you use custom (aka modded) trains?

First off, I love the concept of this script. I have been wanting a train script like this aven being able to ride on the subway but the added tickets and stuff is a big surprise. No modded trains at all. Maybe it is my cable car script. Not sure.

I am also using ESX if that helps

1 Like

OKAY and thatone does function 100% properly??
Since i’m VERY interested in that one :stuck_out_tongue: for studying and use/adapting for my own server haha

I was planning on writing one myself next week, but seems like i don’t have to haha.

Is your Cable car script synced with other players?

Maybe it’s usefull to investigate for a posible fix, although the cablecart is just a
static object if i’m correct (and not a vehicle with a handle and such), maybe it does contain a solution to solve the train issue (or in your case maybe even causing the train issue).

Now that i think of it: It could well be that the cable car is a ‘registred missiontrain’
(did not looked into that). I myself are not familair with ESX however sorry, have seen
read and inspected it allot but i’m building my own custom framework (one of the things i like haha)
:slight_smile: