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.

Way to script AI in 0.24

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by AydenMitman, Apr 24, 2022.

  1. AydenMitman

    AydenMitman
    Expand Collapse

    Joined:
    Mar 28, 2022
    Messages:
    2
    For quite a while now I've been trying to have AI races. Using 'Flee' and 'Chase' doesn't really work too well for racing because the AI will either go somewhere random to flee you or they will crash into you. After research on how to script AI I've found that most tutorials are out of date and say that you need to press F10 which does nothing. Some more recent ones say you need to find the tools tab in the F11 world editor. The tools tab no longer exists and the only way I've been able to script AI is by finding nodes and using the console by pressing tilde/ grave (`). The problem with this is that not all tracks have nodes where you want them to be and I have to manually write out code for the AI to follow rather than just driving the route I want the AI to follow.

    Example:
    ai.driveUsingPath{wpTargetList ={'hr_start','quickrace_wp1','quickrace_wp5','quickrace_wp3','quickrace_wp4','quickrace_wp11','hr_start',}, noOfLaps = 30, aggression = 2.6}

    This takes quite a lot of time and doesn't work for everything. Wondering if anyone has some information on this topic or if someone has a new strategy.
     
  2. Gamergull

    Gamergull
    Expand Collapse
    BeamNG Team

    Joined:
    Jun 3, 2018
    Messages:
    460
    Ah, this is the curse of us updating things that make tutorials obsolete. The Script AI tool is still in the F11 menu, but "Tools" got renamed to "Windows" (So it's Windows > Gameplay > Script AI Manager). The Script AI UI itself hasn't changed for a long time, so even older video tutorials that I know of are still pretty much accurate.
     
    • Agree Agree x 1
  3. AydenMitman

    AydenMitman
    Expand Collapse

    Joined:
    Mar 28, 2022
    Messages:
    2
    Thanks so much for the support. Scripting AI now is as simple as driving the line you want the AI to follow. I knew writing a code mustn't have been the only way. Anyway, thanks for the reply.
     
  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