Solved run lau command on reaching checkpoint

Discussion in 'Mod Support' started by sketchy_b, Jul 28, 2016.

  1. sketchy_b

    sketchy_b
    Expand Collapse

    Joined:
    Apr 13, 2014
    Messages:
    62
    Is there any way to initiate a lau command on reaching a checkpoint?
     
  2. RyvyLo

    RyvyLo
    Expand Collapse

    Joined:
    May 15, 2014
    Messages:
    438
    I don't know what is a lau command, there is only Lua commands. I answered to the same question yesterday here, here's the Lua code :

    Code:
    local function onRaceWaypoint(data, goal)
      
        if data.waypointName == 'yourWaypointNameHere' then
            theEvent()
        end
      
    end
    
    return {
        onRaceWaypoint = onRaceWaypoint,
    }
     
  3. sketchy_b

    sketchy_b
    Expand Collapse

    Joined:
    Apr 13, 2014
    Messages:
    62
    Ok thanks for that, I was hoping for a way to do it trough the new scenario creation method that uses the scenario.json method as after the update my scenario.lua scripts were not working properly. any ideas if its possible that way? did you have any issues after the latest update with your scripts not working?
     
  4. meywue

    meywue
    Expand Collapse
    BeamNG Team

    Joined:
    Nov 19, 2015
    Messages:
    346
    For now it's not possible to call Lua methods at the very same time you pass a checkpoint via the json file.
     
  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