Help with scenario AI

Discussion in 'Content Creation' started by The Gas Station, Aug 29, 2016.

  1. The Gas Station

    The Gas Station
    Expand Collapse

    Joined:
    Jul 14, 2016
    Messages:
    272
    Hello everyone!
    I am trying to make a scenario with AI, but the documentation, as we all know, is lacking. Since I don't know Lua at all, reading and adapting files like the airport drag-race scenario is pretty useless.

    What I want to know is how to set AI cars to behave like in the AI app, but only using the scenario files. For example- to make a AI car chase the player, chase another car, or follow a predefined route.

    I also want to know if it's possible to set an AI car in such a way, that when it reaches a checkpoint, the scenario fails- That way one can make a race scenario very easily.
     
  2. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,683
    With .lua pretty much ^.^

    It's not that hard to set up AI, if you use the existing .lua file that we use in some scenarios.
    What do you want to do exactly? Make the AI drive along a path? Make it flee?

    Yes. In the intersection scenarios we do that.
     
    • Like Like x 1
  3. The Gas Station

    The Gas Station
    Expand Collapse

    Joined:
    Jul 14, 2016
    Messages:
    272
    @Nadeox1 Thanks for the response. I want to know how to set up an AI follow a path, and how to set an AI to chase the player (or another AI car).


    Re-using the official .lua files was what I was trying to do so far, and it didn't really work. I upload to this post an example of that. The lua file I upload is based on the JRI airport drag-race .lua. The idea is basically the same as the official drag-race, only you should race 3 opponents, on a flat road w/o bumps.
    The problem I witness is the scenario can't even be opened in-game. So I assume the .lua file I made is broken. If you can help me and take a look at the file, and try to locate the problem, I'll really appreciate it. The file has comments on the different stuff I edited, to make it simpler for you.
     

    Attached Files:

  4. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    #4 torsion, Sep 3, 2016
    Last edited: Sep 3, 2016
    • Like Like x 1
  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