catstep Posted August 14, 2021 Share Posted August 14, 2021 (edited) 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 August 14, 2021 by catstep Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/ Share on other sites More sharing options...
Rynex541 Posted August 14, 2021 Share Posted August 14, 2021 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? Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486044 Share on other sites More sharing options...
Rynex541 Posted August 14, 2021 Share Posted August 14, 2021 (edited) 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 August 14, 2021 by Rynex541 Wrong dates info on previous post Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486046 Share on other sites More sharing options...
Luneyl Posted August 14, 2021 Share Posted August 14, 2021 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. Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486089 Share on other sites More sharing options...
catstep Posted August 14, 2021 Author Share Posted August 14, 2021 Ah,thank you guys. ^^u I thought I was just dumb. Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486110 Share on other sites More sharing options...
Luneyl Posted August 14, 2021 Share Posted August 14, 2021 (edited) Also, I would be very grateful if someone who managed to fix it in their char mod would share how they did it. Edited August 14, 2021 by Luneyl Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486112 Share on other sites More sharing options...
icefoxy Posted August 14, 2021 Share Posted August 14, 2021 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? Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486140 Share on other sites More sharing options...
IronHunter Posted August 14, 2021 Share Posted August 14, 2021 (edited) 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 August 14, 2021 by IronHunter See above 3 3 Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486147 Share on other sites More sharing options...
Saj Fox Posted August 14, 2021 Share Posted August 14, 2021 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 4 Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486166 Share on other sites More sharing options...
icefoxy Posted August 15, 2021 Share Posted August 15, 2021 (edited) 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 August 15, 2021 by icefoxy Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486189 Share on other sites More sharing options...
Developer PeterA Posted August 16, 2021 Developer Share Posted August 16, 2021 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! 2 4 1 Link to comment https://forums.kleientertainment.com/forums/topic/132684-help-bad-argument-1-to-ipairs/#findComment-1486469 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