Jump to content

Recommended Posts

8a720435b4b0fcdfb49cc3733980dce7.thumb.png.7d152afbc0cdb704eb2c8d75512e8328.png

Sorry if this isn't in the right spot,I'm also sorry if this has been asked before. I looked online and it has stuff to do with mods people are making. But I didn't make any mods of my own,I only install them so I'm confused. I don't even know where the folder to deal with this is anyways,sorry if I'm really stupid. This only began happening recently,so I don't know what could be causing this problem and I'm not sure how to fix it,or where to fix it. I don't even know anything about code. 

Edited by catstep

I also got this same message when I choose custom character mod at character selection.

I have tested a couple mods with different methods and found out that many character mods that haven't updated since around 13 October 2020~22 Jan 2017 are affected by this crash issue, and only character mods are affected. There could be more mods outside of these dates I have mentioned were affected as well.

I think this all started when 14 August 2021 Hotfix update come out, as all of my subscribed mods still working fine at 13 August 2021.

Maybe something was changed after 14 August 2021 update causing this issue?

By the way any character mods that have recently updated (I think starting from April 2021?, I don't know.) still working fine.

Also I mentioned wrong dates, I mean around 30 October 2020-22 Jan 2017.

Edited by Rynex541
Wrong dates info on previous post

Error occurs when you trying to spawn in new world as a mod character. This started to happen to many mod characters after Waterlogged update. I have zero idea how to fix this or where in game/mod folder mainfunctions.lua file is.

Other thing is that if you already have save world then no error occurs on load with this char. Only new worlds affected.

I know Klei can't promise compatibility with mods but I do wish they could avoid patching in such a way that it breaks characters going through several years. So what, half or probably more of the character mods? Kinda sucks for those of us that paid for mods, but that's the risk we take.

Advice on how to fix this would be great. Anyone figure it out, or anyone at Klei able to offer some advice on what changed that may have done this and how to fix it?

Spoiler

--mainfunctions.lua
local function OnUserPickedCharacter(char, skin_base, clothing_body, clothing_hand, clothing_legs, clothing_feet)
    local function doSpawn()
        TheFrontEnd:PopScreen()

        local starting_skins = {}
        --get the starting inventory skins and send those along to the spawn request
        local inv_item_list = (TUNING.GAMEMODE_STARTING_ITEMS[TheNet:GetServerGameMode()] or TUNING.GAMEMODE_STARTING_ITEMS.DEFAULT)[string.upper(char)]
        
        local inv_items, item_count = {}, {}
        for _, v in ipairs(inv_item_list) do --line 1677
            if item_count[v] == nil then
                item_count[v] = 1
                table.insert(inv_items, v)
            end
        end
        for _, item in ipairs(inv_items) do
            if PREFAB_SKINS[item] then
                local skin_name = Profile:GetLastUsedSkinForItem(item)
                starting_skins[item] = skin_name
            end
        end

        TheNet:SendSpawnRequestToServer(char, skin_base, clothing_body, clothing_hand, clothing_legs, clothing_feet, starting_skins)
    end

    TheFrontEnd:Fade(FADE_OUT, 1, doSpawn, nil, nil, "white")
end

 

It seems to me Klei never added a error check to check if the inv_item_list is valid, a lot of the really old mods will not have a TUNING table for their character's. So it'll attempt to ipair a nonexistant table and crash, either Klei could add a quick error check to not attempt a ipairs on nil or modders can update their mods to properly add their character's the TUNING.GAMEMODE_STARTING_ITEMS table.

I think Klei could simply just add a or {} at the end of the inv_item_list so if both are nil then it just defaults to a blank table.

Edit:
I'll just like to state that I am not a professional coder, I am a medical professional. I am just a seasoned modder who loves this game and my mods aren't affected by this bug because my characters use the TUNING.GAMEMODE_STARTING_ITEMS table.

Edited by IronHunter
See above
  • Like 3
  • Thanks 3

Ok I have found a mod on the steam workshop that fixed this problem for me

https://steamcommunity.com/sharedfiles/filedetails/?id=2574759978 

idk if links work and its all in another language, but it works for me. hopefully Klei also puts out a fix for this 

  • Thanks 4

Thank you so much guys! I'll be giving this stuff a try soon.

Edit: Tried the mod. It works! Thank you so much Saj. And again thanks to Hunter for insight on what might be causing it internal to the mod.

Edited by icefoxy
  • Developer
On 8/14/2021 at 2:09 PM, IronHunter said:

I think Klei could simply just add a or {} at the end of the inv_item_list so if both are nil then it just defaults to a blank table.

Yup, we'll be adding something like this today. Thanks!

  • Like 2
  • Thanks 4
  • Ninja 1

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...