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.32 Bug Reporting thread
    Solutions and more information may already be available.

Error 0x00000001 when deleting vehicles in scenario

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by bidwars, Aug 11, 2017.

  1. bidwars

    bidwars
    Expand Collapse

    Joined:
    Sep 23, 2014
    Messages:
    171
    This is an error I keep getting on the newest update.

    BeamNG.drive 0.10.0.0 0x00000001

    I tracked this down to deleting vehicles or from switching vehicles

    Code that fails in Derby Scenario:
    local function deleteVehicles(obj)
    if obj then
    obj:delete()
    be:reloadCollision()
    end
    end


    Log file information:
    76.47786|D|GELua.scenario|Deleting Vehicle Little
    76.48113|D|GELua.main|Player #0 vehicle switched from: nil to: physicsID 3020 (vehicles/fullsize/)
    76.57560|D|BeamNGCollision::addTerrainBlock|depth image map not existing: levels/derby/derby.ter.depth.png all fluids will be disabled as ground type
    76.61010|D|GELua.scenario|Deleting Vehicle John
    76.61345|D|GELua.main|Player #0 vehicle switched from: nil to: physicsID 3020 (vehicles/fullsize/)
    76.71545|D|BeamNGCollision::addTerrainBlock|depth image map not existing: levels/derby/derby.ter.depth.png all fluids will be disabled as ground type
    76.74982|D|GELua.statistics|onScenarioChange: called
    76.74994|D|GELua.waypoints|onScenarioChange: pre-start
    76.75006|D|GELua.statistics|onScenarioRestarted: called
    76.75010|D|GELua.statistics|initialiseTables called...
    76.75079|I|GELua.waypoints|onScenarioRestarted called
    84.62560|E|Crashreport|*** Trying to get Lua callstack
    84.62563|E|Crashreport|*** this is not the error, look above
    84.62568|E|GELua.main_static|Lua C++ CrashRpt stacktrace
     
  2. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    Could we please get the crashdump of this?
     
  3. LuisAntonRebollo

    LuisAntonRebollo
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Feb 25, 2014
    Messages:
    117
    That "Derby Scenario" is a mod?

    Can you post the link for we can try to reproduce the issue?
     
  4. LuisAntonRebollo

    LuisAntonRebollo
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Feb 25, 2014
    Messages:
    117
    https://www.beamng.com/resources/demolition-derby-the-fair-grounds.1784/

    I think i found something, maybe the issue is not in our side, but in the mod code.

    The mod is storing vehicles c++ pointer in scenario_derby_vehicles.scenarioVehicles.
    But the function that you point delete the object without remove the entries from scenario_derby_vehicles.scenarioVehicles.
    Next frame the mod iterate all vehicles inside scenario_derby_vehicles.scenarioVehicles using invalid vehicle pointers that make the game crash. :(

    Code never should store pointers for this reason, use Ids or names is a lot safer.
     
  5. bidwars

    bidwars
    Expand Collapse

    Joined:
    Sep 23, 2014
    Messages:
    171
    Thank you for finding this! :cool:

    Now I am trying to understand your response. So you are saying that I should not store the scenarioVehicles in a pointer but they should be an Id or name? Do you have an example to help me understand. Do I just call the scenetree each time and store the local variable to call each vehicle?
     
  6. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    Do not store the result of getPlayerVehicle() or any function along like this anywhere. Only store the ID of it. When you then want to use it, look it up again. The reason is, that lua does not know when the vehicle is deleted/gone from the c++ side, so it will call invalid things.
     
  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