Се вчитува...

Simple Traffic Creator 1.0

73

I’ve been working on this script for months, it’s something I’ve wanted in the game for a long time. It’s open for general editing, just don’t forget to credit me if you do :)

STC - Simple Traffic Creator version 1.0:

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 traffic, has customization for each point created in addition to performance and behavior settings.

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

A meses venho trabalhando neste script, era algo que queria ter no game a muito tempo, esta aberto pra edição geral, não esquece de me creditar caso o faça :)

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, possui customização para cada ponto criado alem de configurações de desempenho e comportamento.

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.
Show Full Description

Првпат Додадено: пред 12 саати
Последно Ажурирање: пред 12 саати
Последно Симнување: пред 11 минути

All Versions

 1.0 (current)

73 симнато , 6 KB
пред 12 саати

5 Коментари