Command Cheat Sheet[EN]

4.Command for debug(draft)

TIPS for debugging table type.

# table of contents
for k, v in pairs(table01) do print(k) print(v) end

# table length

Vehicles information

# Player Vehicle
tbl1 = core_vehicle_manager.getPlayerVehicleData()

# Other Vehicle
tbl1 = core_vehicle_manager.getVehicleData(vid)

# list of traffic vid
tbl1 = extensions.gameplay_traffic.getTrafficList()

# Vehicle basic infomation
tbl1 = core_vehicles.getVehicleList()

# for example: get vehicle value
for k, v in pairs(tbl1['vehicles'][42]['model']['aggregates']['Value']) do print(k) print(v) end

# damage information
for vid, veh in activeVehiclesIterator() do veh:queueLuaCommand("damage_table = beamstate.getPartDamageData(); dump(damage_table)") end

# pursuit data

# vehicle position
for vid, veh in activeVehiclesIterator() do print(veh:getPosition()) end

# list of lua extensions

# distance bitween vehicles
playerPos = be:getPlayerVehicle(0):getPosition()
for vid, veh in activeVehiclesIterator() do print(veh:getPosition():squaredDistance(playerPos)) end

# get absolute speed(mile/h)


  • Lua AP
C:\Program Files (x86)\Steam\steamapps\common\\lua
  • Other

c – How to inspect userdata in lua – Stack Overflow

コメント / COMMENT

  1. имстмисчуап