[FREE][STANDALONE][TEST] Public Transport AI

It should be fixed with the new version, go check it out

1 Like

Hi!
First of all Iā€™d like to thank you for taking time creating this script.
I have played around with it for about an hour and it works wonders.

Iā€™m trying out drivestyle: 897

I also made some research and found this dump which contains the coordinates of most if not all bus stops on the map. Iā€™m not sure if they are listed in any specific order but none the less it might be useful to figure out the most suitable stops:

I will keep testing things out and try to find a document containing the native GTA V routes (First place to lookā€¦ OpenIV)

Thanks for making this script which makes it easier for new players to move around without a car

1 Like

Incredible, next gen of roleplay!

1 Like

Thanks you for your workā€¦

1 Like

Hi, thank you for testing it!

Imagine a scenario where a player in a vehicle stops in front of the bus for a long period of time (maybe intentionally or maybe not). What will happend is:

  • The bus will wait until the road is clear, so if someone is on the bus he will have to wait.
  • If there are more then one bus passing through that point, all of them will get stucked. Even worst if you have 2 or 3 buses for the same route: if one get stucked the others will crash into it and ruin all the route timings.

Thatā€™s why I choose that aggressive drive style

Thatā€™s super cool, I was looking for something like that when I started developing this resource, but didnā€™t found nothing.
Actually I gived up because I noticed that a lot of bus stops are in useless position for a player, so I ended up creating my own routes and stops.

Hey,
one question
Why the bus only drive 5 Stops?
I put in config 2 Routes and everytime he turns back to first station and repeat his steps

here you have my stations

busStops = {

        { pos = vector3(474.52, -589.28, 29.32), stop = true},

        { pos = vector3(307.44, -766.68, 29.24), stop = true},

        { pos = vector3(114.08, -784.56, 31.32), stop = true},

        { pos = vector3(-222.52, -958.04, 29.28), stop = true},

        { pos = vector3(-49.04, -1146.96, 26.12), stop = true}, <-- here he turn back to first and repeat all the time

        { pos = vector3(202.56, -766.84, 32.6), stop = true},

        { pos = vector3(920.12, -198.36, 72.84), stop = true},

        { pos = vector3(901.7848, 58.12351, 78.06438), stop = true},

        { pos = vector3(898.04, 61.08, 78.96), stop = true},

        { pos = vector3(-694.2, -8.24, 38.2), stop = true},

        { pos = vector3(-926.84, -129.28, 37.72), stop = true},

        { pos = vector3(-678.32, -375.2, 34.32), stop = true},

        { pos = vector3(-504.44, -666.12, 33.08), stop = true},

        { pos = vector3(-243.32, -714.6, 33.44), stop = true},

        { pos = vector3(-247.8, -881.96, 30.6), stop = true},

        { pos = vector3(356.84, -1060.72, 29.36), stop = true},

        { pos = vector3(464.68, -634.52, 28.48), stop = true},

    }

About Driving Style i put this one insinde and have no problems all the time

264235

KI wait about other vehicles and Peds and run if empty way

I cleaned up the list and gave all stops descriptions. Might be useful to someone

Busstops.txt (6.5 KB)

3 Likes

Iā€™m trying to use this route, but when I enter the server the game crashes with error ERR_MEM_EMBEDDEDALLOC_FREE_2.
Itā€™s not the first time it happends and I know itā€™s an error caused by my script.

What I would like to understand is if it happens to you too.

To solved this in the past I had to delete a bus stop in the config file that was causing the crash.

EDIT: looks like if I have more then 5 bus stops per route the game will crash

1 Like

even with the new version when the server is empty and we reconnect to it the bus remains disabled, can the cleanup function be disabled? to keep the bus running continuously ?
even if there are no players on the server? so that if you reconnect it, the bus is still active

My Server dont Crash
Only the Bus drives to the Stop and make a turn (dont stop on Station) and drive to the first back

The fact is that all the logic behind a bus dirver must be executed by a client since the server canā€™t run that code. So if no one is connected, no one can run this code. A solution is to ā€˜resetā€™ the script by cleaning up otherwise all the bus driver will stop driving the bus.
Maybe in the future I will find a new solution to ā€˜restoreā€™ the service when a client connect to an empty server.

1 Like

Ok. Thank you very much anyway for your script and your working hours to broadcast for free!

1 Like

I found the problem: OpenSequenceTask native can accept a max of 16 tasks. Since every bus stop required 3 tasks (drive to point, park, wait), with 5 bus stop will take 15 tasks + a ā€˜drive to pointā€™ task. After that in my case the game crashes, in your case the bus will restart the route.
Iā€™ve found a solution and Iā€™m fixing few problems, then I will upload it to git hib

1 Like

this wont work on server restart and its is a really good script .
the issue im having is when you stand a stop nothing happens unless i restart the script

Iā€™ve just updated the repository on git hub with a fix for this problem (i hope)

1 Like

still same i have to restart from console to get it to run bro

Do you have the spawnmanager resource with playerSpawned event?

im not sure mate

yes i have found it