[solved] Making mod vehicles/custom configs behave like police cars?

Discussion in 'Content Creation' started by RY4NDY, Jan 28, 2023.

  1. RY4NDY

    RY4NDY
    Expand Collapse

    Joined:
    Oct 7, 2016
    Messages:
    41
    While doing some .jbeam edits to an Automation car I made I found out how to make the siren/lights on the police version actually work.
    I then decided that it'd be nice if it would also actually behave like a police car if spawned in AI traffic (I mean that it chases after you if you're speeding or otherwise breaking the law, just like vanilla police cars do).

    I'm pretty sure that some time ago it just had to have Police in the config name, and "Config Type":"Police", in the info.json file for it to behave like a police car in traffic; but it seems like that no longer works since I've changed both of these things and it still just behaves like a "normal" traffic car.

    Have the requirements for a car to behave like a police car been changed?
    And if so, what does it need to have to behave like a police car now?
     
    #1 RY4NDY, Jan 28, 2023
    Last edited: Jan 29, 2023
  2. RY4NDY

    RY4NDY
    Expand Collapse

    Joined:
    Oct 7, 2016
    Messages:
    41
    Nevermind, I figured it out:

    For some reason it doesn't work if the default configuration (which was in this case the only configuration, since it's an Automation car) has "Config Type":"Police" in it's info.json file, it needs to be a non-default config apparently.

    After I made a new .pc config that's exactly the same and gave that config an info.json file with the same stuff in it, it DOES behave as a police car.
     
    #2 RY4NDY, Jan 29, 2023
    Last edited: Feb 3, 2023
    • Like Like x 2
  3. palden_!

    palden_!
    Expand Collapse

    Joined:
    Mar 11, 2024
    Messages:
    2
    im sorry, i might be late to this but what do you mean by "exactly the same and gave that config an info.json file", i mean how do you give a .PC file an info.json file?
     
  4. RY4NDY

    RY4NDY
    Expand Collapse

    Joined:
    Oct 7, 2016
    Messages:
    41
    It's very simple; if you put a .json file with the correct name in the same location as the config's .pc file is, it'll match that info to the config in the vehicle selector.

    For example, say you have a config saved in AppData\Local\BeamNG.drive\0.31\vehicles\pigeon called MyExampleConfig.pc. Normally that folder only contains the .pc file that specifies the config itself, and a .jpg image of the same name if you ticked the "generate thumbnail on save" checkbox when you made the config in-game for the vehicle selector thumbnail.
    If you then add a .json file containing information to the same folder and name it info_MyExampleConfig.json, the game will display any info it gets from that file in the vehicle selector, such as the config's name, description, or performance information.

    Note that of course wherever I've written "MyExampleConfig" should just be whatever your vehicle/configuration's name is. Also check out the .zip file I've attached showing an example of a very simple mod containing a config, a vehicle selector thumbnail, and an info file.
     

    Attached Files:

  5. elflery_

    elflery_
    Expand Collapse

    Joined:
    Nov 27, 2024
    Messages:
    2
    Hey, I'm a bit late to this, posting it in November.

    I'm completely stupid in how you even change a custom vehicle to a police car that can actually interact with AI when it's spawned in. I made my own custom car by changing the lightbar, livery, engine, and some other stuff from spawning in a police car that actually works with AI. Pretty much, my whole reply is that I'm dumb and I'm not a scripter or anything, and I don't know where to start to make this custom car I made actually work.

    Can you tell me where in the files should I look for it? Would appreciate it.
     
  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