Starbound
Crew Customization +
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().
Отредактировано Luna; 7 авг. 2022 г. в 18:19
< >
Сообщения 12 из 2
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.
Отредактировано Luna; 7 авг. 2022 г. в 18:31
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>
Отредактировано BurntKrispe; 8 ноя. 2022 г. в 19:05
< >
Сообщения 12 из 2
Показывать на странице: 1530 50