Simple Traffic Creator 1.8
1,299
61
1,299
61
With this script you can finally create vehicle traffic in a simple and customizable way in any location and even in mod maps. This script simulates only vehicle, ped and boats traffic, has customization for each point created in addition to performance and behavior settings.
version 1.8:
Added features and improvements to traffic logic:
_aiming to simplify editing, now the wp saved in the ini have a description, saved in the following way:
[area:'Name you want'] id:1,destA:2,destB:2,destC:2,posX:-7374,posY:3982,posZ:8,dir:173,veh:'adder',ped:'a_m_y_skater_01',speed:15,weapon:'WEAPON_COMBATMG',spawnInterval:5,waitTime:0,pedTask:'none',pedHP:200,vehTuning:true,vehColor1:'defaut',vehColor2:'250.0.0'
_added feature to migrate your existing wp ini file to the new format mentioned above, use Ctrl+8 keys to migrate all your saved wp.
_added limit of vehicles and pedestrians per hour in the config file. This way you can set it to have fewer vehicles at dawn, for example.
Format type = Hour: quantity limit.
If you leave it like this:
maxVehicles=60
maxVehiclesByHour=0:20,1:15
it means that at midnight we will have a maximum limit of 20 vehicles, and at 1 am we will have a maximum of 15 vehicles running, and the other times not mentioned will have a maximum of 60 vehicles running. The configuration comes with suggested limits for all hours, delete or change those you want.
_improved vehicle movement logic, now they follow the route lines more faithfully, reducing stacking and jamming.
_when displaying wp markers with Ctrl+M, the route lines are more visible and each destination has its own color, destination A: red, destination B: green, Destination C: yellow. This helps a lot when editing and viewing the routes you are creating.
_the wp cylinders (display Ctrl+M) now have the size of the corresponding checkpoint radius (configured in the config file in 'minWaypointDistance=3'). Vehicles or pedestrians only advance to the next wp when they reach the radius of that wp.
_now the text above the wp cylinders (show Ctrl+M) have the name 'area' followed by the wp id set in each wp. Look at the print where I put the name of the city 'Gostown' on the wp of that area, organizing and facilitating editing.
_added in the config file option to change all messages and notifications of the script actions, the default notifications are in English
_made other small adjustments and optimizations
version 1.7:
_fixed the randomCustomization field that was saved as empty when creating new wp in the ini when the value in the config was false, which caused all spawn wp in the game not to load
_fixed a sequential bug when creating wp from the last version, it will always follow the highest wp id registered, avoiding duplication of wp id
_when creating a wp from a parked vehicle (Ctrl+G) the wp will have the destination A B C equal to the source wp id
_Removed parked vehicles spawn limit. Now they do not count towards the total limit of spawns of moving vehicles.
_adjusted the config file that contained resource options that were not yet functional.
_current structure of the ini file of each generated wp:
'wp id',
'wp dest id A',
'wp dest id B',
'wp dest id C'
'position X',
'position Y',
'position Z',
'direction',
'vehicle name or group',
'ped name or group',
'vehicle or ped speed',
'weapon name or group',
'interval (seconds) between each spawn',
'wait time (milliseconds) before advancing to the next wp',
'ped task name or group',
'pedHP amount of ped health',
'random vehicle tuning (enabled:true or disabled:false)',
'vehicle primary color',
''vehicle secundary color'
version 1.6:
Version focused on restructuring, optimization and performance of the script, for compatibility with the implementation of future features. It is now as lightweight as the first version
_The name of the script and its files have been standardized to 'STC_filename'. You must delete the old 'TrafficWaypointSpawner' files, otherwise you will have many duplication problems. If you have ini files of created wp routes, copy their ini files to the new 'STC_wpAreaMap' folder
_The vehicle, ped, tasks and weapons group files have a new format and are in ini type, so it is easier to create and identify the group name. (credits to @JoyLucien for the idea)
_The script still reads the ini files of the created wp routes of previous versions (as long as they are inside the new 'STC_wpAreaMap' folder, parcial compatibility very old versions)
_Added the possibility of selecting the primary and secondary color of the vehicle that will be spawned in each created wp. The color values can be changed for each wp or you can change the default for the next generated wp in the config file.
Default values that you can set for primary and secondary colors, with one field for each 'color', you can mix them if you want:
'defaut' = keeps the vehicles spawning randomly in the default colors of each model.
'rgb' = makes vehicles appear in completely random and unpredictable colors via rgb.
'0.0.0' = rgb value, in this case it spawns in black, change these values from 0 to 250 to the desired color, the vehicle spawned in this wp will only be in this color.
_removed redundancies and simplified task checking in general (there are a lot of things I won't even mention here because the list is long), now even with the ontick at '0' the FPS drop caused by the script is minimal, the FPS drop is now due to the excess of entities on the screen.
_removed the resource of limiting spawns per wp individually, because it was heavy and was causing a lot of stuttering.
version 1.5:
Optimized script, reduced resource consumption by 90%:
_added general rule configuration for ontick frame skips, default value: 'ontickFrameSkip=10'
_added configuration for marker display frame skips when active (Ctrl+M) default value: 'showmarkersFrameSkip=0' (this value minimizes the problem of WP ID texts flashing on the screen)
After creating many spawn WayPoints in an area, the script was consuming so much resource that the FPS would drop by half while the player was within that wp radius, with this treatment in the script's general management control, the script now consumes less than 10% of what it was consulting. With almost zero impact on the script's functionalities.
version 1.4:
New features for each wp:
_added the possibility for wp to spawn the vehicle with random modifications parts , windows, wheels, tires, stickers, engine, horn, bodywork, suspension, etc. According to the library available for each vehicle, supports mods, works incredibly well, but use it sparingly as it consumes a lot of memory.
_added the possibility of defining the amount of life of the ped to be spawned (default pedHP 200)
_added taks animation for the ped, for now it only performs the animation when stopped, use in wp together with the 'waiting time' column with at least 5000 (5 seconds) so that it has time to perform the animation for the determined time (scenarioTask option)
_added TrafficWaypointSpawner.pedTasks file to create task groups (works the same as the existing group function for vehicle/ped/weapons)
_added control of ped and vehicle spawn limit per wp (default 0 for disabled, consumes performance when enabled) use when you want to set a character/boss spawn so it doesn't multiply
_added Ctrl+R command to create route wp (wp without vehicle and ped)
_added Ctrl+G command to create vehicle wp parked (wp with vehicle without ped)
New general features:
_reorganized config file and added configurations of new features and others that were missing
_added general limit for the number of spawned peds, so a new ped is only generated when another is despawned from memory
_added line that displays the path between wp when displaying markers with ctrl+M (credits to @mitto_backup for the idea)
_added text on the screen displaying the wp ID when displaying markers with ctrl+M
Other adjustments:
_support for reading ini files (wp) from previous versions
_reworked logic for moving between wp, inserting several treatments so that vehicles and peds do not lose their route
_reworked script to improve memory management and deletion of despawned vehicle indexes
version 1.3:
_ peds now follow defined routes (credits to Bradshaw, JoyLucien and Niziul for the tips)
_ fixed problem with wp (vehicles and ped) not loading the weapon and group (now if model is invalid it loads the default weapon: unarmed)
_ fixed bug with wp PED not loading groups of ped models
_ vehicles now switch correctly between up to 3 different destination IDs
_ new created wp peds are saved with speed 1. (1=walk, 2=run). Change in the ini for each wp, or in the config for the next wp in the new line: pedSpeed=1
_ order of the current structure of the wp saved in the .ini file:
wp id, wp destination id A, wp destination id B, wp destination id C, X coordinate, Y coordinate, Z coordinate, R orientation, vehicle name or group, ped name or group, vehicle or ped speed, ped weapon name or group, interval between each spawn (value in seconds, max 9), time that the ped or vehicle will remain stopped in this wp before moving on to the next destination wp (value in milliseconds).
_ fixed many bugs, more features and other improvements are on the way :)
version 1.2: (deleted - many bugs)
_added function for up to 3 destination wp ids, the script still reads the old .ini. New wp's are created with 3 repeated destination ids, and vehicles will randomly go to route ids. Change the destination ids as needed. (credits to @TrueBest for the idea)
_the script still reads the old .ini, I released this update due to the impact of this function on the creation of wp's
version 1.1:
_ optimized script, reviewed route operation and added many other features.
_added in .config the default vehiclemodel for the next wpboost created
_ added Ctrl+H command to create ped wp (a new wp is created in .ini where the vehiclemodel column is blank). For now, the spawned Ped still does not move on to the next wp.
_ reviewed the logic for creating wp id, now the script always continues from the last generated id, no longer counting from the number of lines or the generated file, so that there are no repeated wp id numbers and causing route bugs.
_ added vehicle/ped/weapon groups function, just change the model name to that of a created group and the models included in that group will be randomly spawned, the script dynamically identifies whether the name is of a model or a valid group. (credits to @JoyLucien for the idea)
_added function to read multiple .ini route files, now the wp are saved in the file with the name defined by the player, if the file does not exist the script will create it, the ini files are now inside the TrafficWaypointAreaMap folder in scripts (credits to @JoyLucien for the idea)
_fixed bug of the vehicle entering autopilot mode while the player is driving
_added the following group files to the scripts folder
TrafficWaypointSpawner.pedgroups (pedestrian groups)
TrafficWaypointSpawner.vehgroups (vehicle groups)
TrafficWaypointSpawner.wpngroups (weapon groups)
-you can create the group with the name you want followed by the modelid of each group, respecting the rule of one group per line, there is no limit of vehicles per group, however too many models loaded can cause the game to close. The name can be changed in the .config file, or in each wp generated in the .ini file
NOTE: copy the new .config file that has the new settings and the most optimized WP creation distances that I found
NOTE2: if you have already created WPs in the previous version, just place your file inside the TrafficWaypointAreaMap folder, and continue creating it.
STC - Simple Traffic Creator version 1.0:
I wrote this script to meet the need to bring mod maps to life without being blocked by the limits of the x z y coordinates and the predefined number of nodes in the game's native trafficpath areas, in addition to the work of not having to edit the popcycle, popgroup, popzone and zonebind files.
How it works:
_ The player adds waypoints called wp (waypoint) with the Ctrl+N keys (standard speed)
_ The player can also add wp waypoints with the Ctrl+B keys (boost speed) indicated for highways and circuits
_ During the game, use the Ctrl+C keys to reload the wp from the TrafficWaypointSpawner.ini file and the settings from the TrafficWaypointSpawner.config file, if you edit them outside the game.
_ Delete the last waypoint created with the Ctrl+X keys, be careful if there is an active vehicle using this last wp it may crash the script, requiring you to restart the game.
_ Possibility to show or hide the markings of the wp created in the game with the Ctrl+M keys, used to help in editing the wp.
_ Set the total limit of vehicles spawned at the same time in the game, so that new vehicles only spawn when another one is despawned, adjust according to your PC's performance.
_ Set the minimum and maximum distance from the player that the wp will spawn new vehicles (spawn radius: leave the 'spawnMinDistance' at least '180' and the 'spawnMaxDistance' at least '190')
_ Distance that the vehicles will despawn, adjust smaller values if you have performance problems, but a value lower than 200 causes visible vehicle popups on the screen
_ Vehicles are spawned in the game through each wp marker as long as they are within a minimum and maximum spawn distance from the player's current position.
_ Each created wp receives a registration id and another destination id sequentially
_ The vehicle generated in 'wp id 1' goes autonomously towards the 'destination wp id 2', and when it reaches wp id 2 it goes to the next destination id set in that wp, which by default will be id 3, and so on.
_ Each added wp has individual and customizable rules and settings, which are stored in the TrafficWaypointSpawner.ini file in the following sequence:
- wp id, and destination wp id, can be changed to create looping routes and closed circuits, for example we can change the destination wp in wp 11 from 12 to destination wp 1, this way whenever the vehicle reaches wp id 11 it will head to destination wp 1 and redo the entire route again.
- position on the map in integer values x, y, z, and rotation so that the vehicle is spawned in a certain direction.
- define the model of the vehicle to be generated in each wp (supports mods), leave blank if you do not want a vehicle to be spawned in that wp. Use to simulate sections of a circuit or reduce the volume of cars (default vehicle: adder)
- define the model of the ped to be generated as the driver of the vehicle in each wp, used to insert police peds in vehicles so that there is a route and police chase (default ped: a_m_y_skater_01), leave blank to generate parked vehicles without a driver.
- set the vehicle speed, with this the vehicle will leave with the set speed until the next wp, speed is in game units, default 15 (~33km), boost 30 (~100km)
- set a weapon to the ped to be spawned in the vehicle (default weapon: WEAPON_PISTOL), leave blank for ped without weapon.
- Interval in seconds between each vehicle spawn (default 5 seconds for the next spawn)
- waiting time for the vehicle to stop and go to the next wp, value measured in milliseconds, (default 0), use this to simulate vehicles in blits, or even at some intersections, optional.
_ When starting the game with the script, it will load the following default settings from the TrafficWaypointSpawner.config file. These settings also have an impact on new wp to be created by the player:
- despawnDistance=200 (initial vehicle despawn distance)
- spawnMinDistance=180 (minimum vehicle spawn distance)
- spawnMaxDistance=190 (maximum vehicle spawn distance)
- maxVehicles=100 (limit of vehicles spawned at the same time, counting vehicles spawned by other means)
- vehicleSpeed=15 (default vehicle speed, approximately 34Km/h)
- boostSpeed=30 (boost vehicle speed, approximately 100Km/h)
- autoSpawnEnabled=true (enables or disables vehicle spawns)
- vehicleModel=adder (change the vehicle model to be generated in the new created wp here)
- pedModel=a_m_y_skater_01 (change the ped pilot model of the vehicle to be generated in the new created wp here)
- logsEnabled=true (enable or disable the mod's behavior log)
- notificationsEnabled=true (enable or disable the messages below during the game)
- messageWPAdded=traffic Waypoints added! (change the message here when saving a normal wp)
- messageWPDeleted=traffic Waypoints deleted! (change the message here when saving a boost wp)
- messageConfigReloaded=Configurations and traffic Waypoints reloaded! (change the message here when reloading the saved settings and wp)
- hotkeyCreate=N (change the button here to activate the default wp creation function)
- hotkeyReload=C (change the button here to reload the saved settings and wp)
- hotkeyDelete=X (change the button here to delete the last wp created)
- hotkeyShowMarkers=M (change the button here to show or hide the markings of wp created in the game)
- hotkeyBoost=B (change the button here to activate the wp boost creation function)
- showMarkers=true (change here if the game's default will be to show or hide the markings of wp created when starting)
- vehicleCheckRadius=10 (Tolerance radius for wp route validation, used so that the vehicle can consider the arrival at this wp as completed and only then continue towards the next wp.
- minWaypointDistance=10 (A wp cannot spawn a vehicle while another vehicle is too close to it (default radius of 10 units, avoids stacking vehicles)
Important notes:
_ The vehicles generated by this script have a 'wakeup' behavior, so they avoid obstacles and other vehicles and do not float on the ground and only move if there is a character driving.
_ The recommended speed for vehicles in cities and on quiet roads is 10 speeds. This way, vehicles tend to respect lines and avoid accidents.
_ At very high speeds above 25 speeds, vehicles tend not to use the brakes much on curves.
Known bugs:
- at specific points in the game, vehicles may simply ignore the next wp and follow a random direction, I was unable to find the cause, behavior or pattern to solve this problem.
---------------------------------- PUT THE FILES IN SCRIPT FOLDER
version 1.8:
Added features and improvements to traffic logic:
_aiming to simplify editing, now the wp saved in the ini have a description, saved in the following way:
[area:'Name you want'] id:1,destA:2,destB:2,destC:2,posX:-7374,posY:3982,posZ:8,dir:173,veh:'adder',ped:'a_m_y_skater_01',speed:15,weapon:'WEAPON_COMBATMG',spawnInterval:5,waitTime:0,pedTask:'none',pedHP:200,vehTuning:true,vehColor1:'defaut',vehColor2:'250.0.0'
_added feature to migrate your existing wp ini file to the new format mentioned above, use Ctrl+8 keys to migrate all your saved wp.
_added limit of vehicles and pedestrians per hour in the config file. This way you can set it to have fewer vehicles at dawn, for example.
Format type = Hour: quantity limit.
If you leave it like this:
maxVehicles=60
maxVehiclesByHour=0:20,1:15
it means that at midnight we will have a maximum limit of 20 vehicles, and at 1 am we will have a maximum of 15 vehicles running, and the other times not mentioned will have a maximum of 60 vehicles running. The configuration comes with suggested limits for all hours, delete or change those you want.
_improved vehicle movement logic, now they follow the route lines more faithfully, reducing stacking and jamming.
_when displaying wp markers with Ctrl+M, the route lines are more visible and each destination has its own color, destination A: red, destination B: green, Destination C: yellow. This helps a lot when editing and viewing the routes you are creating.
_the wp cylinders (display Ctrl+M) now have the size of the corresponding checkpoint radius (configured in the config file in 'minWaypointDistance=3'). Vehicles or pedestrians only advance to the next wp when they reach the radius of that wp.
_now the text above the wp cylinders (show Ctrl+M) have the name 'area' followed by the wp id set in each wp. Look at the print where I put the name of the city 'Gostown' on the wp of that area, organizing and facilitating editing.
_added in the config file option to change all messages and notifications of the script actions, the default notifications are in English
_made other small adjustments and optimizations
version 1.7:
_fixed the randomCustomization field that was saved as empty when creating new wp in the ini when the value in the config was false, which caused all spawn wp in the game not to load
_fixed a sequential bug when creating wp from the last version, it will always follow the highest wp id registered, avoiding duplication of wp id
_when creating a wp from a parked vehicle (Ctrl+G) the wp will have the destination A B C equal to the source wp id
_Removed parked vehicles spawn limit. Now they do not count towards the total limit of spawns of moving vehicles.
_adjusted the config file that contained resource options that were not yet functional.
_current structure of the ini file of each generated wp:
'wp id',
'wp dest id A',
'wp dest id B',
'wp dest id C'
'position X',
'position Y',
'position Z',
'direction',
'vehicle name or group',
'ped name or group',
'vehicle or ped speed',
'weapon name or group',
'interval (seconds) between each spawn',
'wait time (milliseconds) before advancing to the next wp',
'ped task name or group',
'pedHP amount of ped health',
'random vehicle tuning (enabled:true or disabled:false)',
'vehicle primary color',
''vehicle secundary color'
version 1.6:
Version focused on restructuring, optimization and performance of the script, for compatibility with the implementation of future features. It is now as lightweight as the first version
_The name of the script and its files have been standardized to 'STC_filename'. You must delete the old 'TrafficWaypointSpawner' files, otherwise you will have many duplication problems. If you have ini files of created wp routes, copy their ini files to the new 'STC_wpAreaMap' folder
_The vehicle, ped, tasks and weapons group files have a new format and are in ini type, so it is easier to create and identify the group name. (credits to @JoyLucien for the idea)
_The script still reads the ini files of the created wp routes of previous versions (as long as they are inside the new 'STC_wpAreaMap' folder, parcial compatibility very old versions)
_Added the possibility of selecting the primary and secondary color of the vehicle that will be spawned in each created wp. The color values can be changed for each wp or you can change the default for the next generated wp in the config file.
Default values that you can set for primary and secondary colors, with one field for each 'color', you can mix them if you want:
'defaut' = keeps the vehicles spawning randomly in the default colors of each model.
'rgb' = makes vehicles appear in completely random and unpredictable colors via rgb.
'0.0.0' = rgb value, in this case it spawns in black, change these values from 0 to 250 to the desired color, the vehicle spawned in this wp will only be in this color.
_removed redundancies and simplified task checking in general (there are a lot of things I won't even mention here because the list is long), now even with the ontick at '0' the FPS drop caused by the script is minimal, the FPS drop is now due to the excess of entities on the screen.
_removed the resource of limiting spawns per wp individually, because it was heavy and was causing a lot of stuttering.
version 1.5:
Optimized script, reduced resource consumption by 90%:
_added general rule configuration for ontick frame skips, default value: 'ontickFrameSkip=10'
_added configuration for marker display frame skips when active (Ctrl+M) default value: 'showmarkersFrameSkip=0' (this value minimizes the problem of WP ID texts flashing on the screen)
After creating many spawn WayPoints in an area, the script was consuming so much resource that the FPS would drop by half while the player was within that wp radius, with this treatment in the script's general management control, the script now consumes less than 10% of what it was consulting. With almost zero impact on the script's functionalities.
version 1.4:
New features for each wp:
_added the possibility for wp to spawn the vehicle with random modifications parts , windows, wheels, tires, stickers, engine, horn, bodywork, suspension, etc. According to the library available for each vehicle, supports mods, works incredibly well, but use it sparingly as it consumes a lot of memory.
_added the possibility of defining the amount of life of the ped to be spawned (default pedHP 200)
_added taks animation for the ped, for now it only performs the animation when stopped, use in wp together with the 'waiting time' column with at least 5000 (5 seconds) so that it has time to perform the animation for the determined time (scenarioTask option)
_added TrafficWaypointSpawner.pedTasks file to create task groups (works the same as the existing group function for vehicle/ped/weapons)
_added control of ped and vehicle spawn limit per wp (default 0 for disabled, consumes performance when enabled) use when you want to set a character/boss spawn so it doesn't multiply
_added Ctrl+R command to create route wp (wp without vehicle and ped)
_added Ctrl+G command to create vehicle wp parked (wp with vehicle without ped)
New general features:
_reorganized config file and added configurations of new features and others that were missing
_added general limit for the number of spawned peds, so a new ped is only generated when another is despawned from memory
_added line that displays the path between wp when displaying markers with ctrl+M (credits to @mitto_backup for the idea)
_added text on the screen displaying the wp ID when displaying markers with ctrl+M
Other adjustments:
_support for reading ini files (wp) from previous versions
_reworked logic for moving between wp, inserting several treatments so that vehicles and peds do not lose their route
_reworked script to improve memory management and deletion of despawned vehicle indexes
version 1.3:
_ peds now follow defined routes (credits to Bradshaw, JoyLucien and Niziul for the tips)
_ fixed problem with wp (vehicles and ped) not loading the weapon and group (now if model is invalid it loads the default weapon: unarmed)
_ fixed bug with wp PED not loading groups of ped models
_ vehicles now switch correctly between up to 3 different destination IDs
_ new created wp peds are saved with speed 1. (1=walk, 2=run). Change in the ini for each wp, or in the config for the next wp in the new line: pedSpeed=1
_ order of the current structure of the wp saved in the .ini file:
wp id, wp destination id A, wp destination id B, wp destination id C, X coordinate, Y coordinate, Z coordinate, R orientation, vehicle name or group, ped name or group, vehicle or ped speed, ped weapon name or group, interval between each spawn (value in seconds, max 9), time that the ped or vehicle will remain stopped in this wp before moving on to the next destination wp (value in milliseconds).
_ fixed many bugs, more features and other improvements are on the way :)
version 1.2: (deleted - many bugs)
_added function for up to 3 destination wp ids, the script still reads the old .ini. New wp's are created with 3 repeated destination ids, and vehicles will randomly go to route ids. Change the destination ids as needed. (credits to @TrueBest for the idea)
_the script still reads the old .ini, I released this update due to the impact of this function on the creation of wp's
version 1.1:
_ optimized script, reviewed route operation and added many other features.
_added in .config the default vehiclemodel for the next wpboost created
_ added Ctrl+H command to create ped wp (a new wp is created in .ini where the vehiclemodel column is blank). For now, the spawned Ped still does not move on to the next wp.
_ reviewed the logic for creating wp id, now the script always continues from the last generated id, no longer counting from the number of lines or the generated file, so that there are no repeated wp id numbers and causing route bugs.
_ added vehicle/ped/weapon groups function, just change the model name to that of a created group and the models included in that group will be randomly spawned, the script dynamically identifies whether the name is of a model or a valid group. (credits to @JoyLucien for the idea)
_added function to read multiple .ini route files, now the wp are saved in the file with the name defined by the player, if the file does not exist the script will create it, the ini files are now inside the TrafficWaypointAreaMap folder in scripts (credits to @JoyLucien for the idea)
_fixed bug of the vehicle entering autopilot mode while the player is driving
_added the following group files to the scripts folder
TrafficWaypointSpawner.pedgroups (pedestrian groups)
TrafficWaypointSpawner.vehgroups (vehicle groups)
TrafficWaypointSpawner.wpngroups (weapon groups)
-you can create the group with the name you want followed by the modelid of each group, respecting the rule of one group per line, there is no limit of vehicles per group, however too many models loaded can cause the game to close. The name can be changed in the .config file, or in each wp generated in the .ini file
NOTE: copy the new .config file that has the new settings and the most optimized WP creation distances that I found
NOTE2: if you have already created WPs in the previous version, just place your file inside the TrafficWaypointAreaMap folder, and continue creating it.
STC - Simple Traffic Creator version 1.0:
I wrote this script to meet the need to bring mod maps to life without being blocked by the limits of the x z y coordinates and the predefined number of nodes in the game's native trafficpath areas, in addition to the work of not having to edit the popcycle, popgroup, popzone and zonebind files.
How it works:
_ The player adds waypoints called wp (waypoint) with the Ctrl+N keys (standard speed)
_ The player can also add wp waypoints with the Ctrl+B keys (boost speed) indicated for highways and circuits
_ During the game, use the Ctrl+C keys to reload the wp from the TrafficWaypointSpawner.ini file and the settings from the TrafficWaypointSpawner.config file, if you edit them outside the game.
_ Delete the last waypoint created with the Ctrl+X keys, be careful if there is an active vehicle using this last wp it may crash the script, requiring you to restart the game.
_ Possibility to show or hide the markings of the wp created in the game with the Ctrl+M keys, used to help in editing the wp.
_ Set the total limit of vehicles spawned at the same time in the game, so that new vehicles only spawn when another one is despawned, adjust according to your PC's performance.
_ Set the minimum and maximum distance from the player that the wp will spawn new vehicles (spawn radius: leave the 'spawnMinDistance' at least '180' and the 'spawnMaxDistance' at least '190')
_ Distance that the vehicles will despawn, adjust smaller values if you have performance problems, but a value lower than 200 causes visible vehicle popups on the screen
_ Vehicles are spawned in the game through each wp marker as long as they are within a minimum and maximum spawn distance from the player's current position.
_ Each created wp receives a registration id and another destination id sequentially
_ The vehicle generated in 'wp id 1' goes autonomously towards the 'destination wp id 2', and when it reaches wp id 2 it goes to the next destination id set in that wp, which by default will be id 3, and so on.
_ Each added wp has individual and customizable rules and settings, which are stored in the TrafficWaypointSpawner.ini file in the following sequence:
- wp id, and destination wp id, can be changed to create looping routes and closed circuits, for example we can change the destination wp in wp 11 from 12 to destination wp 1, this way whenever the vehicle reaches wp id 11 it will head to destination wp 1 and redo the entire route again.
- position on the map in integer values x, y, z, and rotation so that the vehicle is spawned in a certain direction.
- define the model of the vehicle to be generated in each wp (supports mods), leave blank if you do not want a vehicle to be spawned in that wp. Use to simulate sections of a circuit or reduce the volume of cars (default vehicle: adder)
- define the model of the ped to be generated as the driver of the vehicle in each wp, used to insert police peds in vehicles so that there is a route and police chase (default ped: a_m_y_skater_01), leave blank to generate parked vehicles without a driver.
- set the vehicle speed, with this the vehicle will leave with the set speed until the next wp, speed is in game units, default 15 (~33km), boost 30 (~100km)
- set a weapon to the ped to be spawned in the vehicle (default weapon: WEAPON_PISTOL), leave blank for ped without weapon.
- Interval in seconds between each vehicle spawn (default 5 seconds for the next spawn)
- waiting time for the vehicle to stop and go to the next wp, value measured in milliseconds, (default 0), use this to simulate vehicles in blits, or even at some intersections, optional.
_ When starting the game with the script, it will load the following default settings from the TrafficWaypointSpawner.config file. These settings also have an impact on new wp to be created by the player:
- despawnDistance=200 (initial vehicle despawn distance)
- spawnMinDistance=180 (minimum vehicle spawn distance)
- spawnMaxDistance=190 (maximum vehicle spawn distance)
- maxVehicles=100 (limit of vehicles spawned at the same time, counting vehicles spawned by other means)
- vehicleSpeed=15 (default vehicle speed, approximately 34Km/h)
- boostSpeed=30 (boost vehicle speed, approximately 100Km/h)
- autoSpawnEnabled=true (enables or disables vehicle spawns)
- vehicleModel=adder (change the vehicle model to be generated in the new created wp here)
- pedModel=a_m_y_skater_01 (change the ped pilot model of the vehicle to be generated in the new created wp here)
- logsEnabled=true (enable or disable the mod's behavior log)
- notificationsEnabled=true (enable or disable the messages below during the game)
- messageWPAdded=traffic Waypoints added! (change the message here when saving a normal wp)
- messageWPDeleted=traffic Waypoints deleted! (change the message here when saving a boost wp)
- messageConfigReloaded=Configurations and traffic Waypoints reloaded! (change the message here when reloading the saved settings and wp)
- hotkeyCreate=N (change the button here to activate the default wp creation function)
- hotkeyReload=C (change the button here to reload the saved settings and wp)
- hotkeyDelete=X (change the button here to delete the last wp created)
- hotkeyShowMarkers=M (change the button here to show or hide the markings of wp created in the game)
- hotkeyBoost=B (change the button here to activate the wp boost creation function)
- showMarkers=true (change here if the game's default will be to show or hide the markings of wp created when starting)
- vehicleCheckRadius=10 (Tolerance radius for wp route validation, used so that the vehicle can consider the arrival at this wp as completed and only then continue towards the next wp.
- minWaypointDistance=10 (A wp cannot spawn a vehicle while another vehicle is too close to it (default radius of 10 units, avoids stacking vehicles)
Important notes:
_ The vehicles generated by this script have a 'wakeup' behavior, so they avoid obstacles and other vehicles and do not float on the ground and only move if there is a character driving.
_ The recommended speed for vehicles in cities and on quiet roads is 10 speeds. This way, vehicles tend to respect lines and avoid accidents.
_ At very high speeds above 25 speeds, vehicles tend not to use the brakes much on curves.
Known bugs:
- at specific points in the game, vehicles may simply ignore the next wp and follow a random direction, I was unable to find the cause, behavior or pattern to solve this problem.
---------------------------------- PUT THE FILES IN SCRIPT FOLDER
पहले अपलोड: मार्च 13, 2025
आखरी अपडेट: 16 hours ago
Last Downloaded: 19 कुछ मिनट पहले
All Versions
86 टिप्पणियाँ
More mods by schio84dude:
With this script you can finally create vehicle traffic in a simple and customizable way in any location and even in mod maps. This script simulates only vehicle, ped and boats traffic, has customization for each point created in addition to performance and behavior settings.
version 1.8:
Added features and improvements to traffic logic:
_aiming to simplify editing, now the wp saved in the ini have a description, saved in the following way:
[area:'Name you want'] id:1,destA:2,destB:2,destC:2,posX:-7374,posY:3982,posZ:8,dir:173,veh:'adder',ped:'a_m_y_skater_01',speed:15,weapon:'WEAPON_COMBATMG',spawnInterval:5,waitTime:0,pedTask:'none',pedHP:200,vehTuning:true,vehColor1:'defaut',vehColor2:'250.0.0'
_added feature to migrate your existing wp ini file to the new format mentioned above, use Ctrl+8 keys to migrate all your saved wp.
_added limit of vehicles and pedestrians per hour in the config file. This way you can set it to have fewer vehicles at dawn, for example.
Format type = Hour: quantity limit.
If you leave it like this:
maxVehicles=60
maxVehiclesByHour=0:20,1:15
it means that at midnight we will have a maximum limit of 20 vehicles, and at 1 am we will have a maximum of 15 vehicles running, and the other times not mentioned will have a maximum of 60 vehicles running. The configuration comes with suggested limits for all hours, delete or change those you want.
_improved vehicle movement logic, now they follow the route lines more faithfully, reducing stacking and jamming.
_when displaying wp markers with Ctrl+M, the route lines are more visible and each destination has its own color, destination A: red, destination B: green, Destination C: yellow. This helps a lot when editing and viewing the routes you are creating.
_the wp cylinders (display Ctrl+M) now have the size of the corresponding checkpoint radius (configured in the config file in 'minWaypointDistance=3'). Vehicles or pedestrians only advance to the next wp when they reach the radius of that wp.
_now the text above the wp cylinders (show Ctrl+M) have the name 'area' followed by the wp id set in each wp. Look at the print where I put the name of the city 'Gostown' on the wp of that area, organizing and facilitating editing.
_added in the config file option to change all messages and notifications of the script actions, the default notifications are in English
_made other small adjustments and optimizations
version 1.7:
_fixed the randomCustomization field that was saved as empty when creating new wp in the ini when the value in the config was false, which caused all spawn wp in the game not to load
_fixed a sequential bug when creating wp from the last version, it will always follow the highest wp id registered, avoiding duplication of wp id
_when creating a wp from a parked vehicle (Ctrl+G) the wp will have the destination A B C equal to the source wp id
_Removed parked vehicles spawn limit. Now they do not count towards the total limit of spawns of moving vehicles.
_adjusted the config file that contained resource options that were not yet functional.
_current structure of the ini file of each generated wp:
'wp id',
'wp dest id A',
'wp dest id B',
'wp dest id C'
'position X',
'position Y',
'position Z',
'direction',
'vehicle name or group',
'ped name or group',
'vehicle or ped speed',
'weapon name or group',
'interval (seconds) between each spawn',
'wait time (milliseconds) before advancing to the next wp',
'ped task name or group',
'pedHP amount of ped health',
'random vehicle tuning (enabled:true or disabled:false)',
'vehicle primary color',
''vehicle secundary color'
version 1.6:
Version focused on restructuring, optimization and performance of the script, for compatibility with the implementation of future features. It is now as lightweight as the first version
_The name of the script and its files have been standardized to 'STC_filename'. You must delete the old 'TrafficWaypointSpawner' files, otherwise you will have many duplication problems. If you have ini files of created wp routes, copy their ini files to the new 'STC_wpAreaMap' folder
_The vehicle, ped, tasks and weapons group files have a new format and are in ini type, so it is easier to create and identify the group name. (credits to @JoyLucien for the idea)
_The script still reads the ini files of the created wp routes of previous versions (as long as they are inside the new 'STC_wpAreaMap' folder, parcial compatibility very old versions)
_Added the possibility of selecting the primary and secondary color of the vehicle that will be spawned in each created wp. The color values can be changed for each wp or you can change the default for the next generated wp in the config file.
Default values that you can set for primary and secondary colors, with one field for each 'color', you can mix them if you want:
'defaut' = keeps the vehicles spawning randomly in the default colors of each model.
'rgb' = makes vehicles appear in completely random and unpredictable colors via rgb.
'0.0.0' = rgb value, in this case it spawns in black, change these values from 0 to 250 to the desired color, the vehicle spawned in this wp will only be in this color.
_removed redundancies and simplified task checking in general (there are a lot of things I won't even mention here because the list is long), now even with the ontick at '0' the FPS drop caused by the script is minimal, the FPS drop is now due to the excess of entities on the screen.
_removed the resource of limiting spawns per wp individually, because it was heavy and was causing a lot of stuttering.
version 1.5:
Optimized script, reduced resource consumption by 90%:
_added general rule configuration for ontick frame skips, default value: 'ontickFrameSkip=10'
_added configuration for marker display frame skips when active (Ctrl+M) default value: 'showmarkersFrameSkip=0' (this value minimizes the problem of WP ID texts flashing on the screen)
After creating many spawn WayPoints in an area, the script was consuming so much resource that the FPS would drop by half while the player was within that wp radius, with this treatment in the script's general management control, the script now consumes less than 10% of what it was consulting. With almost zero impact on the script's functionalities.
version 1.4:
New features for each wp:
_added the possibility for wp to spawn the vehicle with random modifications parts , windows, wheels, tires, stickers, engine, horn, bodywork, suspension, etc. According to the library available for each vehicle, supports mods, works incredibly well, but use it sparingly as it consumes a lot of memory.
_added the possibility of defining the amount of life of the ped to be spawned (default pedHP 200)
_added taks animation for the ped, for now it only performs the animation when stopped, use in wp together with the 'waiting time' column with at least 5000 (5 seconds) so that it has time to perform the animation for the determined time (scenarioTask option)
_added TrafficWaypointSpawner.pedTasks file to create task groups (works the same as the existing group function for vehicle/ped/weapons)
_added control of ped and vehicle spawn limit per wp (default 0 for disabled, consumes performance when enabled) use when you want to set a character/boss spawn so it doesn't multiply
_added Ctrl+R command to create route wp (wp without vehicle and ped)
_added Ctrl+G command to create vehicle wp parked (wp with vehicle without ped)
New general features:
_reorganized config file and added configurations of new features and others that were missing
_added general limit for the number of spawned peds, so a new ped is only generated when another is despawned from memory
_added line that displays the path between wp when displaying markers with ctrl+M (credits to @mitto_backup for the idea)
_added text on the screen displaying the wp ID when displaying markers with ctrl+M
Other adjustments:
_support for reading ini files (wp) from previous versions
_reworked logic for moving between wp, inserting several treatments so that vehicles and peds do not lose their route
_reworked script to improve memory management and deletion of despawned vehicle indexes
version 1.3:
_ peds now follow defined routes (credits to Bradshaw, JoyLucien and Niziul for the tips)
_ fixed problem with wp (vehicles and ped) not loading the weapon and group (now if model is invalid it loads the default weapon: unarmed)
_ fixed bug with wp PED not loading groups of ped models
_ vehicles now switch correctly between up to 3 different destination IDs
_ new created wp peds are saved with speed 1. (1=walk, 2=run). Change in the ini for each wp, or in the config for the next wp in the new line: pedSpeed=1
_ order of the current structure of the wp saved in the .ini file:
wp id, wp destination id A, wp destination id B, wp destination id C, X coordinate, Y coordinate, Z coordinate, R orientation, vehicle name or group, ped name or group, vehicle or ped speed, ped weapon name or group, interval between each spawn (value in seconds, max 9), time that the ped or vehicle will remain stopped in this wp before moving on to the next destination wp (value in milliseconds).
_ fixed many bugs, more features and other improvements are on the way :)
version 1.2: (deleted - many bugs)
_added function for up to 3 destination wp ids, the script still reads the old .ini. New wp's are created with 3 repeated destination ids, and vehicles will randomly go to route ids. Change the destination ids as needed. (credits to @TrueBest for the idea)
_the script still reads the old .ini, I released this update due to the impact of this function on the creation of wp's
version 1.1:
_ optimized script, reviewed route operation and added many other features.
_added in .config the default vehiclemodel for the next wpboost created
_ added Ctrl+H command to create ped wp (a new wp is created in .ini where the vehiclemodel column is blank). For now, the spawned Ped still does not move on to the next wp.
_ reviewed the logic for creating wp id, now the script always continues from the last generated id, no longer counting from the number of lines or the generated file, so that there are no repeated wp id numbers and causing route bugs.
_ added vehicle/ped/weapon groups function, just change the model name to that of a created group and the models included in that group will be randomly spawned, the script dynamically identifies whether the name is of a model or a valid group. (credits to @JoyLucien for the idea)
_added function to read multiple .ini route files, now the wp are saved in the file with the name defined by the player, if the file does not exist the script will create it, the ini files are now inside the TrafficWaypointAreaMap folder in scripts (credits to @JoyLucien for the idea)
_fixed bug of the vehicle entering autopilot mode while the player is driving
_added the following group files to the scripts folder
TrafficWaypointSpawner.pedgroups (pedestrian groups)
TrafficWaypointSpawner.vehgroups (vehicle groups)
TrafficWaypointSpawner.wpngroups (weapon groups)
-you can create the group with the name you want followed by the modelid of each group, respecting the rule of one group per line, there is no limit of vehicles per group, however too many models loaded can cause the game to close. The name can be changed in the .config file, or in each wp generated in the .ini file
NOTE: copy the new .config file that has the new settings and the most optimized WP creation distances that I found
NOTE2: if you have already created WPs in the previous version, just place your file inside the TrafficWaypointAreaMap folder, and continue creating it.
STC - Simple Traffic Creator version 1.0:
I wrote this script to meet the need to bring mod maps to life without being blocked by the limits of the x z y coordinates and the predefined number of nodes in the game's native trafficpath areas, in addition to the work of not having to edit the popcycle, popgroup, popzone and zonebind files.
How it works:
_ The player adds waypoints called wp (waypoint) with the Ctrl+N keys (standard speed)
_ The player can also add wp waypoints with the Ctrl+B keys (boost speed) indicated for highways and circuits
_ During the game, use the Ctrl+C keys to reload the wp from the TrafficWaypointSpawner.ini file and the settings from the TrafficWaypointSpawner.config file, if you edit them outside the game.
_ Delete the last waypoint created with the Ctrl+X keys, be careful if there is an active vehicle using this last wp it may crash the script, requiring you to restart the game.
_ Possibility to show or hide the markings of the wp created in the game with the Ctrl+M keys, used to help in editing the wp.
_ Set the total limit of vehicles spawned at the same time in the game, so that new vehicles only spawn when another one is despawned, adjust according to your PC's performance.
_ Set the minimum and maximum distance from the player that the wp will spawn new vehicles (spawn radius: leave the 'spawnMinDistance' at least '180' and the 'spawnMaxDistance' at least '190')
_ Distance that the vehicles will despawn, adjust smaller values if you have performance problems, but a value lower than 200 causes visible vehicle popups on the screen
_ Vehicles are spawned in the game through each wp marker as long as they are within a minimum and maximum spawn distance from the player's current position.
_ Each created wp receives a registration id and another destination id sequentially
_ The vehicle generated in 'wp id 1' goes autonomously towards the 'destination wp id 2', and when it reaches wp id 2 it goes to the next destination id set in that wp, which by default will be id 3, and so on.
_ Each added wp has individual and customizable rules and settings, which are stored in the TrafficWaypointSpawner.ini file in the following sequence:
- wp id, and destination wp id, can be changed to create looping routes and closed circuits, for example we can change the destination wp in wp 11 from 12 to destination wp 1, this way whenever the vehicle reaches wp id 11 it will head to destination wp 1 and redo the entire route again.
- position on the map in integer values x, y, z, and rotation so that the vehicle is spawned in a certain direction.
- define the model of the vehicle to be generated in each wp (supports mods), leave blank if you do not want a vehicle to be spawned in that wp. Use to simulate sections of a circuit or reduce the volume of cars (default vehicle: adder)
- define the model of the ped to be generated as the driver of the vehicle in each wp, used to insert police peds in vehicles so that there is a route and police chase (default ped: a_m_y_skater_01), leave blank to generate parked vehicles without a driver.
- set the vehicle speed, with this the vehicle will leave with the set speed until the next wp, speed is in game units, default 15 (~33km), boost 30 (~100km)
- set a weapon to the ped to be spawned in the vehicle (default weapon: WEAPON_PISTOL), leave blank for ped without weapon.
- Interval in seconds between each vehicle spawn (default 5 seconds for the next spawn)
- waiting time for the vehicle to stop and go to the next wp, value measured in milliseconds, (default 0), use this to simulate vehicles in blits, or even at some intersections, optional.
_ When starting the game with the script, it will load the following default settings from the TrafficWaypointSpawner.config file. These settings also have an impact on new wp to be created by the player:
- despawnDistance=200 (initial vehicle despawn distance)
- spawnMinDistance=180 (minimum vehicle spawn distance)
- spawnMaxDistance=190 (maximum vehicle spawn distance)
- maxVehicles=100 (limit of vehicles spawned at the same time, counting vehicles spawned by other means)
- vehicleSpeed=15 (default vehicle speed, approximately 34Km/h)
- boostSpeed=30 (boost vehicle speed, approximately 100Km/h)
- autoSpawnEnabled=true (enables or disables vehicle spawns)
- vehicleModel=adder (change the vehicle model to be generated in the new created wp here)
- pedModel=a_m_y_skater_01 (change the ped pilot model of the vehicle to be generated in the new created wp here)
- logsEnabled=true (enable or disable the mod's behavior log)
- notificationsEnabled=true (enable or disable the messages below during the game)
- messageWPAdded=traffic Waypoints added! (change the message here when saving a normal wp)
- messageWPDeleted=traffic Waypoints deleted! (change the message here when saving a boost wp)
- messageConfigReloaded=Configurations and traffic Waypoints reloaded! (change the message here when reloading the saved settings and wp)
- hotkeyCreate=N (change the button here to activate the default wp creation function)
- hotkeyReload=C (change the button here to reload the saved settings and wp)
- hotkeyDelete=X (change the button here to delete the last wp created)
- hotkeyShowMarkers=M (change the button here to show or hide the markings of wp created in the game)
- hotkeyBoost=B (change the button here to activate the wp boost creation function)
- showMarkers=true (change here if the game's default will be to show or hide the markings of wp created when starting)
- vehicleCheckRadius=10 (Tolerance radius for wp route validation, used so that the vehicle can consider the arrival at this wp as completed and only then continue towards the next wp.
- minWaypointDistance=10 (A wp cannot spawn a vehicle while another vehicle is too close to it (default radius of 10 units, avoids stacking vehicles)
Important notes:
_ The vehicles generated by this script have a 'wakeup' behavior, so they avoid obstacles and other vehicles and do not float on the ground and only move if there is a character driving.
_ The recommended speed for vehicles in cities and on quiet roads is 10 speeds. This way, vehicles tend to respect lines and avoid accidents.
_ At very high speeds above 25 speeds, vehicles tend not to use the brakes much on curves.
Known bugs:
- at specific points in the game, vehicles may simply ignore the next wp and follow a random direction, I was unable to find the cause, behavior or pattern to solve this problem.
---------------------------------- PUT THE FILES IN SCRIPT FOLDER
version 1.8:
Added features and improvements to traffic logic:
_aiming to simplify editing, now the wp saved in the ini have a description, saved in the following way:
[area:'Name you want'] id:1,destA:2,destB:2,destC:2,posX:-7374,posY:3982,posZ:8,dir:173,veh:'adder',ped:'a_m_y_skater_01',speed:15,weapon:'WEAPON_COMBATMG',spawnInterval:5,waitTime:0,pedTask:'none',pedHP:200,vehTuning:true,vehColor1:'defaut',vehColor2:'250.0.0'
_added feature to migrate your existing wp ini file to the new format mentioned above, use Ctrl+8 keys to migrate all your saved wp.
_added limit of vehicles and pedestrians per hour in the config file. This way you can set it to have fewer vehicles at dawn, for example.
Format type = Hour: quantity limit.
If you leave it like this:
maxVehicles=60
maxVehiclesByHour=0:20,1:15
it means that at midnight we will have a maximum limit of 20 vehicles, and at 1 am we will have a maximum of 15 vehicles running, and the other times not mentioned will have a maximum of 60 vehicles running. The configuration comes with suggested limits for all hours, delete or change those you want.
_improved vehicle movement logic, now they follow the route lines more faithfully, reducing stacking and jamming.
_when displaying wp markers with Ctrl+M, the route lines are more visible and each destination has its own color, destination A: red, destination B: green, Destination C: yellow. This helps a lot when editing and viewing the routes you are creating.
_the wp cylinders (display Ctrl+M) now have the size of the corresponding checkpoint radius (configured in the config file in 'minWaypointDistance=3'). Vehicles or pedestrians only advance to the next wp when they reach the radius of that wp.
_now the text above the wp cylinders (show Ctrl+M) have the name 'area' followed by the wp id set in each wp. Look at the print where I put the name of the city 'Gostown' on the wp of that area, organizing and facilitating editing.
_added in the config file option to change all messages and notifications of the script actions, the default notifications are in English
_made other small adjustments and optimizations
version 1.7:
_fixed the randomCustomization field that was saved as empty when creating new wp in the ini when the value in the config was false, which caused all spawn wp in the game not to load
_fixed a sequential bug when creating wp from the last version, it will always follow the highest wp id registered, avoiding duplication of wp id
_when creating a wp from a parked vehicle (Ctrl+G) the wp will have the destination A B C equal to the source wp id
_Removed parked vehicles spawn limit. Now they do not count towards the total limit of spawns of moving vehicles.
_adjusted the config file that contained resource options that were not yet functional.
_current structure of the ini file of each generated wp:
'wp id',
'wp dest id A',
'wp dest id B',
'wp dest id C'
'position X',
'position Y',
'position Z',
'direction',
'vehicle name or group',
'ped name or group',
'vehicle or ped speed',
'weapon name or group',
'interval (seconds) between each spawn',
'wait time (milliseconds) before advancing to the next wp',
'ped task name or group',
'pedHP amount of ped health',
'random vehicle tuning (enabled:true or disabled:false)',
'vehicle primary color',
''vehicle secundary color'
version 1.6:
Version focused on restructuring, optimization and performance of the script, for compatibility with the implementation of future features. It is now as lightweight as the first version
_The name of the script and its files have been standardized to 'STC_filename'. You must delete the old 'TrafficWaypointSpawner' files, otherwise you will have many duplication problems. If you have ini files of created wp routes, copy their ini files to the new 'STC_wpAreaMap' folder
_The vehicle, ped, tasks and weapons group files have a new format and are in ini type, so it is easier to create and identify the group name. (credits to @JoyLucien for the idea)
_The script still reads the ini files of the created wp routes of previous versions (as long as they are inside the new 'STC_wpAreaMap' folder, parcial compatibility very old versions)
_Added the possibility of selecting the primary and secondary color of the vehicle that will be spawned in each created wp. The color values can be changed for each wp or you can change the default for the next generated wp in the config file.
Default values that you can set for primary and secondary colors, with one field for each 'color', you can mix them if you want:
'defaut' = keeps the vehicles spawning randomly in the default colors of each model.
'rgb' = makes vehicles appear in completely random and unpredictable colors via rgb.
'0.0.0' = rgb value, in this case it spawns in black, change these values from 0 to 250 to the desired color, the vehicle spawned in this wp will only be in this color.
_removed redundancies and simplified task checking in general (there are a lot of things I won't even mention here because the list is long), now even with the ontick at '0' the FPS drop caused by the script is minimal, the FPS drop is now due to the excess of entities on the screen.
_removed the resource of limiting spawns per wp individually, because it was heavy and was causing a lot of stuttering.
version 1.5:
Optimized script, reduced resource consumption by 90%:
_added general rule configuration for ontick frame skips, default value: 'ontickFrameSkip=10'
_added configuration for marker display frame skips when active (Ctrl+M) default value: 'showmarkersFrameSkip=0' (this value minimizes the problem of WP ID texts flashing on the screen)
After creating many spawn WayPoints in an area, the script was consuming so much resource that the FPS would drop by half while the player was within that wp radius, with this treatment in the script's general management control, the script now consumes less than 10% of what it was consulting. With almost zero impact on the script's functionalities.
version 1.4:
New features for each wp:
_added the possibility for wp to spawn the vehicle with random modifications parts , windows, wheels, tires, stickers, engine, horn, bodywork, suspension, etc. According to the library available for each vehicle, supports mods, works incredibly well, but use it sparingly as it consumes a lot of memory.
_added the possibility of defining the amount of life of the ped to be spawned (default pedHP 200)
_added taks animation for the ped, for now it only performs the animation when stopped, use in wp together with the 'waiting time' column with at least 5000 (5 seconds) so that it has time to perform the animation for the determined time (scenarioTask option)
_added TrafficWaypointSpawner.pedTasks file to create task groups (works the same as the existing group function for vehicle/ped/weapons)
_added control of ped and vehicle spawn limit per wp (default 0 for disabled, consumes performance when enabled) use when you want to set a character/boss spawn so it doesn't multiply
_added Ctrl+R command to create route wp (wp without vehicle and ped)
_added Ctrl+G command to create vehicle wp parked (wp with vehicle without ped)
New general features:
_reorganized config file and added configurations of new features and others that were missing
_added general limit for the number of spawned peds, so a new ped is only generated when another is despawned from memory
_added line that displays the path between wp when displaying markers with ctrl+M (credits to @mitto_backup for the idea)
_added text on the screen displaying the wp ID when displaying markers with ctrl+M
Other adjustments:
_support for reading ini files (wp) from previous versions
_reworked logic for moving between wp, inserting several treatments so that vehicles and peds do not lose their route
_reworked script to improve memory management and deletion of despawned vehicle indexes
version 1.3:
_ peds now follow defined routes (credits to Bradshaw, JoyLucien and Niziul for the tips)
_ fixed problem with wp (vehicles and ped) not loading the weapon and group (now if model is invalid it loads the default weapon: unarmed)
_ fixed bug with wp PED not loading groups of ped models
_ vehicles now switch correctly between up to 3 different destination IDs
_ new created wp peds are saved with speed 1. (1=walk, 2=run). Change in the ini for each wp, or in the config for the next wp in the new line: pedSpeed=1
_ order of the current structure of the wp saved in the .ini file:
wp id, wp destination id A, wp destination id B, wp destination id C, X coordinate, Y coordinate, Z coordinate, R orientation, vehicle name or group, ped name or group, vehicle or ped speed, ped weapon name or group, interval between each spawn (value in seconds, max 9), time that the ped or vehicle will remain stopped in this wp before moving on to the next destination wp (value in milliseconds).
_ fixed many bugs, more features and other improvements are on the way :)
version 1.2: (deleted - many bugs)
_added function for up to 3 destination wp ids, the script still reads the old .ini. New wp's are created with 3 repeated destination ids, and vehicles will randomly go to route ids. Change the destination ids as needed. (credits to @TrueBest for the idea)
_the script still reads the old .ini, I released this update due to the impact of this function on the creation of wp's
version 1.1:
_ optimized script, reviewed route operation and added many other features.
_added in .config the default vehiclemodel for the next wpboost created
_ added Ctrl+H command to create ped wp (a new wp is created in .ini where the vehiclemodel column is blank). For now, the spawned Ped still does not move on to the next wp.
_ reviewed the logic for creating wp id, now the script always continues from the last generated id, no longer counting from the number of lines or the generated file, so that there are no repeated wp id numbers and causing route bugs.
_ added vehicle/ped/weapon groups function, just change the model name to that of a created group and the models included in that group will be randomly spawned, the script dynamically identifies whether the name is of a model or a valid group. (credits to @JoyLucien for the idea)
_added function to read multiple .ini route files, now the wp are saved in the file with the name defined by the player, if the file does not exist the script will create it, the ini files are now inside the TrafficWaypointAreaMap folder in scripts (credits to @JoyLucien for the idea)
_fixed bug of the vehicle entering autopilot mode while the player is driving
_added the following group files to the scripts folder
TrafficWaypointSpawner.pedgroups (pedestrian groups)
TrafficWaypointSpawner.vehgroups (vehicle groups)
TrafficWaypointSpawner.wpngroups (weapon groups)
-you can create the group with the name you want followed by the modelid of each group, respecting the rule of one group per line, there is no limit of vehicles per group, however too many models loaded can cause the game to close. The name can be changed in the .config file, or in each wp generated in the .ini file
NOTE: copy the new .config file that has the new settings and the most optimized WP creation distances that I found
NOTE2: if you have already created WPs in the previous version, just place your file inside the TrafficWaypointAreaMap folder, and continue creating it.
STC - Simple Traffic Creator version 1.0:
I wrote this script to meet the need to bring mod maps to life without being blocked by the limits of the x z y coordinates and the predefined number of nodes in the game's native trafficpath areas, in addition to the work of not having to edit the popcycle, popgroup, popzone and zonebind files.
How it works:
_ The player adds waypoints called wp (waypoint) with the Ctrl+N keys (standard speed)
_ The player can also add wp waypoints with the Ctrl+B keys (boost speed) indicated for highways and circuits
_ During the game, use the Ctrl+C keys to reload the wp from the TrafficWaypointSpawner.ini file and the settings from the TrafficWaypointSpawner.config file, if you edit them outside the game.
_ Delete the last waypoint created with the Ctrl+X keys, be careful if there is an active vehicle using this last wp it may crash the script, requiring you to restart the game.
_ Possibility to show or hide the markings of the wp created in the game with the Ctrl+M keys, used to help in editing the wp.
_ Set the total limit of vehicles spawned at the same time in the game, so that new vehicles only spawn when another one is despawned, adjust according to your PC's performance.
_ Set the minimum and maximum distance from the player that the wp will spawn new vehicles (spawn radius: leave the 'spawnMinDistance' at least '180' and the 'spawnMaxDistance' at least '190')
_ Distance that the vehicles will despawn, adjust smaller values if you have performance problems, but a value lower than 200 causes visible vehicle popups on the screen
_ Vehicles are spawned in the game through each wp marker as long as they are within a minimum and maximum spawn distance from the player's current position.
_ Each created wp receives a registration id and another destination id sequentially
_ The vehicle generated in 'wp id 1' goes autonomously towards the 'destination wp id 2', and when it reaches wp id 2 it goes to the next destination id set in that wp, which by default will be id 3, and so on.
_ Each added wp has individual and customizable rules and settings, which are stored in the TrafficWaypointSpawner.ini file in the following sequence:
- wp id, and destination wp id, can be changed to create looping routes and closed circuits, for example we can change the destination wp in wp 11 from 12 to destination wp 1, this way whenever the vehicle reaches wp id 11 it will head to destination wp 1 and redo the entire route again.
- position on the map in integer values x, y, z, and rotation so that the vehicle is spawned in a certain direction.
- define the model of the vehicle to be generated in each wp (supports mods), leave blank if you do not want a vehicle to be spawned in that wp. Use to simulate sections of a circuit or reduce the volume of cars (default vehicle: adder)
- define the model of the ped to be generated as the driver of the vehicle in each wp, used to insert police peds in vehicles so that there is a route and police chase (default ped: a_m_y_skater_01), leave blank to generate parked vehicles without a driver.
- set the vehicle speed, with this the vehicle will leave with the set speed until the next wp, speed is in game units, default 15 (~33km), boost 30 (~100km)
- set a weapon to the ped to be spawned in the vehicle (default weapon: WEAPON_PISTOL), leave blank for ped without weapon.
- Interval in seconds between each vehicle spawn (default 5 seconds for the next spawn)
- waiting time for the vehicle to stop and go to the next wp, value measured in milliseconds, (default 0), use this to simulate vehicles in blits, or even at some intersections, optional.
_ When starting the game with the script, it will load the following default settings from the TrafficWaypointSpawner.config file. These settings also have an impact on new wp to be created by the player:
- despawnDistance=200 (initial vehicle despawn distance)
- spawnMinDistance=180 (minimum vehicle spawn distance)
- spawnMaxDistance=190 (maximum vehicle spawn distance)
- maxVehicles=100 (limit of vehicles spawned at the same time, counting vehicles spawned by other means)
- vehicleSpeed=15 (default vehicle speed, approximately 34Km/h)
- boostSpeed=30 (boost vehicle speed, approximately 100Km/h)
- autoSpawnEnabled=true (enables or disables vehicle spawns)
- vehicleModel=adder (change the vehicle model to be generated in the new created wp here)
- pedModel=a_m_y_skater_01 (change the ped pilot model of the vehicle to be generated in the new created wp here)
- logsEnabled=true (enable or disable the mod's behavior log)
- notificationsEnabled=true (enable or disable the messages below during the game)
- messageWPAdded=traffic Waypoints added! (change the message here when saving a normal wp)
- messageWPDeleted=traffic Waypoints deleted! (change the message here when saving a boost wp)
- messageConfigReloaded=Configurations and traffic Waypoints reloaded! (change the message here when reloading the saved settings and wp)
- hotkeyCreate=N (change the button here to activate the default wp creation function)
- hotkeyReload=C (change the button here to reload the saved settings and wp)
- hotkeyDelete=X (change the button here to delete the last wp created)
- hotkeyShowMarkers=M (change the button here to show or hide the markings of wp created in the game)
- hotkeyBoost=B (change the button here to activate the wp boost creation function)
- showMarkers=true (change here if the game's default will be to show or hide the markings of wp created when starting)
- vehicleCheckRadius=10 (Tolerance radius for wp route validation, used so that the vehicle can consider the arrival at this wp as completed and only then continue towards the next wp.
- minWaypointDistance=10 (A wp cannot spawn a vehicle while another vehicle is too close to it (default radius of 10 units, avoids stacking vehicles)
Important notes:
_ The vehicles generated by this script have a 'wakeup' behavior, so they avoid obstacles and other vehicles and do not float on the ground and only move if there is a character driving.
_ The recommended speed for vehicles in cities and on quiet roads is 10 speeds. This way, vehicles tend to respect lines and avoid accidents.
_ At very high speeds above 25 speeds, vehicles tend not to use the brakes much on curves.
Known bugs:
- at specific points in the game, vehicles may simply ignore the next wp and follow a random direction, I was unable to find the cause, behavior or pattern to solve this problem.
---------------------------------- PUT THE FILES IN SCRIPT FOLDER
पहले अपलोड: मार्च 13, 2025
आखरी अपडेट: 16 hours ago
Last Downloaded: 19 कुछ मिनट पहले
@mitto_backup I had no problems with this, in which map or location does this occur? I imagine that it can occur if some vehicle mod, or even about the spawn distance, or even the rendering of the map, check the game configuration related to 'Extended Distance Scale' and 'Distance Scale' and increase these values a little, leaving them at least 40%, because in this script the vehicles are spawned already in an 'awake' state with the tires on the ground, while the normal vehicles in the game are spawned floating above the ground, they are only 'awakened' when the player interacts with them. If the map's collision data is being loaded at a short distance then it can cause the vehicles in this script to fall under the ground.
@mitto_backup It's a good idea, I'm trying to insert behavior scenarios for the ped at the moment, but I'm still finding some challenges with it.
That's awesome! I'll test it out to create machinima scenes.
Thanks for this mod. <3
@Nemsei Thank you for rating, send feedback
Hey, why don't you use the ini format for all files such as configuration files, vehgroups, wpngroups, etc.? Then add node classifications for different types of vehicles, characters, etc., and distinguish file names with different names. Because files in this format can read nodes [node], it will be more intuitive to view.
For example, in the following format:
[boats]
boats,
dinghy5,
avisa
[sports]
ninef,
ninef2,
banshe
@JoyLucien You're right, thank you very much for the tip, this way it will be much more organized. I've been thinking a lot about a way to improve the ini file that saves the created wp routes, in addition to implementing an in-game menu to make these edits to the files without leaving the game.
Ay it don't matter what game version im on right? I was on 2372 and couldn't get it to work but idk if it was a script hook thing or not
@TrueBest I've never tested it on that version, but try using the latest ScriptHook from:
🔗 https://www.dev-c.com/gtav/scripthookv/
Place the ScriptHookDotNet 2 and 3 files both in the root folder and the scripts folder:
🔗 https://github.com/scripthookvdotnet/scripthookvdotnet/releases
ScriptHookVDotNet 3.x requires .NET Framework 4.8, which you can download here:
🔗 https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48
If it still doesn't work, check the log file at:
GTA V/scripts/ScriptHookVDotNet3.log
Copy and paste it here so I can take a look.
@schio84dude Okay I got you I gotta redownload the game now lol I'll be right back ahaha
I cannot seem to get this to launch, the log doesn't give anything even so it is set to true so I guess it's not even running in the first place.
I've set up the mod in the scripts folder, scipthook seems to be working since menyoo does... help would be appreciated
@Kelsiel There may be some incompatibility with some other script you are using. If you have used another script in the folder that is not working properly, it may affect this script. The log you should look for is in GTA V/ScriptHookVDotNet3.log
Inside it, look for a line like this:
[21:38:40] [DEBUG] Successfully compiled STC_SimpleTrafficCreator.cs using API version 3.7.0....
@schio84dude Thanks for the help tho it wasn't the issue, the issue was the latest windows update wich decided to delete half of scripthook files, reinstalling it did the trick and it's now working fine.
@Kelsiel I'm glad you solved the problem :) Wow, I didn't even know this could happen, I'll keep an eye out for it too
@schio84dude it might just be me being unlucky since anytime I update windows something seems to go wrong.
Your mod is really good by the way, even so it could really use a interface to be easier to use, however it's not really what I was looking for, and since I can't find anything like it I might just ask, do you know a mod that would allow for placing down waypoints, exactly like your mod, with the added feature of being able to divide the node into multiple paths and linking npcs to them so those specific npcs can drive on them without switching to a default/vanilla traffic node ? I'm trying to make some AI races but nothing will do.
@Kelsiel I don't know, but I intend to add more predefined resources to make it easier to create races and police activities.
@schio84dude could I suggest you some features for whenever that day comes ?
@Kelsiel yes of course, suggestions are very welcome
In view of the fact that I have also accumulated relevant experience in the field of script development, I would like to solemnly remind you: It is recommended to compile the script into the dll format. This is because some functions may encounter problems in the cs format, while using the dll format can significantly improve security and effectively avoid difficult-to-troubleshoot malfunctions caused by format issues, so as not to find out that it is due to the cs format after getting into the trouble of troubleshooting. You can consider publishing the source code on the GitHub platform, or providing both cs and dll formats at the same time.
I think you can put all the configuration files in one folder, which will look cleaner. For the code related to the path, you can use the dynamic acquisition method to read the ini file in the folder where the script is located, similar to the following.
private static readonly string ConfigPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Joy_TeleportData", "TeleportCoordinates.ini");
private static readonly string SavePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Joy_TeleportData", "ClipboardCordsSave.txt");
@schio84dude alright, so first of all again, and that's mostly just quality of life, such a mod would need a interface and possibly a free cam to place down waypoints, especially for a large track that could involve multiples paths.
A "repeat" checkbox could be useful, when the npc reaches the end he automatically goes back to the first checkpoint and redo everything, being able to chose how many time the path should be repeated could also be useful in order to track laps.
Being able to divide a waypoint into multiple other waypoints would be really useful to make shortcuts or multiples trajectories, but I think you already implemented such a thing, I'm not sure.
In terms of possibilities and setting per waypoints, I think you could take some heavy inspirations from the "mission maker" mod, it's interface is very clunky but the possibilities to make vehicle paths is unmatched, for exemple you can tell the ai to avoid using highways, or go in reverse if needed on wp per wp basis, again, you could easily take inspiration from that mod since it gives a lot of options.
Finally you would need a option to link a specific npc to said nodes with some sort of task sequence like, drive X vehicle > go to waypoint number 1 from X set > follow said set of wp and repeat > etc...
You'll probably need the ability to spawn peds, like menyoo, with such a feature if the ability to save those things is present.
Also a button to remove every npcs added by your mod could pair well with the previous feature, it'll make resetting tracks/races very easy since you'll just be able to wipe everything, reload the track with the editor/menyoo and then reload the npcs with your mod.
Also personal request if you do implement a ped spawner, include a "customize ped" option to change their clothes, I need pavel to drive like a mad man in a cheburek while wearing his favorite pilotka.
I think that's all, main thing you should check is again, the mission maker mod for it's options regarding npc drivers, if I have any other ideas I'll gladly tell you about it, don't hesitate to ping me if you end up including such features in the future or for anything really