1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.35 Bug Reporting thread
    Solutions and more information may already be available.

is there any way to set specific colors for traffic?

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by Nazu, Apr 27, 2022.

  1. Nazu

    Nazu
    Expand Collapse

    Joined:
    Dec 22, 2021
    Messages:
    1,342
    i wanna make it so its not random colors but instead a few specific ones, is this possible in any way?
     
  2. Duh anime addict

    Duh anime addict
    Expand Collapse

    Joined:
    Aug 5, 2021
    Messages:
    1,230
    change the code
     
  3. Nazu

    Nazu
    Expand Collapse

    Joined:
    Dec 22, 2021
    Messages:
    1,342
    im not a coding nerd though :p
     
  4. Duh anime addict

    Duh anime addict
    Expand Collapse

    Joined:
    Aug 5, 2021
    Messages:
    1,230
    ask @angelo234
     
  5. Gamergull

    Gamergull
    Expand Collapse
    BeamNG Team

    Joined:
    Jun 3, 2018
    Messages:
    460
    Indeed, there is a way! While traffic is running, open the console with tilde (~) and enter this in:
    Code:
    for k, v in pairs(gameplay_traffic.getTrafficData()) do v.paintKeys = {"Pearl White", "Jet Black"} end
    The colors work as paint names, so if the vehicle doesn't have it, it might not work.

    Here is another example that gets all red colors and checks for them (make sure that traffic is fresh, though):
    Code:
    for k, v in pairs(gameplay_traffic.getTrafficData()) do
      local new = {}
      for _, p in ipairs(v.paintKeys) do
        if string.find(string.lower(p), "red") then
          table.insert(new, p)
        end
      end
      v.paintKeys = new
    end
     
    • Like Like x 2
  6. EthanG3353

    EthanG3353
    Expand Collapse

    Joined:
    Mar 14, 2019
    Messages:
    16
    An easy way is to spawn all cars you want and then to start the traffic mode. This will keep the cars you selected for ai. (Not sure if this is just for ai setting or also traffic)
     
  7. Nazu

    Nazu
    Expand Collapse

    Joined:
    Dec 22, 2021
    Messages:
    1,342
    alright thanks! will definetly use when im at my pc
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice