VE Lua Documentation

Press F to search!

onGameplayEvent

Definition


-- @/lua/vehicle/controller.lua:200

local function onGameplayEvent(eventName, ...)
  for i = 1, gameplayEventCount, 1 do
    gameplayEvents[i](eventName, ...)
  end
end

Callers

@/lua/vehicle/controller/braking/transbrake.lua

--example: onGameplayEvent("controller:transbrake", "setTransbrake", true)
--example: onGameplayEvent("controller:myTransbrakeName", "setTransbrake", false)
--example: onGameplayEvent("controller:transbrake", "setTransbrake", true)
--example: onGameplayEvent("controller:myTransbrakeName", "setTransbrake", false)
local function onGameplayEvent(event, eventData)
--example: onGameplayEvent("controller:myTransbrakeName", "setTransbrake", false)
local function onGameplayEvent(event, eventData)
  local splits = split(event, ":")
@/lua/vehicle/controller.lua
      if controller.onGameplayEvent ~= nil then
        print("  sortedControllers[" .. i .. "].onGameplayEvent(eventName, ...) -- " .. tostring(controller.typeName))
      end
@/lua/ge/extensions/freeroam/dragRace.lua
  opponentVehicle:queueLuaCommand('ai.setAggression('.. 0 ..')')
  opponentVehicle:queLuaComuemand('controller.onGameplayEvent("freeroam_dragRace", "AI_prestage")') --moded controller support
  opponentPrestageReady = true
  opponentVehicle:queueLuaCommand('ai.setAvoidCars("on")')
  opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_stage")') --moded controller support
  opponentVehicle:queueLuaCommand('ai.setSpeed(nil)')
  opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_setupStart")') --moded controller support
  log("D","setupStart", "setSpeed = NIL" )
  end]])
  opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_start")') --moded controller support
end
  end]])
  opponentVehicle:queueLuaCommand('controller.onGameplayEvent("freeroam_dragRace", "AI_stop")') --moded controller support
  opponentVehicle:queueLuaCommand('ai.setAvoidCars("on")')
@/lua/vehicle/controller/controllerTemplate.lua

-- local function onGameplayEvent(eventName, ...)
-- end
@/lua/vehicle/extensions/gameplayInterfaceModules/interactController.lua
  local eventParams = {unpack(params, 2)}
  controller.onGameplayEvent(eventName, eventParams)
end
@/lua/ge/extensions/flowgraph/modules/vehicleModule.lua
  if veh then
 --   veh:queueLuaCommand("controller.onGameplayEvent('bus_onTriggerTick',{id = "..id.."})")
  end
  if veh then
    veh:queueLuaCommand("controller.onGameplayEvent('bus_onRouteChange'," .. serialize(data) .. ")")
  end
  if veh then
    veh:queueLuaCommand("controller.onGameplayEvent('bus_onSetStopRequest'," .. serialize(data) .. ")")
  end
@/lua/ge/extensions/core/busRouteManager.lua
    if veh then
      veh:queueLuaCommand("controller.onGameplayEvent('"..cmd.."',"..serialize(arg)..")")
    else
@/lua/vehicle/controller/advancedCouplerControl.lua

local function onGameplayEvent(eventName, ...)
end
@/ui/modules/apps/busLine/app.js
      $scope.updateDisplay = function() {
        bngApi.activeObjectLua(`controller.onGameplayEvent("onRouteChange", ${bngApi.serializeToLua($scope.route)})`)
      }