Starbound

Starbound

Crew Customization +
Luna 7 Aug, 2022 @ 12:44pm
Interface locks up when viewing certain modded crewmates.
I'm not certain what mods exactly cause this, but at least with all the mods I'm currently using, FU's "Assassin" crewmate spawns without any armour and causes the interface to lock up, in the log,

[Error] Exception while invoking lua function 'crewSelected'. (LuaException) Error code 2, [string "/interface/CCustomization/CCustomization.lua"]:375: attempt to index a nil value (local 'items') stack traceback: [C]: in metamethod '__index' [string "/interface/CCustomization/CCustomization.lua"]:375: in global 'putItemsOnSlots' [string "/interface/CCustomization/CCustomization.lua"]:841: in global 'resetView' [string "/interface/CCustomization/CCustomization.lua"]:351: in function <[string "/interface/CCustomization/CCustomization.lua"]:301>

I'm not quite sure what leads to both self.items and items being nil in resetView(), but modifying putItemsOnSlots() to the following solves the issue:

function putItemsOnSlots(items) if items == nil then clearSlots() else for slot, widgetName in pairs(self.widgetSlots) do setSlotManual(widgetName,items[slot],false) end end updateSpeciesSlots() end

note of course that this causes calling putItemsOnSlots() without items specified to instead duplicate clearslots(), if you want to preserve throwing an error on this, it might be better to instead check if items or self.items is not nil in resetView().
Last edited by Luna; 7 Aug, 2022 @ 6:19pm
< >
Showing 1-2 of 2 comments
Luna 7 Aug, 2022 @ 6:31pm 
while what I put earlier worked for some crew members, the following function -putSlotsOnItems also seems to error trying to index self.items as well, but I'm not sure why in initial tests after fixing putItemsOnSlots alone the other function didn't error.

a more complete fix to this issue, and the one listed above is adding the following to the start of resetView():
if self.items == nil then self.items = {} end
while a bit of a hacky solution (it literally defaults to being naked still...) it does allow you to edit crew members who defaulted to wearing nothing, for one reason or another.
Last edited by Luna; 7 Aug, 2022 @ 6:31pm
BurntKrispe 8 Nov, 2022 @ 7:05pm 
I've noticed the same issue with saturnians.
Log:
[Error] Exception while invoking lua function 'crewSelected'. (LuaException) Error code 2, [string "/interface/CCustomization/CCustomization.lua"]:375: attempt to index a nil value (local 'items') stack traceback: [C]: in metamethod '__index' [string "/interface/CCustomization/CCustomization.lua"]:375: in global 'putItemsOnSlots' [string "/interface/CCustomization/CCustomization.lua"]:841: in global 'resetView' [string "/interface/CCustomization/CCustomization.lua"]:351: in function <[string "/interface/CCustomization/CCustomization.lua"]:301>
Last edited by BurntKrispe; 8 Nov, 2022 @ 7:05pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50