Character mod helper

by Pi-C

If your mod lets players use a character that looks differently, you'll have to decide whether you must overwrite the default character. This mod will help you with this decision, and make it really simple to overwrite the default or update the new prototypes in a safe way.

Internal
2 months ago
1.1 - 2.0
53.5K
Character

g [Fixed] Something broke

4 months ago

after last update i loaded i get this error with every skin mod i have

Failed to load mods: CharacterModHelper/data.lua:75: bad argument #1 of 2 to 'pairs' (table expected, got nil)
stack traceback:
[C]: in function 'pairs'
CharacterModHelper/data.lua:75: in function 'apply_properties'
CharacterModHelper/data.lua:97: in function 'create_prototypes'
HuTaoSkin/data.lua:69: in main chunk

Mods to be disabled:
• HuTaoSkin (1.0.1)

4 months ago

same error here with I, Robot

4 months ago

Got the same error with Mechanicus and Orky Business

4 months ago

The crash happens to me too, BTW for anyone having this issue: You can download the old version in the Downloads tab on the mod page, then just put it in "%appdata%\Factorio\mods" and choose that version in the mod menu, and it should work! (I had no clue you could download old mod versions until now...)

4 months ago
(updated 4 months ago)

the error seems to be with all of the character mods.

4 months ago

Strange thing: I know I had this same error before I uploaded, and fixed it. The problem was with line 73 of data.lua:

properties = CMH.images.check_hr_graphics(properties)

The function check_hr_graphics in file images.lua didn't return anything, therefore pairs(properties) in line 75 of data.lua would error, and adding

return properties

as line 70 of file images.lua would fix that.

Now, I couldn't reproduce your error. I've moved my local versions of CharacterModHelper_2.0.1 out of the way (both zipped and folder version) and let the in-game mod manager fetch the latest version from the mod portal. When I restart with that version, with all of the character mods mentioned in the thread, the game is still successfully loading on my end.

I simply do not understand what is going wrong here. No doubt something is wrong – but I can't reproduce it! I've even disabled Creative Mod, gvv, _debug, and downgraded PI-C_lib from my WIP version to the version available on the mod portal and the game is still loading successfully here!

Could anybody upload a saved game somewhere?

4 months ago

It is recommended to revert the changes and avoid using check_hr_graphics.

4 months ago

Here hope it helps and Gulag willin you can acess lol :
https://drive.google.com/file/d/1ly3EYx_Li1HJnkDJ_Cp2a5aGP8idrusA/view?usp=sharing

4 months ago

Not sure if im on my rocker, but the zip has a .bak with a timestamp matching other files but the originals date is older, and its on one of the mentioned files too data.lua, definitely spit balling but also sounds like some ide aspect trolling you

4 months ago

hr is removed, so that no one should use that

4 months ago
(updated 4 months ago)

well the author either breaks every old mod that doesnt get an update, or he makes his helper tool... help them still work.

@Pi-C, again unfamiliar ish ground here, but should there only be a .bak of utilities? that seems a bit odd given the second command in there is called by... well every other command in the mod?

ha wait old versions to diff right there

Why is it still the same in the last version lol... at least the common bak is older in this one haha

there arent many CMH.entered_function with no args, but there are a few, in control.lua, and then this properties command in images? stuck out to me. good luck fixing it, gotta be cute af korone or theres no reason to play!

4 months ago

Here hope it helps and Gulag willin you can acess lol :
https://drive.google.com/file/d/1ly3EYx_Li1HJnkDJ_Cp2a5aGP8idrusA/view?usp=sharing

Thanks! I downloaded the save, made a copy of my Factorio folder with only your save in the saves folder and an empty mods folder, synced – and restarted successfully. Well, kind of: I had to disable 2 mods because they require SA, which I don't have. After removing these, the game started alright.

So: Is there anybody among you who doesn't use Space Age? Or else, what happens if you disable SA?

4 months ago

@Pi-C, again unfamiliar ish ground here, but should there only be a .bak of utilities? that seems a bit odd given the second command in there is called by... well every other command in the mod?

I've moved those functions to common.lua, so utilities.lua isn't needed anymore.

ha wait old versions to diff right there

there arent many CMH.entered_function with no args, but there are a few, in control.lua, and then this properties command in images?

Not every function takes arguments, so there'd be nothing to show. Also, in img.check_hr_graphics I deliberately left out the argument because properties is a big table, and the function is recursive, so logging the arguments each time the function is called would spam the log file.

But I think I've got a good idea what's happening. Back to testing! :-D

4 months ago

hr is removed, so that no one should use that

That's what img.check_hr_graphics is for: If it finds a table x with x.hr_version, it will move everything from x.hr_version to x, so that players will get the HR-graphics. :-)

4 months ago

Here hope it helps and Gulag willin you can acess lol :
https://drive.google.com/file/d/1ly3EYx_Li1HJnkDJ_Cp2a5aGP8idrusA/view?usp=sharing

Thanks! I downloaded the save, made a copy of my Factorio folder with only your save in the saves folder and an empty mods folder, synced – and restarted successfully. Well, kind of: I had to disable 2 mods because they require SA, which I don't have. After removing these, the game started alright.

So: Is there anybody among you who doesn't use Space Age? Or else, what happens if you disable SA?

Disabling Space Age game boots with no Error however with SA ,2.0.1 version makes me disable every single character skin mod , so i redownloaded 2.0.0 for now

4 months ago

Disabling Space Age game boots with no Error however with SA ,2.0.1 version makes me disable every single character skin mod , so i redownloaded 2.0.0 for now

There was this check in img.check_space_age:

if mods["space-age"] or not properties then
  CMH.nothing_to_do()
  return
end

The function would end with return properties if SA was not active, but it would return nil with SA. In img.check_hr_graphics, there was

for k, v in pairs(properties or CMH.EMPTY_TAB) do

which prevented a crash in that function, so it crashed on the next chance it got in function CharModHelper.apply_properties. I skipped the check there because I had already checked that properties was not nil at the beginning of the function. Didn't account for deleting the table in the meantime, though …

Anyway, I've uploaded version 2.0.2 which should fix the bug! :-D

4 months ago
(updated 4 months ago)

ahaha I got to CMH.nothing_to_do before passing out I was on the right path then maybe.. retaining some lua finally

hm. Art time?

4 months ago

hm. Art time?

Sorry, I don't understand what you mean …

4 months ago

hm. Art time?

Sorry, I don't understand what you mean …

Doesnt mean anything sorry! Just joking that now that the mod is fixed, instead of playing the game I go make art for the character to be cuter, to play the game. sorry ignore me thanks for the mod!

4 months ago

The new update does seem to have fixed the issue.

New response