kiopho Posted March 2, 2014 Share Posted March 2, 2014 (edited) Hello ! So, since the new update, the game crashes everytime I load a savegame with RPG HUD enabled. It doesn't when it's a new fresh game, only upon loading a save. and that's caused by the extra slots and of course this (from container.lua)function Container:SetNumSlots(numslots) assert(numslots >= self.numslots) self.numslots = numslotsendThe crash report says assertion failed, which I don't understand.Also, when the number of slots is unchanged or decreased, no crash. Is there something I'm missing ? Edited March 2, 2014 by kiopho Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/ Share on other sites More sharing options...
CodeyP Posted March 3, 2014 Share Posted March 3, 2014 This has nothing to do with the crash you experience, but when i load a game with the RPG HUD the game shows the extra slots in Chester and the Backpack but i can't use them, thought i would let you know. Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-422910 Share on other sites More sharing options...
kraken121 Posted March 3, 2014 Share Posted March 3, 2014 (edited) (edit- the below rant is purely about the coding of the dlc and us modders, i love the content of the DLC just annoyed by this after sifting through codes today) This really annoys me, "was" trying to move mods over to the dlc, why is there assert on trying to set max slots higher than on constructor? assert should be used for some critical issue that is completely game breaking and in which case you're better off with crash cause game cannot recover what if i wanted to make an upgradable thing.... what if... half of the coding methods no longer work due to this (imo sloppy coding) dlc support, and breaks everything that can be broken i'm just annoyed at how horribly they broke their game(for modders), at least with the coding in this update and dlc so far, (for mods) We are not trying to port anything into the DLC until they fix all that cluster"stuff" they made I really wish a Dev would chime in on this, i hope this coding does not go live, or my sanity lv is gonna drop to zero Edited March 3, 2014 by kraken121 Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-422992 Share on other sites More sharing options...
kiopho Posted March 3, 2014 Author Share Posted March 3, 2014 Yeah that assert is so out of place. Any devs ? Please ? Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-423002 Share on other sites More sharing options...
CodeyP Posted March 3, 2014 Share Posted March 3, 2014 I really hope kiopho can get his RPG HUD mod working again, can't play w/o it ;/, the chests are so tiny lol... Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-423032 Share on other sites More sharing options...
kiopho Posted March 3, 2014 Author Share Posted March 3, 2014 I really hope kiopho can get his RPG HUD mod working again, can't play w/o it ;/, the chests are so tiny lol... Well I'm doing what I can mate.@Ipsquiggle @JoeW please help with this problem. I can't expand the containers without the game crashing or the extra slots just sitting there pretty (non usable) Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-423038 Share on other sites More sharing options...
squeek Posted March 3, 2014 Share Posted March 3, 2014 (edited) Here's some code that should get around the assert while you wait for a fix: -- following line is necessary only if in modmain.lualocal require = GLOBAL.requirelocal Container = require "components/container"function Container:SetNumSlots(numslots) self.numslots = numslotsendIt does overwrite the SetNumSlots function, so only include this in your mod as long as it's necessary. Edited March 3, 2014 by squeek Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-423159 Share on other sites More sharing options...
Developer Bryce Posted March 3, 2014 Developer Share Posted March 3, 2014 The assert is not new, it's actually been in for the lifetime of the container.lua script back in rev #62902. I didn't write the script, but I assume it was done to prevent potential problems stemming from having an over-full container. It's maybe a bit of a heavy handed approach to that problem. Which version of RUG HUD are you using? I haven't been able to reproduce a crash using this version of RPG HUD and the current build on steam (96948). I tried both with and without DLC content enabled. If possible, zip up your entire save folder and send me that along with the version of RPG HUD that you're using. Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-423166 Share on other sites More sharing options...
squeek Posted March 3, 2014 Share Posted March 3, 2014 (edited) The assert is not new, it's actually been in for the lifetime of the container.lua script back in rev #62902. I didn't write the script, but I assume it was done to prevent potential problems stemming from having an over-full container. It's maybe a bit of a heavy handed approach to that problem. Which version of RUG HUD are you using? I haven't been able to reproduce a crash using this version of RPG HUD and the current build on steam (96948). I tried both with and without DLC content enabled. If possible, zip up your entire save folder and send me that along with the version of RPG HUD that you're using.What changed is that numslots is now saved and loaded (and the assert conditional changed from > to >=), but this is what's happening:Un-modded game: A container is created with default number of slots, that number of slots is saved in the component data once you go back to the main menu.RPG HUD enabled: The number of slots of the container is increased before saved data is loaded. Afterwards, saved data is loaded, and the number of slots attempts to get set to the saved (default) number, which is lower than the current number, triggering the assertThe fix would be to check that the assert won't be triggered when loading:--// container.lua(372)function Container:OnLoad(data, newents) if data.numslots and data.numslots > self.numslots then self:SetNumSlots(data.numslots) endHowever, I'm not sure why exactly the numslots needs to be saved/loaded. It seems like it'll still cause some weirdness (containers would remain larger even after RPG HUD is disabled, right?). Edited March 3, 2014 by squeek Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-423217 Share on other sites More sharing options...
Developer Bryce Posted March 3, 2014 Developer Share Posted March 3, 2014 What I'll do is remove the save/ loading of numslots in containers, you should see that change in the next update. It was added for something that isn't necessary anymore. Thanks for taking the time to look into it! Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-423297 Share on other sites More sharing options...
kiopho Posted March 4, 2014 Author Share Posted March 4, 2014 @squeek @Bryce Thanks a lot for the time and answers. I'll use the workaroud for now, until the update is deployed. Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-423327 Share on other sites More sharing options...
kraken121 Posted March 4, 2014 Share Posted March 4, 2014 What I'll do is remove the save/ loading of numslots in containers, you should see that change in the next update. It was added for something that isn't necessary anymore. Thanks for taking the time to look into it!Thanks Bryce Link to comment https://forums.kleientertainment.com/forums/topic/32127-new-update-and-custom-containers-rpg-hud-related/#findComment-423522 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now