1. Welcome to the Starbound support forums. Please check the support FAQs before posting: http://playstarbound.com/support

Bug/Issue [SOLVED] Quest script update() method called while world was unloading.

Discussion in 'Starbound Support' started by cpeosphoros, Jul 12, 2017.

  1. cpeosphoros

    cpeosphoros Orbital Explorer

    I don't know if bugs in the scripting engine go here. If there is another place, I apologize in advance and ask for some moderator to move the thread, please. Mind you it's not a mod's bug, but a bug in the scripting engine itself.
    Teleported from player's ship to Outpost and got this exception:

    [12:03:29.773] [Info] Forcing generation of dungeon outpost_2stopshop
    [12:03:29.773] [Info] Placing dungeon at (427, 618)
    [12:03:29.783] [Info] cpe_ursaminer.update(0.08333333581686)
    [12:03:29.785] [Error] Exception while invoking lua function 'update'. (LuaException) Error code 2, [string "/scripts/cpe_monitor/cpe_monitor.lua"]:66: attempt to index a nil value (global 'player')
    /* stack trace omitted, for readability */
    [12:03:29.818] [Info] UniverseServer: Warping player 1 to InstanceWorld:outpost:-:-=outpost
    [12:03:30.630] [Info] UniverseServer: Stopping idle world ClientShipWorld:d049ac02f777acf7986bf9cb4271a225
    [12:03:30.645] [Info] Client received world stop packet, leaving: Removed
    [12:03:30.646] [Info] cpe_monitor.uninit()
    [12:03:30.930] [Info] cpe_monitor.init()
    cpe_monitor.lua is a quest's script.
    cpe_ursaminer.lua is a script patched into ursaminer.object
    Modding it. Specifically, at that moment I was teleporting from ship to outpost.
    No. It's extremely time related, as it requires that the deltascript moment happens exactly between unloading a world and loading the other.
    Linux Mint 18
    Couple hundreds of them, but I don't think it's relevant.

    For the moment, I'll do the obvious workaround and check all globals for nil on update() before using them. But it shouldn't be required.

    I'm not posting the full SB.log, but I have it available if necessary.

    Thank you
  2. cpeosphoros

    cpeosphoros Orbital Explorer

    Nevermind, error on my side. Was including the quest script in the object script and the update() method was handed down.

Share This Page