Simple Traffic Creator 1.5
941
55
941
55
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.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 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',
'wp spawn limit in memory',
'random vehicle tuning (enabled:true or disabled:false)'
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.
- if you spawn vehicles without a ped, when you enter some of them they may force automatic piloting.
---------------------------------- PUT THE FILES IN SCRIPT FOLDER
PT-BR
Com esse script voce finalmente pode criar trafico de veiculos de forma simples e customizavel em qualquer local e ate mesmo em mapas mod. Este script simula apenas trafico de veiculos (e agora pedestres) , possui customização para cada ponto criado alem de configurações de desempenho e comportamento.
versao 1.5:
Script otimizado, redução do consumo de recursos em 90%:
_adicionado configuração de regra geral de pulos de frames do ontick, valor padrão: 'ontickFrameSkip=10'
_adicionado configuração de pulos de frames da exibição dos marcadores quando ativo ( Ctrl+M) valor padrão: 'showmarkersFrameSkip=0' (este valor minimiza o problema de textos dos WP ID ficarem piscantes na tela)
Apos criar muitos WayPoints de spawn em uma area, o script estava consumindo muito recurso a ponto do FPS cair pela metade enquanto o jogador estivesse dentro daquele raio de wp, com essa tratativa no controle de gerenciamento geral do script, o script passa a consumir menos de 10% doque estava a consulmir. Com impacto quase zero sobre as funcionalidades do script.
versao 1.4:
Novos recursos para cada wp:
_adicionada possibilidade do wp spawnar o veiculo com modificações aleatorias (vidros, rodas, pneus, adevisos, motor, buzina, latarias, suspensão etc) de acordo com a biblioteca disponivel de cada veiculo, suporta mods, funciona incrivelmente bem, mas use com moderação pois conseome muita memoria.
_adicionado possibilidade de definir a quantidade de vida do ped a ser spawnado (pedHP padrão 200)
_adicionada animação (opção scenarioTask) para o ped , por enquanto so realiza a animação quando parado, use no wp junto com a coluna 'tempo de espera' com pelo menos 5000 (5 segundos) para que tenha tempo de realizar a animação pelo tempo determinado (opção scenarioTask)
_adicionado arquivo TrafficWaypointSpawner.pedTasks para criação de grupos de task ( funciona igual a função de grupo existente para veiculo/ped/armas)
_adicionado controle de limite de spawm de ped e veiculo por wp (padrão 0 para desativado, consome desempenho quando ativado) use quando quiser setar um spawn de personagem/chefe para nao se multiplicar
_adicionado comando Ctrl+R para criação de wp de rota (wp sem veiculo e ped)
_adicionado comando Ctrl+G para criação de wp de veiculo estacionado (wp com veiculo sem ped)
_nova estrutura do arquivo ini de cada wp gerado:
'wp id',
'wp dest id A',
'wp dest id B',
'wp dest id C'
'posição X','posição Y', 'posição Z', 'direção',
'veiculo nome ou grupo',
'ped nome ou grupo',
'velocidade do veiculo ou ped',
'arma nome ou grupo',
'intervalo (segundos) entre cada spawn',
'tempo de espera (milissegundos) antes de avançar para o proximo wp',
'ped task nome ou grupo',
'pedHP quantidade vida do ped',
'limite de spawn na memoria',
'tunagem aleatoria de veiculos (ativado:true ou desativado:false)'
Novos recursos gerais:
_arquivo config reorganizado e adicionada configurações de novos recursos e outros que estavam ausentes
_adicionado limite geral para quantidade de ped spawnados, com isso um novo ped so é gerado quando outro for despawnado da memoria
_adicionada linha que exibe o caminho entre os wp ao exibir marcadores com ctrl+M (creditos ao @mitto_backup pela ideia)
_adicionado texto na tela exibindo o ID do wp ao exibir marcadores com ctrl+M
Outros ajustes:
_suporte para leitura dos arquivos ini (wp) das versoes anteriores
_logica de movimentação entre wp retrabalhada, inserida varias tratatiivas para veiculos e ped nao perderem a rota
_script retrabalhado para melhorar gerenciamento de memoria e exclusão de indices de veiculos despawnados
versão 1.3:
_ os peds agora seguem rotas definidas (creditos ao Bradshaw, JoyLucien e Niziul pelas dicas)
_ corrigido problema dos wp (veiculos e ped) não carregarem a arma e grupo ( agora se modelo for invalido carrega a arma padrão: desarmado)
_ corrigido bug dos wp PED não carregar grupos de modelos de peds
_ os veiculos agora alternan corretamente em ate 3 ids de destino diferentes
_ novos ped wp criados são salvos com velocidade 1. (1= caminhar, 2=correr). Altere no ini para cada wp, ou no config para os proximos wp na nova linha: pedSpeed=1
_ ordem da estrutura atual dos wp salvos no arquivo .ini:
wp id, wp destino id A, wp destino id B, wp destino id C, coordenada X, coordenada Y, coordenada Z, orientação R, nome ou grupo do veiculo, nome ou grupo do ped, velocidade do veiculo ou ped, nome ou grupo da arma do ped, intervalo entre cada spawn (valor em segundos, max 9), tempo que o ped ou veiculo ficara parado nesse wp antes de partir para o proximo wp destino (velor em milissegundos).
_ corrigido varios bugs, mais recursos e outras melhorias estão a camimho :)
versão 1.2 (deletado - muitos bugs):
_adiconada função de ate 3 destino wp id, o script ainda le o .ini antigo. Os novos wp sao criados com 3 id destinos repetidos, e os veiculos irão aleatoriamente pra rotas ids. Altere os ids destinos conforme necessario. (creditos ao @TrueBest pela ideia)
_o script ainda le o .ini antigo, soltei esse update devido ao impacto dessa função na criação dos wp
versão 1.1:
_ otimizado script, revisto funcionamento das rotas e adicionado muitos outros recursos.
_adicionado em .config o modelo veiculo padrão para os proximos wp boost criados
_adicionado o comando Ctrl+H para criar wp de ped (é criado um novo wp no .ini onde a coluna veihiclemodel fica em branco). Por enquanto o Ped spawnado ainda não anda para o próximo wp.
_revisto a logica de criação de wp id, agora o script sempre continua do ultimo id gerado, nao contando mais a partir do numero de linhas nem do arquivo gerado, para nao haver numeros wp id repetidos e causar bugs de rotas.
_adicionada função de grupos de veiculo/ped/armas, apenas mude o nome do modelo para o de algum grupo criado e sera spawnado aleatoriamente os modelos inclusos daquele grupo, o script identifica de maneira dinâmica se o nome é de um modelo ou de um grupo valido. (creditos ao @JoyLucien pela ideia)
_adicionado função de leitura de multiplos arquivos de rota .ini, agora as wp sao salvos no arquivo de nome definido pelo jogador, se o arquivo nao existir o script o criara, os arquivos ini agora ficam dentro da pasta TrafficWaypointAreaMap em scripts (creditos ao @JoyLucien pela ideia)
_corrigido bug do veiculo entrar em modo de piloto automatico enquando o jogador esta dirigindo
_adicionado na pasta scripts os seguintes arquivos de grupos
TrafficWaypointSpawner.pedgroups (grupos de pedestres)
TrafficWaypointSpawner.vehgroups (grupos de veiculos)
TrafficWaypointSpawner.wpngroups (grupos de armas)
-voce pode criar dentro o grupo de nome que desejar seguido do modelid de cada grupo, respeitando a regra de um grupo por linha, nao ah limite de veiculos por grupo, porem muitos modelos carregado pode fazer o jogo fechar. Pode ser alterado o nome no arquivo .config, ou em cada wp gerado no arquivo .ini
OBS: copie o novo arquivo .config que possui as novas configuraões e esta com as distancia de criação de wp mais otimizadas que encontrei
OBS2: se ja tiver criado WPs na versão anterior, basta colocar seu arquivo para dentro da pasta TrafficWaypointAreaMap, e continuar sua criação
versão 1.0:
Fiz esse scrip para suprir a necessidade de dar vida a mapas mods sem ser barrado pelos limites das coordenadas x z y e da quantidade predefinida de nodes das areas de trafficpaths nativos do jogo, alem do trabalho de não precisar ter que editar os arquivos popcycle, popgroup, popzone e zonebind.
Como funciona:
_ O jogador adiciona pontos de rota chamados de wp (waypoint) com as teclas Ctrl+N (velocidade padrão)
_ O jogador pode adicionar tambem pontos de rota wp com as teclas Ctrl+B (velocidade boost) indicado pra rodovias e circuitos
_ Durante o jogo use as teclas Ctrl+C para recarregar os wp do arquivo TrafficWaypointSpawner.ini e as configurações do arquivo TrafficWaypointSpawner.config, caso as edite fora do jogo.
_ Exclua o ultimo waypoint criado com as teclas Ctrl+X, cuidado se houver um veiculo ativo usando esse ultimo wp pode travar o script, sendo necessario reiniciar o jogo.
_ Possibilidade de mostrar ou ocultar as marcações dos wp criados no jogo com as teclas Ctrl+M, usado para auxiliar na edição dos wp.
_ Defina o limite total de veiculos spawnados ao mesmo tempo no game, assim so spawna novos veiculos quando um outro é despawnado, ajuste conforme desempenho do seu PC.
_ Defina a distancia minima e maxima ao jogador que os wp vão spawnar novos veiculos (raio de spawn: deixe o 'spawnMinDistance' de pelo menos '180' e o 'spawnMaxDistance' em pelo menos '190')
_ Distancia que os veiculos vão despawnar, ajuste valores menores caso tenha problema com desempenho mas valor inferior a 200 causa efeito de popups visiveis de veiculos na tela
_ Os veiculos são spawnados no jogo atraves de cada marcador wp enquanto estiverem dentro de uma distancia de spawn minima e maxima da posição atual do jogador.
_ Cada wp criado recebe de forma sequencial um id de registro e outro id de destino
_ O veiculo gerado no 'wp id 1' vai de forma autonoma em direção ao 'wp de destino id 2', e quando chegar no wp id 2 vai para o proximo id destino setado nesse wp que como padrão sera o id 3, e assim por diante.
_ Cada wp adicionado possui regras e configurações individuais e personalizaveis, que fica armazenado no arquivo TrafficWaypointSpawner.ini na seguinte sequencia:
- id do wp, e id do wp destino, pode ser alterado para criação de rotas em looping e circuitos fechados, exemplo podemos alterar no wp 11 o seu wp destino de 12 para wp destino 1, dessa forma sempre que o veiculo chegar ao wp id 11 ele vai se direcionar ao wp destino 1 e refazer toda a rota novamente.
- posição no mapa em valores inteiros x, y, z, e rotação para que o veiculo seja spawnado em certa direção.
- defina o modelo do veiculo a ser gerado em cada wp (suporta mods), deixe em branco se não quiser que seja spawnado veiculo naquele wp. Use para simular trechos de circuito ou diminuir volume de carros (veiculo padrão: adder)
- defina o modelo do ped a ser gerado como piloto do veiculo de em cada wp, usado para inserir ped de policia em viaturas para que então haja rota e perseguição policial (ped padrão: a_m_y_skater_01), deixe em branco para gerar veiculos estacionados sem piloto.
- defina a velocidade do veiculo, com isso o veiculo partira com a velocidade setada ate o proximo wp, velocidade esta em unidade do jogo, sendo padrão 15 (~33km), boost 30 (~100km)
- defina uma arma ao ped a ser gerado no veiculo (arma padrão: WEAPON_PISTOL), deixe em branco pra ped sem arma.
- Intervalo em segundos entre cada spawn de veiculo (padrão 5 segundos para o proximo spwan)
- tempo de espera para o veiculo ficar parado e ir ao proximo wp, valor medido em milissegundos, (padrão 0 ), use isso para simular viaturas em blits, ou mesmo em alguns cruzamentos, opcional.
_ Ao iniciar o jogo com o script ele vai carregar as seguintes configurações padrão do arquivo TrafficWaypointSpawner.config, essas configurações tem impacto tambem nos novos wp a serem criados pelo jogador:
- despawnDistance=200 (distancia inicial de despawn de veiculos)
- spawnMinDistance=180 (distancia minima de spawn de veiculos)
- spawnMaxDistance=190 (distancia maxima de spawn de veiculos)
- maxVehicles=100 (limite de veiculos spawnados ao mesmo tempo, contando os veiculos spawnados por outros meios)
- vehicleSpeed=15 (velocidade padrão do veiculo, aproximadamente 34Km/h)
- boostSpeed=30 (velocidade boost do veiculo, aproximadamente 100Km/h)
- autoSpawnEnabled=true (ativa ou desativa os spawns de veiculos)
- vehicleModel=adder (altere aqui o modelo do veiculo a ser gerado nos novos wp criados)
- pedModel=a_m_y_skater_01 (altere aqui o modelo do ped piloto do veiculo a ser gerado nos novos wp criados)
- logsEnabled=true (ativar ou desativar log de comportamento do mod)
- notificationsEnabled=true (ativar ou desativar as mensagens abaixo durante o game)
- messageWPAdded=traffic Waypoints adicionado! (altere aqui a mensagem quando salvar um wp normal)
- messageWPDeleted=traffic Waypoints excluído! (altere aqui a mensagem quando salvar um wp boost)
- messageConfigReloaded=Configurações e traffic Waypoints recarregados! (altere aqui a mensagem quando recarregar as configurações e wp salvos)
- hotkeyCreate=N (altere aqui o botão pra acionar a função de criar wp padrão)
- hotkeyReload=C (altere aqui o botão pra recarregar as configurações e wp salvos)
- hotkeyDelete=X (altere aqui o botão pra exclusão do ultimo wp criado)
- hotkeyShowMarkers=M (altere aqui o botão pra mostrar ou ocultar as marcações de wp criados no game)
- hotkeyBoost=B (altere aqui o botão pra acionar a função de criar wp boost)
- showMarkers=true (altere aqui se o padrão do game sera mostrar ou ocultar as marcações de wp criados ao iniciar)
- vehicleCheckRadius=10 (Raio de tolerancia para validação de rota de wp, usado para que o veiculo possa considerar como concluida a chegada nesse wp e só então se seguir em direção ao proximo wp.
- minWaypointDistance=10 (Um wp não pode gerar veiculo enquanto um outro veiculo estiver muito proximo a ele (raio padrão de 10 unidades, evita empilhamento de veiculos)
observações importantes:
_ os veiculos gerados por esse script tem comportamento 'wakeup' então eles desviam de obstaculos e outros veiculo e não flutuam pelo chão e só andam se tiver um personagem na pilotagem.
_ a velocidade recomendada para veiculos em cidades e vias tranquilas é de 10 unidade. dessa forma os veiculos tendem a respeitar filas e evitar mais os acidentes
_ em velocidades muito altas superior a 25 unidades, os veiculos tendem a nao usar muito o freio nas curvas
Bugs conhecidos:
- em pontos espeficicos do game os veículos podem simplesmente ignorar o próximo wp e seguir uma direção aleatória, não consegui localizar a causa, comportamento ou padrão pra resolver esse problema.
- se spawnar veículos sem ped, ao entrar em alguns deles eles podem forçar uma pilotagem automática.
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 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',
'wp spawn limit in memory',
'random vehicle tuning (enabled:true or disabled:false)'
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.
- if you spawn vehicles without a ped, when you enter some of them they may force automatic piloting.
---------------------------------- PUT THE FILES IN SCRIPT FOLDER
PT-BR
Com esse script voce finalmente pode criar trafico de veiculos de forma simples e customizavel em qualquer local e ate mesmo em mapas mod. Este script simula apenas trafico de veiculos (e agora pedestres) , possui customização para cada ponto criado alem de configurações de desempenho e comportamento.
versao 1.5:
Script otimizado, redução do consumo de recursos em 90%:
_adicionado configuração de regra geral de pulos de frames do ontick, valor padrão: 'ontickFrameSkip=10'
_adicionado configuração de pulos de frames da exibição dos marcadores quando ativo ( Ctrl+M) valor padrão: 'showmarkersFrameSkip=0' (este valor minimiza o problema de textos dos WP ID ficarem piscantes na tela)
Apos criar muitos WayPoints de spawn em uma area, o script estava consumindo muito recurso a ponto do FPS cair pela metade enquanto o jogador estivesse dentro daquele raio de wp, com essa tratativa no controle de gerenciamento geral do script, o script passa a consumir menos de 10% doque estava a consulmir. Com impacto quase zero sobre as funcionalidades do script.
versao 1.4:
Novos recursos para cada wp:
_adicionada possibilidade do wp spawnar o veiculo com modificações aleatorias (vidros, rodas, pneus, adevisos, motor, buzina, latarias, suspensão etc) de acordo com a biblioteca disponivel de cada veiculo, suporta mods, funciona incrivelmente bem, mas use com moderação pois conseome muita memoria.
_adicionado possibilidade de definir a quantidade de vida do ped a ser spawnado (pedHP padrão 200)
_adicionada animação (opção scenarioTask) para o ped , por enquanto so realiza a animação quando parado, use no wp junto com a coluna 'tempo de espera' com pelo menos 5000 (5 segundos) para que tenha tempo de realizar a animação pelo tempo determinado (opção scenarioTask)
_adicionado arquivo TrafficWaypointSpawner.pedTasks para criação de grupos de task ( funciona igual a função de grupo existente para veiculo/ped/armas)
_adicionado controle de limite de spawm de ped e veiculo por wp (padrão 0 para desativado, consome desempenho quando ativado) use quando quiser setar um spawn de personagem/chefe para nao se multiplicar
_adicionado comando Ctrl+R para criação de wp de rota (wp sem veiculo e ped)
_adicionado comando Ctrl+G para criação de wp de veiculo estacionado (wp com veiculo sem ped)
_nova estrutura do arquivo ini de cada wp gerado:
'wp id',
'wp dest id A',
'wp dest id B',
'wp dest id C'
'posição X','posição Y', 'posição Z', 'direção',
'veiculo nome ou grupo',
'ped nome ou grupo',
'velocidade do veiculo ou ped',
'arma nome ou grupo',
'intervalo (segundos) entre cada spawn',
'tempo de espera (milissegundos) antes de avançar para o proximo wp',
'ped task nome ou grupo',
'pedHP quantidade vida do ped',
'limite de spawn na memoria',
'tunagem aleatoria de veiculos (ativado:true ou desativado:false)'
Novos recursos gerais:
_arquivo config reorganizado e adicionada configurações de novos recursos e outros que estavam ausentes
_adicionado limite geral para quantidade de ped spawnados, com isso um novo ped so é gerado quando outro for despawnado da memoria
_adicionada linha que exibe o caminho entre os wp ao exibir marcadores com ctrl+M (creditos ao @mitto_backup pela ideia)
_adicionado texto na tela exibindo o ID do wp ao exibir marcadores com ctrl+M
Outros ajustes:
_suporte para leitura dos arquivos ini (wp) das versoes anteriores
_logica de movimentação entre wp retrabalhada, inserida varias tratatiivas para veiculos e ped nao perderem a rota
_script retrabalhado para melhorar gerenciamento de memoria e exclusão de indices de veiculos despawnados
versão 1.3:
_ os peds agora seguem rotas definidas (creditos ao Bradshaw, JoyLucien e Niziul pelas dicas)
_ corrigido problema dos wp (veiculos e ped) não carregarem a arma e grupo ( agora se modelo for invalido carrega a arma padrão: desarmado)
_ corrigido bug dos wp PED não carregar grupos de modelos de peds
_ os veiculos agora alternan corretamente em ate 3 ids de destino diferentes
_ novos ped wp criados são salvos com velocidade 1. (1= caminhar, 2=correr). Altere no ini para cada wp, ou no config para os proximos wp na nova linha: pedSpeed=1
_ ordem da estrutura atual dos wp salvos no arquivo .ini:
wp id, wp destino id A, wp destino id B, wp destino id C, coordenada X, coordenada Y, coordenada Z, orientação R, nome ou grupo do veiculo, nome ou grupo do ped, velocidade do veiculo ou ped, nome ou grupo da arma do ped, intervalo entre cada spawn (valor em segundos, max 9), tempo que o ped ou veiculo ficara parado nesse wp antes de partir para o proximo wp destino (velor em milissegundos).
_ corrigido varios bugs, mais recursos e outras melhorias estão a camimho :)
versão 1.2 (deletado - muitos bugs):
_adiconada função de ate 3 destino wp id, o script ainda le o .ini antigo. Os novos wp sao criados com 3 id destinos repetidos, e os veiculos irão aleatoriamente pra rotas ids. Altere os ids destinos conforme necessario. (creditos ao @TrueBest pela ideia)
_o script ainda le o .ini antigo, soltei esse update devido ao impacto dessa função na criação dos wp
versão 1.1:
_ otimizado script, revisto funcionamento das rotas e adicionado muitos outros recursos.
_adicionado em .config o modelo veiculo padrão para os proximos wp boost criados
_adicionado o comando Ctrl+H para criar wp de ped (é criado um novo wp no .ini onde a coluna veihiclemodel fica em branco). Por enquanto o Ped spawnado ainda não anda para o próximo wp.
_revisto a logica de criação de wp id, agora o script sempre continua do ultimo id gerado, nao contando mais a partir do numero de linhas nem do arquivo gerado, para nao haver numeros wp id repetidos e causar bugs de rotas.
_adicionada função de grupos de veiculo/ped/armas, apenas mude o nome do modelo para o de algum grupo criado e sera spawnado aleatoriamente os modelos inclusos daquele grupo, o script identifica de maneira dinâmica se o nome é de um modelo ou de um grupo valido. (creditos ao @JoyLucien pela ideia)
_adicionado função de leitura de multiplos arquivos de rota .ini, agora as wp sao salvos no arquivo de nome definido pelo jogador, se o arquivo nao existir o script o criara, os arquivos ini agora ficam dentro da pasta TrafficWaypointAreaMap em scripts (creditos ao @JoyLucien pela ideia)
_corrigido bug do veiculo entrar em modo de piloto automatico enquando o jogador esta dirigindo
_adicionado na pasta scripts os seguintes arquivos de grupos
TrafficWaypointSpawner.pedgroups (grupos de pedestres)
TrafficWaypointSpawner.vehgroups (grupos de veiculos)
TrafficWaypointSpawner.wpngroups (grupos de armas)
-voce pode criar dentro o grupo de nome que desejar seguido do modelid de cada grupo, respeitando a regra de um grupo por linha, nao ah limite de veiculos por grupo, porem muitos modelos carregado pode fazer o jogo fechar. Pode ser alterado o nome no arquivo .config, ou em cada wp gerado no arquivo .ini
OBS: copie o novo arquivo .config que possui as novas configuraões e esta com as distancia de criação de wp mais otimizadas que encontrei
OBS2: se ja tiver criado WPs na versão anterior, basta colocar seu arquivo para dentro da pasta TrafficWaypointAreaMap, e continuar sua criação
versão 1.0:
Fiz esse scrip para suprir a necessidade de dar vida a mapas mods sem ser barrado pelos limites das coordenadas x z y e da quantidade predefinida de nodes das areas de trafficpaths nativos do jogo, alem do trabalho de não precisar ter que editar os arquivos popcycle, popgroup, popzone e zonebind.
Como funciona:
_ O jogador adiciona pontos de rota chamados de wp (waypoint) com as teclas Ctrl+N (velocidade padrão)
_ O jogador pode adicionar tambem pontos de rota wp com as teclas Ctrl+B (velocidade boost) indicado pra rodovias e circuitos
_ Durante o jogo use as teclas Ctrl+C para recarregar os wp do arquivo TrafficWaypointSpawner.ini e as configurações do arquivo TrafficWaypointSpawner.config, caso as edite fora do jogo.
_ Exclua o ultimo waypoint criado com as teclas Ctrl+X, cuidado se houver um veiculo ativo usando esse ultimo wp pode travar o script, sendo necessario reiniciar o jogo.
_ Possibilidade de mostrar ou ocultar as marcações dos wp criados no jogo com as teclas Ctrl+M, usado para auxiliar na edição dos wp.
_ Defina o limite total de veiculos spawnados ao mesmo tempo no game, assim so spawna novos veiculos quando um outro é despawnado, ajuste conforme desempenho do seu PC.
_ Defina a distancia minima e maxima ao jogador que os wp vão spawnar novos veiculos (raio de spawn: deixe o 'spawnMinDistance' de pelo menos '180' e o 'spawnMaxDistance' em pelo menos '190')
_ Distancia que os veiculos vão despawnar, ajuste valores menores caso tenha problema com desempenho mas valor inferior a 200 causa efeito de popups visiveis de veiculos na tela
_ Os veiculos são spawnados no jogo atraves de cada marcador wp enquanto estiverem dentro de uma distancia de spawn minima e maxima da posição atual do jogador.
_ Cada wp criado recebe de forma sequencial um id de registro e outro id de destino
_ O veiculo gerado no 'wp id 1' vai de forma autonoma em direção ao 'wp de destino id 2', e quando chegar no wp id 2 vai para o proximo id destino setado nesse wp que como padrão sera o id 3, e assim por diante.
_ Cada wp adicionado possui regras e configurações individuais e personalizaveis, que fica armazenado no arquivo TrafficWaypointSpawner.ini na seguinte sequencia:
- id do wp, e id do wp destino, pode ser alterado para criação de rotas em looping e circuitos fechados, exemplo podemos alterar no wp 11 o seu wp destino de 12 para wp destino 1, dessa forma sempre que o veiculo chegar ao wp id 11 ele vai se direcionar ao wp destino 1 e refazer toda a rota novamente.
- posição no mapa em valores inteiros x, y, z, e rotação para que o veiculo seja spawnado em certa direção.
- defina o modelo do veiculo a ser gerado em cada wp (suporta mods), deixe em branco se não quiser que seja spawnado veiculo naquele wp. Use para simular trechos de circuito ou diminuir volume de carros (veiculo padrão: adder)
- defina o modelo do ped a ser gerado como piloto do veiculo de em cada wp, usado para inserir ped de policia em viaturas para que então haja rota e perseguição policial (ped padrão: a_m_y_skater_01), deixe em branco para gerar veiculos estacionados sem piloto.
- defina a velocidade do veiculo, com isso o veiculo partira com a velocidade setada ate o proximo wp, velocidade esta em unidade do jogo, sendo padrão 15 (~33km), boost 30 (~100km)
- defina uma arma ao ped a ser gerado no veiculo (arma padrão: WEAPON_PISTOL), deixe em branco pra ped sem arma.
- Intervalo em segundos entre cada spawn de veiculo (padrão 5 segundos para o proximo spwan)
- tempo de espera para o veiculo ficar parado e ir ao proximo wp, valor medido em milissegundos, (padrão 0 ), use isso para simular viaturas em blits, ou mesmo em alguns cruzamentos, opcional.
_ Ao iniciar o jogo com o script ele vai carregar as seguintes configurações padrão do arquivo TrafficWaypointSpawner.config, essas configurações tem impacto tambem nos novos wp a serem criados pelo jogador:
- despawnDistance=200 (distancia inicial de despawn de veiculos)
- spawnMinDistance=180 (distancia minima de spawn de veiculos)
- spawnMaxDistance=190 (distancia maxima de spawn de veiculos)
- maxVehicles=100 (limite de veiculos spawnados ao mesmo tempo, contando os veiculos spawnados por outros meios)
- vehicleSpeed=15 (velocidade padrão do veiculo, aproximadamente 34Km/h)
- boostSpeed=30 (velocidade boost do veiculo, aproximadamente 100Km/h)
- autoSpawnEnabled=true (ativa ou desativa os spawns de veiculos)
- vehicleModel=adder (altere aqui o modelo do veiculo a ser gerado nos novos wp criados)
- pedModel=a_m_y_skater_01 (altere aqui o modelo do ped piloto do veiculo a ser gerado nos novos wp criados)
- logsEnabled=true (ativar ou desativar log de comportamento do mod)
- notificationsEnabled=true (ativar ou desativar as mensagens abaixo durante o game)
- messageWPAdded=traffic Waypoints adicionado! (altere aqui a mensagem quando salvar um wp normal)
- messageWPDeleted=traffic Waypoints excluído! (altere aqui a mensagem quando salvar um wp boost)
- messageConfigReloaded=Configurações e traffic Waypoints recarregados! (altere aqui a mensagem quando recarregar as configurações e wp salvos)
- hotkeyCreate=N (altere aqui o botão pra acionar a função de criar wp padrão)
- hotkeyReload=C (altere aqui o botão pra recarregar as configurações e wp salvos)
- hotkeyDelete=X (altere aqui o botão pra exclusão do ultimo wp criado)
- hotkeyShowMarkers=M (altere aqui o botão pra mostrar ou ocultar as marcações de wp criados no game)
- hotkeyBoost=B (altere aqui o botão pra acionar a função de criar wp boost)
- showMarkers=true (altere aqui se o padrão do game sera mostrar ou ocultar as marcações de wp criados ao iniciar)
- vehicleCheckRadius=10 (Raio de tolerancia para validação de rota de wp, usado para que o veiculo possa considerar como concluida a chegada nesse wp e só então se seguir em direção ao proximo wp.
- minWaypointDistance=10 (Um wp não pode gerar veiculo enquanto um outro veiculo estiver muito proximo a ele (raio padrão de 10 unidades, evita empilhamento de veiculos)
observações importantes:
_ os veiculos gerados por esse script tem comportamento 'wakeup' então eles desviam de obstaculos e outros veiculo e não flutuam pelo chão e só andam se tiver um personagem na pilotagem.
_ a velocidade recomendada para veiculos em cidades e vias tranquilas é de 10 unidade. dessa forma os veiculos tendem a respeitar filas e evitar mais os acidentes
_ em velocidades muito altas superior a 25 unidades, os veiculos tendem a nao usar muito o freio nas curvas
Bugs conhecidos:
- em pontos espeficicos do game os veículos podem simplesmente ignorar o próximo wp e seguir uma direção aleatória, não consegui localizar a causa, comportamento ou padrão pra resolver esse problema.
- se spawnar veículos sem ped, ao entrar em alguns deles eles podem forçar uma pilotagem automática.
Først Lastet opp: 13. mars 2025
Sist Oppdatert: 7 dager siden
Last Downloaded: 1 hour ago
72 Kommentarer
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.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 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',
'wp spawn limit in memory',
'random vehicle tuning (enabled:true or disabled:false)'
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.
- if you spawn vehicles without a ped, when you enter some of them they may force automatic piloting.
---------------------------------- PUT THE FILES IN SCRIPT FOLDER
PT-BR
Com esse script voce finalmente pode criar trafico de veiculos de forma simples e customizavel em qualquer local e ate mesmo em mapas mod. Este script simula apenas trafico de veiculos (e agora pedestres) , possui customização para cada ponto criado alem de configurações de desempenho e comportamento.
versao 1.5:
Script otimizado, redução do consumo de recursos em 90%:
_adicionado configuração de regra geral de pulos de frames do ontick, valor padrão: 'ontickFrameSkip=10'
_adicionado configuração de pulos de frames da exibição dos marcadores quando ativo ( Ctrl+M) valor padrão: 'showmarkersFrameSkip=0' (este valor minimiza o problema de textos dos WP ID ficarem piscantes na tela)
Apos criar muitos WayPoints de spawn em uma area, o script estava consumindo muito recurso a ponto do FPS cair pela metade enquanto o jogador estivesse dentro daquele raio de wp, com essa tratativa no controle de gerenciamento geral do script, o script passa a consumir menos de 10% doque estava a consulmir. Com impacto quase zero sobre as funcionalidades do script.
versao 1.4:
Novos recursos para cada wp:
_adicionada possibilidade do wp spawnar o veiculo com modificações aleatorias (vidros, rodas, pneus, adevisos, motor, buzina, latarias, suspensão etc) de acordo com a biblioteca disponivel de cada veiculo, suporta mods, funciona incrivelmente bem, mas use com moderação pois conseome muita memoria.
_adicionado possibilidade de definir a quantidade de vida do ped a ser spawnado (pedHP padrão 200)
_adicionada animação (opção scenarioTask) para o ped , por enquanto so realiza a animação quando parado, use no wp junto com a coluna 'tempo de espera' com pelo menos 5000 (5 segundos) para que tenha tempo de realizar a animação pelo tempo determinado (opção scenarioTask)
_adicionado arquivo TrafficWaypointSpawner.pedTasks para criação de grupos de task ( funciona igual a função de grupo existente para veiculo/ped/armas)
_adicionado controle de limite de spawm de ped e veiculo por wp (padrão 0 para desativado, consome desempenho quando ativado) use quando quiser setar um spawn de personagem/chefe para nao se multiplicar
_adicionado comando Ctrl+R para criação de wp de rota (wp sem veiculo e ped)
_adicionado comando Ctrl+G para criação de wp de veiculo estacionado (wp com veiculo sem ped)
_nova estrutura do arquivo ini de cada wp gerado:
'wp id',
'wp dest id A',
'wp dest id B',
'wp dest id C'
'posição X','posição Y', 'posição Z', 'direção',
'veiculo nome ou grupo',
'ped nome ou grupo',
'velocidade do veiculo ou ped',
'arma nome ou grupo',
'intervalo (segundos) entre cada spawn',
'tempo de espera (milissegundos) antes de avançar para o proximo wp',
'ped task nome ou grupo',
'pedHP quantidade vida do ped',
'limite de spawn na memoria',
'tunagem aleatoria de veiculos (ativado:true ou desativado:false)'
Novos recursos gerais:
_arquivo config reorganizado e adicionada configurações de novos recursos e outros que estavam ausentes
_adicionado limite geral para quantidade de ped spawnados, com isso um novo ped so é gerado quando outro for despawnado da memoria
_adicionada linha que exibe o caminho entre os wp ao exibir marcadores com ctrl+M (creditos ao @mitto_backup pela ideia)
_adicionado texto na tela exibindo o ID do wp ao exibir marcadores com ctrl+M
Outros ajustes:
_suporte para leitura dos arquivos ini (wp) das versoes anteriores
_logica de movimentação entre wp retrabalhada, inserida varias tratatiivas para veiculos e ped nao perderem a rota
_script retrabalhado para melhorar gerenciamento de memoria e exclusão de indices de veiculos despawnados
versão 1.3:
_ os peds agora seguem rotas definidas (creditos ao Bradshaw, JoyLucien e Niziul pelas dicas)
_ corrigido problema dos wp (veiculos e ped) não carregarem a arma e grupo ( agora se modelo for invalido carrega a arma padrão: desarmado)
_ corrigido bug dos wp PED não carregar grupos de modelos de peds
_ os veiculos agora alternan corretamente em ate 3 ids de destino diferentes
_ novos ped wp criados são salvos com velocidade 1. (1= caminhar, 2=correr). Altere no ini para cada wp, ou no config para os proximos wp na nova linha: pedSpeed=1
_ ordem da estrutura atual dos wp salvos no arquivo .ini:
wp id, wp destino id A, wp destino id B, wp destino id C, coordenada X, coordenada Y, coordenada Z, orientação R, nome ou grupo do veiculo, nome ou grupo do ped, velocidade do veiculo ou ped, nome ou grupo da arma do ped, intervalo entre cada spawn (valor em segundos, max 9), tempo que o ped ou veiculo ficara parado nesse wp antes de partir para o proximo wp destino (velor em milissegundos).
_ corrigido varios bugs, mais recursos e outras melhorias estão a camimho :)
versão 1.2 (deletado - muitos bugs):
_adiconada função de ate 3 destino wp id, o script ainda le o .ini antigo. Os novos wp sao criados com 3 id destinos repetidos, e os veiculos irão aleatoriamente pra rotas ids. Altere os ids destinos conforme necessario. (creditos ao @TrueBest pela ideia)
_o script ainda le o .ini antigo, soltei esse update devido ao impacto dessa função na criação dos wp
versão 1.1:
_ otimizado script, revisto funcionamento das rotas e adicionado muitos outros recursos.
_adicionado em .config o modelo veiculo padrão para os proximos wp boost criados
_adicionado o comando Ctrl+H para criar wp de ped (é criado um novo wp no .ini onde a coluna veihiclemodel fica em branco). Por enquanto o Ped spawnado ainda não anda para o próximo wp.
_revisto a logica de criação de wp id, agora o script sempre continua do ultimo id gerado, nao contando mais a partir do numero de linhas nem do arquivo gerado, para nao haver numeros wp id repetidos e causar bugs de rotas.
_adicionada função de grupos de veiculo/ped/armas, apenas mude o nome do modelo para o de algum grupo criado e sera spawnado aleatoriamente os modelos inclusos daquele grupo, o script identifica de maneira dinâmica se o nome é de um modelo ou de um grupo valido. (creditos ao @JoyLucien pela ideia)
_adicionado função de leitura de multiplos arquivos de rota .ini, agora as wp sao salvos no arquivo de nome definido pelo jogador, se o arquivo nao existir o script o criara, os arquivos ini agora ficam dentro da pasta TrafficWaypointAreaMap em scripts (creditos ao @JoyLucien pela ideia)
_corrigido bug do veiculo entrar em modo de piloto automatico enquando o jogador esta dirigindo
_adicionado na pasta scripts os seguintes arquivos de grupos
TrafficWaypointSpawner.pedgroups (grupos de pedestres)
TrafficWaypointSpawner.vehgroups (grupos de veiculos)
TrafficWaypointSpawner.wpngroups (grupos de armas)
-voce pode criar dentro o grupo de nome que desejar seguido do modelid de cada grupo, respeitando a regra de um grupo por linha, nao ah limite de veiculos por grupo, porem muitos modelos carregado pode fazer o jogo fechar. Pode ser alterado o nome no arquivo .config, ou em cada wp gerado no arquivo .ini
OBS: copie o novo arquivo .config que possui as novas configuraões e esta com as distancia de criação de wp mais otimizadas que encontrei
OBS2: se ja tiver criado WPs na versão anterior, basta colocar seu arquivo para dentro da pasta TrafficWaypointAreaMap, e continuar sua criação
versão 1.0:
Fiz esse scrip para suprir a necessidade de dar vida a mapas mods sem ser barrado pelos limites das coordenadas x z y e da quantidade predefinida de nodes das areas de trafficpaths nativos do jogo, alem do trabalho de não precisar ter que editar os arquivos popcycle, popgroup, popzone e zonebind.
Como funciona:
_ O jogador adiciona pontos de rota chamados de wp (waypoint) com as teclas Ctrl+N (velocidade padrão)
_ O jogador pode adicionar tambem pontos de rota wp com as teclas Ctrl+B (velocidade boost) indicado pra rodovias e circuitos
_ Durante o jogo use as teclas Ctrl+C para recarregar os wp do arquivo TrafficWaypointSpawner.ini e as configurações do arquivo TrafficWaypointSpawner.config, caso as edite fora do jogo.
_ Exclua o ultimo waypoint criado com as teclas Ctrl+X, cuidado se houver um veiculo ativo usando esse ultimo wp pode travar o script, sendo necessario reiniciar o jogo.
_ Possibilidade de mostrar ou ocultar as marcações dos wp criados no jogo com as teclas Ctrl+M, usado para auxiliar na edição dos wp.
_ Defina o limite total de veiculos spawnados ao mesmo tempo no game, assim so spawna novos veiculos quando um outro é despawnado, ajuste conforme desempenho do seu PC.
_ Defina a distancia minima e maxima ao jogador que os wp vão spawnar novos veiculos (raio de spawn: deixe o 'spawnMinDistance' de pelo menos '180' e o 'spawnMaxDistance' em pelo menos '190')
_ Distancia que os veiculos vão despawnar, ajuste valores menores caso tenha problema com desempenho mas valor inferior a 200 causa efeito de popups visiveis de veiculos na tela
_ Os veiculos são spawnados no jogo atraves de cada marcador wp enquanto estiverem dentro de uma distancia de spawn minima e maxima da posição atual do jogador.
_ Cada wp criado recebe de forma sequencial um id de registro e outro id de destino
_ O veiculo gerado no 'wp id 1' vai de forma autonoma em direção ao 'wp de destino id 2', e quando chegar no wp id 2 vai para o proximo id destino setado nesse wp que como padrão sera o id 3, e assim por diante.
_ Cada wp adicionado possui regras e configurações individuais e personalizaveis, que fica armazenado no arquivo TrafficWaypointSpawner.ini na seguinte sequencia:
- id do wp, e id do wp destino, pode ser alterado para criação de rotas em looping e circuitos fechados, exemplo podemos alterar no wp 11 o seu wp destino de 12 para wp destino 1, dessa forma sempre que o veiculo chegar ao wp id 11 ele vai se direcionar ao wp destino 1 e refazer toda a rota novamente.
- posição no mapa em valores inteiros x, y, z, e rotação para que o veiculo seja spawnado em certa direção.
- defina o modelo do veiculo a ser gerado em cada wp (suporta mods), deixe em branco se não quiser que seja spawnado veiculo naquele wp. Use para simular trechos de circuito ou diminuir volume de carros (veiculo padrão: adder)
- defina o modelo do ped a ser gerado como piloto do veiculo de em cada wp, usado para inserir ped de policia em viaturas para que então haja rota e perseguição policial (ped padrão: a_m_y_skater_01), deixe em branco para gerar veiculos estacionados sem piloto.
- defina a velocidade do veiculo, com isso o veiculo partira com a velocidade setada ate o proximo wp, velocidade esta em unidade do jogo, sendo padrão 15 (~33km), boost 30 (~100km)
- defina uma arma ao ped a ser gerado no veiculo (arma padrão: WEAPON_PISTOL), deixe em branco pra ped sem arma.
- Intervalo em segundos entre cada spawn de veiculo (padrão 5 segundos para o proximo spwan)
- tempo de espera para o veiculo ficar parado e ir ao proximo wp, valor medido em milissegundos, (padrão 0 ), use isso para simular viaturas em blits, ou mesmo em alguns cruzamentos, opcional.
_ Ao iniciar o jogo com o script ele vai carregar as seguintes configurações padrão do arquivo TrafficWaypointSpawner.config, essas configurações tem impacto tambem nos novos wp a serem criados pelo jogador:
- despawnDistance=200 (distancia inicial de despawn de veiculos)
- spawnMinDistance=180 (distancia minima de spawn de veiculos)
- spawnMaxDistance=190 (distancia maxima de spawn de veiculos)
- maxVehicles=100 (limite de veiculos spawnados ao mesmo tempo, contando os veiculos spawnados por outros meios)
- vehicleSpeed=15 (velocidade padrão do veiculo, aproximadamente 34Km/h)
- boostSpeed=30 (velocidade boost do veiculo, aproximadamente 100Km/h)
- autoSpawnEnabled=true (ativa ou desativa os spawns de veiculos)
- vehicleModel=adder (altere aqui o modelo do veiculo a ser gerado nos novos wp criados)
- pedModel=a_m_y_skater_01 (altere aqui o modelo do ped piloto do veiculo a ser gerado nos novos wp criados)
- logsEnabled=true (ativar ou desativar log de comportamento do mod)
- notificationsEnabled=true (ativar ou desativar as mensagens abaixo durante o game)
- messageWPAdded=traffic Waypoints adicionado! (altere aqui a mensagem quando salvar um wp normal)
- messageWPDeleted=traffic Waypoints excluído! (altere aqui a mensagem quando salvar um wp boost)
- messageConfigReloaded=Configurações e traffic Waypoints recarregados! (altere aqui a mensagem quando recarregar as configurações e wp salvos)
- hotkeyCreate=N (altere aqui o botão pra acionar a função de criar wp padrão)
- hotkeyReload=C (altere aqui o botão pra recarregar as configurações e wp salvos)
- hotkeyDelete=X (altere aqui o botão pra exclusão do ultimo wp criado)
- hotkeyShowMarkers=M (altere aqui o botão pra mostrar ou ocultar as marcações de wp criados no game)
- hotkeyBoost=B (altere aqui o botão pra acionar a função de criar wp boost)
- showMarkers=true (altere aqui se o padrão do game sera mostrar ou ocultar as marcações de wp criados ao iniciar)
- vehicleCheckRadius=10 (Raio de tolerancia para validação de rota de wp, usado para que o veiculo possa considerar como concluida a chegada nesse wp e só então se seguir em direção ao proximo wp.
- minWaypointDistance=10 (Um wp não pode gerar veiculo enquanto um outro veiculo estiver muito proximo a ele (raio padrão de 10 unidades, evita empilhamento de veiculos)
observações importantes:
_ os veiculos gerados por esse script tem comportamento 'wakeup' então eles desviam de obstaculos e outros veiculo e não flutuam pelo chão e só andam se tiver um personagem na pilotagem.
_ a velocidade recomendada para veiculos em cidades e vias tranquilas é de 10 unidade. dessa forma os veiculos tendem a respeitar filas e evitar mais os acidentes
_ em velocidades muito altas superior a 25 unidades, os veiculos tendem a nao usar muito o freio nas curvas
Bugs conhecidos:
- em pontos espeficicos do game os veículos podem simplesmente ignorar o próximo wp e seguir uma direção aleatória, não consegui localizar a causa, comportamento ou padrão pra resolver esse problema.
- se spawnar veículos sem ped, ao entrar em alguns deles eles podem forçar uma pilotagem automática.
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 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',
'wp spawn limit in memory',
'random vehicle tuning (enabled:true or disabled:false)'
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.
- if you spawn vehicles without a ped, when you enter some of them they may force automatic piloting.
---------------------------------- PUT THE FILES IN SCRIPT FOLDER
PT-BR
Com esse script voce finalmente pode criar trafico de veiculos de forma simples e customizavel em qualquer local e ate mesmo em mapas mod. Este script simula apenas trafico de veiculos (e agora pedestres) , possui customização para cada ponto criado alem de configurações de desempenho e comportamento.
versao 1.5:
Script otimizado, redução do consumo de recursos em 90%:
_adicionado configuração de regra geral de pulos de frames do ontick, valor padrão: 'ontickFrameSkip=10'
_adicionado configuração de pulos de frames da exibição dos marcadores quando ativo ( Ctrl+M) valor padrão: 'showmarkersFrameSkip=0' (este valor minimiza o problema de textos dos WP ID ficarem piscantes na tela)
Apos criar muitos WayPoints de spawn em uma area, o script estava consumindo muito recurso a ponto do FPS cair pela metade enquanto o jogador estivesse dentro daquele raio de wp, com essa tratativa no controle de gerenciamento geral do script, o script passa a consumir menos de 10% doque estava a consulmir. Com impacto quase zero sobre as funcionalidades do script.
versao 1.4:
Novos recursos para cada wp:
_adicionada possibilidade do wp spawnar o veiculo com modificações aleatorias (vidros, rodas, pneus, adevisos, motor, buzina, latarias, suspensão etc) de acordo com a biblioteca disponivel de cada veiculo, suporta mods, funciona incrivelmente bem, mas use com moderação pois conseome muita memoria.
_adicionado possibilidade de definir a quantidade de vida do ped a ser spawnado (pedHP padrão 200)
_adicionada animação (opção scenarioTask) para o ped , por enquanto so realiza a animação quando parado, use no wp junto com a coluna 'tempo de espera' com pelo menos 5000 (5 segundos) para que tenha tempo de realizar a animação pelo tempo determinado (opção scenarioTask)
_adicionado arquivo TrafficWaypointSpawner.pedTasks para criação de grupos de task ( funciona igual a função de grupo existente para veiculo/ped/armas)
_adicionado controle de limite de spawm de ped e veiculo por wp (padrão 0 para desativado, consome desempenho quando ativado) use quando quiser setar um spawn de personagem/chefe para nao se multiplicar
_adicionado comando Ctrl+R para criação de wp de rota (wp sem veiculo e ped)
_adicionado comando Ctrl+G para criação de wp de veiculo estacionado (wp com veiculo sem ped)
_nova estrutura do arquivo ini de cada wp gerado:
'wp id',
'wp dest id A',
'wp dest id B',
'wp dest id C'
'posição X','posição Y', 'posição Z', 'direção',
'veiculo nome ou grupo',
'ped nome ou grupo',
'velocidade do veiculo ou ped',
'arma nome ou grupo',
'intervalo (segundos) entre cada spawn',
'tempo de espera (milissegundos) antes de avançar para o proximo wp',
'ped task nome ou grupo',
'pedHP quantidade vida do ped',
'limite de spawn na memoria',
'tunagem aleatoria de veiculos (ativado:true ou desativado:false)'
Novos recursos gerais:
_arquivo config reorganizado e adicionada configurações de novos recursos e outros que estavam ausentes
_adicionado limite geral para quantidade de ped spawnados, com isso um novo ped so é gerado quando outro for despawnado da memoria
_adicionada linha que exibe o caminho entre os wp ao exibir marcadores com ctrl+M (creditos ao @mitto_backup pela ideia)
_adicionado texto na tela exibindo o ID do wp ao exibir marcadores com ctrl+M
Outros ajustes:
_suporte para leitura dos arquivos ini (wp) das versoes anteriores
_logica de movimentação entre wp retrabalhada, inserida varias tratatiivas para veiculos e ped nao perderem a rota
_script retrabalhado para melhorar gerenciamento de memoria e exclusão de indices de veiculos despawnados
versão 1.3:
_ os peds agora seguem rotas definidas (creditos ao Bradshaw, JoyLucien e Niziul pelas dicas)
_ corrigido problema dos wp (veiculos e ped) não carregarem a arma e grupo ( agora se modelo for invalido carrega a arma padrão: desarmado)
_ corrigido bug dos wp PED não carregar grupos de modelos de peds
_ os veiculos agora alternan corretamente em ate 3 ids de destino diferentes
_ novos ped wp criados são salvos com velocidade 1. (1= caminhar, 2=correr). Altere no ini para cada wp, ou no config para os proximos wp na nova linha: pedSpeed=1
_ ordem da estrutura atual dos wp salvos no arquivo .ini:
wp id, wp destino id A, wp destino id B, wp destino id C, coordenada X, coordenada Y, coordenada Z, orientação R, nome ou grupo do veiculo, nome ou grupo do ped, velocidade do veiculo ou ped, nome ou grupo da arma do ped, intervalo entre cada spawn (valor em segundos, max 9), tempo que o ped ou veiculo ficara parado nesse wp antes de partir para o proximo wp destino (velor em milissegundos).
_ corrigido varios bugs, mais recursos e outras melhorias estão a camimho :)
versão 1.2 (deletado - muitos bugs):
_adiconada função de ate 3 destino wp id, o script ainda le o .ini antigo. Os novos wp sao criados com 3 id destinos repetidos, e os veiculos irão aleatoriamente pra rotas ids. Altere os ids destinos conforme necessario. (creditos ao @TrueBest pela ideia)
_o script ainda le o .ini antigo, soltei esse update devido ao impacto dessa função na criação dos wp
versão 1.1:
_ otimizado script, revisto funcionamento das rotas e adicionado muitos outros recursos.
_adicionado em .config o modelo veiculo padrão para os proximos wp boost criados
_adicionado o comando Ctrl+H para criar wp de ped (é criado um novo wp no .ini onde a coluna veihiclemodel fica em branco). Por enquanto o Ped spawnado ainda não anda para o próximo wp.
_revisto a logica de criação de wp id, agora o script sempre continua do ultimo id gerado, nao contando mais a partir do numero de linhas nem do arquivo gerado, para nao haver numeros wp id repetidos e causar bugs de rotas.
_adicionada função de grupos de veiculo/ped/armas, apenas mude o nome do modelo para o de algum grupo criado e sera spawnado aleatoriamente os modelos inclusos daquele grupo, o script identifica de maneira dinâmica se o nome é de um modelo ou de um grupo valido. (creditos ao @JoyLucien pela ideia)
_adicionado função de leitura de multiplos arquivos de rota .ini, agora as wp sao salvos no arquivo de nome definido pelo jogador, se o arquivo nao existir o script o criara, os arquivos ini agora ficam dentro da pasta TrafficWaypointAreaMap em scripts (creditos ao @JoyLucien pela ideia)
_corrigido bug do veiculo entrar em modo de piloto automatico enquando o jogador esta dirigindo
_adicionado na pasta scripts os seguintes arquivos de grupos
TrafficWaypointSpawner.pedgroups (grupos de pedestres)
TrafficWaypointSpawner.vehgroups (grupos de veiculos)
TrafficWaypointSpawner.wpngroups (grupos de armas)
-voce pode criar dentro o grupo de nome que desejar seguido do modelid de cada grupo, respeitando a regra de um grupo por linha, nao ah limite de veiculos por grupo, porem muitos modelos carregado pode fazer o jogo fechar. Pode ser alterado o nome no arquivo .config, ou em cada wp gerado no arquivo .ini
OBS: copie o novo arquivo .config que possui as novas configuraões e esta com as distancia de criação de wp mais otimizadas que encontrei
OBS2: se ja tiver criado WPs na versão anterior, basta colocar seu arquivo para dentro da pasta TrafficWaypointAreaMap, e continuar sua criação
versão 1.0:
Fiz esse scrip para suprir a necessidade de dar vida a mapas mods sem ser barrado pelos limites das coordenadas x z y e da quantidade predefinida de nodes das areas de trafficpaths nativos do jogo, alem do trabalho de não precisar ter que editar os arquivos popcycle, popgroup, popzone e zonebind.
Como funciona:
_ O jogador adiciona pontos de rota chamados de wp (waypoint) com as teclas Ctrl+N (velocidade padrão)
_ O jogador pode adicionar tambem pontos de rota wp com as teclas Ctrl+B (velocidade boost) indicado pra rodovias e circuitos
_ Durante o jogo use as teclas Ctrl+C para recarregar os wp do arquivo TrafficWaypointSpawner.ini e as configurações do arquivo TrafficWaypointSpawner.config, caso as edite fora do jogo.
_ Exclua o ultimo waypoint criado com as teclas Ctrl+X, cuidado se houver um veiculo ativo usando esse ultimo wp pode travar o script, sendo necessario reiniciar o jogo.
_ Possibilidade de mostrar ou ocultar as marcações dos wp criados no jogo com as teclas Ctrl+M, usado para auxiliar na edição dos wp.
_ Defina o limite total de veiculos spawnados ao mesmo tempo no game, assim so spawna novos veiculos quando um outro é despawnado, ajuste conforme desempenho do seu PC.
_ Defina a distancia minima e maxima ao jogador que os wp vão spawnar novos veiculos (raio de spawn: deixe o 'spawnMinDistance' de pelo menos '180' e o 'spawnMaxDistance' em pelo menos '190')
_ Distancia que os veiculos vão despawnar, ajuste valores menores caso tenha problema com desempenho mas valor inferior a 200 causa efeito de popups visiveis de veiculos na tela
_ Os veiculos são spawnados no jogo atraves de cada marcador wp enquanto estiverem dentro de uma distancia de spawn minima e maxima da posição atual do jogador.
_ Cada wp criado recebe de forma sequencial um id de registro e outro id de destino
_ O veiculo gerado no 'wp id 1' vai de forma autonoma em direção ao 'wp de destino id 2', e quando chegar no wp id 2 vai para o proximo id destino setado nesse wp que como padrão sera o id 3, e assim por diante.
_ Cada wp adicionado possui regras e configurações individuais e personalizaveis, que fica armazenado no arquivo TrafficWaypointSpawner.ini na seguinte sequencia:
- id do wp, e id do wp destino, pode ser alterado para criação de rotas em looping e circuitos fechados, exemplo podemos alterar no wp 11 o seu wp destino de 12 para wp destino 1, dessa forma sempre que o veiculo chegar ao wp id 11 ele vai se direcionar ao wp destino 1 e refazer toda a rota novamente.
- posição no mapa em valores inteiros x, y, z, e rotação para que o veiculo seja spawnado em certa direção.
- defina o modelo do veiculo a ser gerado em cada wp (suporta mods), deixe em branco se não quiser que seja spawnado veiculo naquele wp. Use para simular trechos de circuito ou diminuir volume de carros (veiculo padrão: adder)
- defina o modelo do ped a ser gerado como piloto do veiculo de em cada wp, usado para inserir ped de policia em viaturas para que então haja rota e perseguição policial (ped padrão: a_m_y_skater_01), deixe em branco para gerar veiculos estacionados sem piloto.
- defina a velocidade do veiculo, com isso o veiculo partira com a velocidade setada ate o proximo wp, velocidade esta em unidade do jogo, sendo padrão 15 (~33km), boost 30 (~100km)
- defina uma arma ao ped a ser gerado no veiculo (arma padrão: WEAPON_PISTOL), deixe em branco pra ped sem arma.
- Intervalo em segundos entre cada spawn de veiculo (padrão 5 segundos para o proximo spwan)
- tempo de espera para o veiculo ficar parado e ir ao proximo wp, valor medido em milissegundos, (padrão 0 ), use isso para simular viaturas em blits, ou mesmo em alguns cruzamentos, opcional.
_ Ao iniciar o jogo com o script ele vai carregar as seguintes configurações padrão do arquivo TrafficWaypointSpawner.config, essas configurações tem impacto tambem nos novos wp a serem criados pelo jogador:
- despawnDistance=200 (distancia inicial de despawn de veiculos)
- spawnMinDistance=180 (distancia minima de spawn de veiculos)
- spawnMaxDistance=190 (distancia maxima de spawn de veiculos)
- maxVehicles=100 (limite de veiculos spawnados ao mesmo tempo, contando os veiculos spawnados por outros meios)
- vehicleSpeed=15 (velocidade padrão do veiculo, aproximadamente 34Km/h)
- boostSpeed=30 (velocidade boost do veiculo, aproximadamente 100Km/h)
- autoSpawnEnabled=true (ativa ou desativa os spawns de veiculos)
- vehicleModel=adder (altere aqui o modelo do veiculo a ser gerado nos novos wp criados)
- pedModel=a_m_y_skater_01 (altere aqui o modelo do ped piloto do veiculo a ser gerado nos novos wp criados)
- logsEnabled=true (ativar ou desativar log de comportamento do mod)
- notificationsEnabled=true (ativar ou desativar as mensagens abaixo durante o game)
- messageWPAdded=traffic Waypoints adicionado! (altere aqui a mensagem quando salvar um wp normal)
- messageWPDeleted=traffic Waypoints excluído! (altere aqui a mensagem quando salvar um wp boost)
- messageConfigReloaded=Configurações e traffic Waypoints recarregados! (altere aqui a mensagem quando recarregar as configurações e wp salvos)
- hotkeyCreate=N (altere aqui o botão pra acionar a função de criar wp padrão)
- hotkeyReload=C (altere aqui o botão pra recarregar as configurações e wp salvos)
- hotkeyDelete=X (altere aqui o botão pra exclusão do ultimo wp criado)
- hotkeyShowMarkers=M (altere aqui o botão pra mostrar ou ocultar as marcações de wp criados no game)
- hotkeyBoost=B (altere aqui o botão pra acionar a função de criar wp boost)
- showMarkers=true (altere aqui se o padrão do game sera mostrar ou ocultar as marcações de wp criados ao iniciar)
- vehicleCheckRadius=10 (Raio de tolerancia para validação de rota de wp, usado para que o veiculo possa considerar como concluida a chegada nesse wp e só então se seguir em direção ao proximo wp.
- minWaypointDistance=10 (Um wp não pode gerar veiculo enquanto um outro veiculo estiver muito proximo a ele (raio padrão de 10 unidades, evita empilhamento de veiculos)
observações importantes:
_ os veiculos gerados por esse script tem comportamento 'wakeup' então eles desviam de obstaculos e outros veiculo e não flutuam pelo chão e só andam se tiver um personagem na pilotagem.
_ a velocidade recomendada para veiculos em cidades e vias tranquilas é de 10 unidade. dessa forma os veiculos tendem a respeitar filas e evitar mais os acidentes
_ em velocidades muito altas superior a 25 unidades, os veiculos tendem a nao usar muito o freio nas curvas
Bugs conhecidos:
- em pontos espeficicos do game os veículos podem simplesmente ignorar o próximo wp e seguir uma direção aleatória, não consegui localizar a causa, comportamento ou padrão pra resolver esse problema.
- se spawnar veículos sem ped, ao entrar em alguns deles eles podem forçar uma pilotagem automática.
Først Lastet opp: 13. mars 2025
Sist Oppdatert: 7 dager siden
Last Downloaded: 1 hour ago
I tried to spawn a ped the ped stop at waypoint but maybe with the task WanderAround or TaskWanderInArea and to change the position and put print(GetIsTaskActive(ped, 222)) -- 1
@Bradshaw Thank you! Your tip was essential for me to understand and finalize this logic.
@totolike Thanks for the support! Yes, I will, I have a lot of things in testing at the moment :)
@corruptdice I fixed this in version 1.3 :)
An option can be added. When it is turned on, a line connection is added between points, so it is clearer to see. When it is turned off, the display line is turned off. Because too many lines seem to affect performance.
So great! Could you also add option to spawn (set always or random) just parked cars (one point for one car), hotkey Ctrl+P for example. Also maybe sometime random cars joining the traffic nodes from parking? :)
awesome update! new ped spawner works great!
What could be the problem if everything is installed and the script is hooked, but it still doesn't work?
@DDM take a look at the scriphookdotnet log in the GTAV folder after the game loads, there will be a line about an error loading the trafficwaypointspawner script
@darewnoo Thanks for the idea, I'll think of some solutions to make this logic work more smoothly in the next updates. For now, to make cars park in certain WPs, you can use:
_vehicles spawned without a ped remain stationary, leave the ped model line blank in the ini file
_destination id a b c equal to the origin WP id in the ini file
Now, for cars to park in a WP, you can define a time interval of, for example, 60000 (60seconds) in the last column of that WP saved in the ini file.
@JoyLucien good idea, I'll try to implement this with floating text indicating the wp id of that tag, all together with the current function of showing/hiding tags with ctrl+M
@mitto_backup Thanks! I'm glad you liked it :) This script is very flexible, there are so many instructions that I think I'll make a video explaining more of its current possibilities, such as:
_if you leave a wp without a vehicle model and ped (in the ini file) it won't spawn anything there, it will only serve as a route, good for use in circuits or to avoid traffic jams in tighter places like parking lots
_using the logic above with waiting time (last column of the wp in the ini file) you can create a starting grid full of vehicles to race together on a circuit or even on a drag race straight
in the next update I'll upload documentation about the features and settings
hey man some traffic falling through the map, any idea why? Is this caused by having too much traffic? @schio84dude
hey man for next update can we have some peds on phones etc while walking?
@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.