Jump to content

Recommended Posts

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 = numslotsend

The 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 by kiopho

(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 by kraken121

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)

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 = numslotsend
It does overwrite the SetNumSlots function, so only include this in your mod as long as it's necessary. Edited by squeek
  • Developer

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.

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 assert

The 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)    end
However, 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 by squeek

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...