1. Thread posting restricted: Only the BeamNG team members can post new threads in this sub-forum in order to prevent spam. New: Feel free to reply and comment :)

AI - work

Discussion in 'Microblogs' started by tdev, May 24, 2018.

  1. RyvyLo

    RyvyLo
    Expand Collapse
    Staff Member

    Joined:
    May 15, 2014
    Messages:
    404
    You can use the new ai code, you can see a working example in the Road Atlanta scenarios (overtaking challenge for example). The trick to make sure it can find the waypoints is to use the decalRoad waypoints instead of the scenario waypoints. You can find their name in the AI control app, with the debug mode map set as NaviGraph
     
  2. HighDef

    HighDef
    Expand Collapse

    Joined:
    Aug 4, 2013
    Messages:
    476
    Oooo, that is a very interesting idea. So I type them the same as scenario waypoints but with the names of the decalroad node names?
     
  3. RyvyLo

    RyvyLo
    Expand Collapse
    Staff Member

    Joined:
    May 15, 2014
    Messages:
    404
    In the .json, you keep the waypoints name, but in the .lua you type in a list of decalRoad node names that follow the same path as the waypoint names. The onRaceStart function in the lua code would look like this :
    Code:
    local function onRaceStart()
      --log('I', logTag,'onRaceStart called')
      reset()
    
      local arg1 = {vehicleName = aiInstance1,
                  waypoints = {'AI_Path56','AI_Path64','AI_Path93','AI_Path109', 'AI_Path3','AI_Path56'},
                  }
      helper.setAiPath(arg1)
    end
     
    • Informative Informative x 2
    • Like Like x 1
  4. audi4141

    audi4141
    Expand Collapse

    Joined:
    May 13, 2017
    Messages:
    323
    this is exciting for me,it will give a whole new level of experience to beam ng.
    Me likey alot.;-)
     
  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