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.8K
Character

g [Done] Factorio 2.0

5 months ago

Will this mod be updated for Factorio 2.0?

5 months ago

Definitely! Unfortunately, I'll be extremely busy in RL for the next one or two weeks, so it may take a while until I can get back to modding.

5 months ago

Great, thanks!

5 months ago
(updated 5 months ago)

A quick workaround while Pi-C is busy:

  1. info.json:
    change "factorio_version" from "1.1" to "2.0"
  2. common.lua
    change all instances of "flying-text" to "highlight-box"
  3. control.lua
    change all instances of "flying-text" to "highlight-box"
    change all instances of "global" to "storage"
    change "game.get_filtered_entity_prototypes" to "prototypes.get_entity_filtered"

Character mode that you use also has to be updated to 2.0, at least the game version in it's info.json. There's also some error with indexing pictures for the new corpses, but you can comment out/remove new corpse pictures and use the defaults instead (not that you are going to die that often).

Explanation: the devs removed the "flying-text" prototype this mode uses, so I've looked for another prototype with only optional properties. They've also renamed "global" to "storage" and changed the way to call for filtered prototypes.

5 months ago

Thanks Stygji! I wasn't sure what to do about the corpse index, so I just repeated the last entry in NEWGEARGIRL.protos.corpse.pictures to turn it into a 4 element array, and it seems to work OK.

My girl is back again :-)

5 months ago
(updated 5 months ago)

And thank you for the corpse index fix. I guess the cause of the error is that there's a new armor tier now and it has it's own corpse, but the mod was made when there only were 3 tiers. Supposedly we are now going to see the same corpse image for power armor and mech armor, but I haven't advanced enough in SA yet to verify it :)

5 months ago

A quick workaround while Pi-C is busy:

  1. info.json:
    change "factorio_version" from "1.1" to "2.0"
  2. common.lua
    change all instances of "flying-text" to "highlight-box"
  3. control.lua
    change all instances of "flying-text" to "highlight-box"
    change all instances of "global" to "storage"
    change "game.get_filtered_entity_prototypes" to "prototypes.get_entity_filtered"

Character mode that you use also has to be updated to 2.0, at least the game version in it's info.json. There's also some error with indexing pictures for the new corpses, but you can comment out/remove new corpse pictures and use the defaults instead (not that you are going to die that often).

Explanation: the devs removed the "flying-text" prototype this mode uses, so I've looked for another prototype with only optional properties. They've also renamed "global" to "storage" and changed the way to call for filtered prototypes.

Are you able to give us a link to this edited JSON file you made?
Because I have no idea how to edit JSON files.

5 months ago
(updated 5 months ago)

You can edit JSON files just like a normal text file, with Notepad or a similar app. Right click - edit in Notepad on Windows by default. I recommend Notepad++ as an easy and free text editor, but any other will work. Here's the full file after the game version change:

{
"name": "CharacterModHelper",
"version": "1.1.6",
"title": "Helper for mods that create new characters",
"author": "Pi-C",
"factorio_version": "2.0",
"description": "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."
}

The only change here is replacing "factorio_version": "1.1" with "factorio_version": "2.0". You'll have to do the same change for the character mod you want installed, all of them have an info.json file with the same structure.

You can also look at my comment in another thread, it has the same instruction, but with a couple of additional steps for a specific character mod:
https://mods.factorio.com/mod/NewGirlCharacter/discussion/67168e2031f8d0d0a560ad3b

5 months ago
(updated 5 months ago)

<deleted>

5 months ago

@Stygji: Thanks for your hints! Most of the changes you've suggested were exactly what I'd done in my local version. The only difference was that I've based the proxies on an 'arrow' prototype. But I think using a 'highlight-box' instead, as you've suggested, is better – so I'm using that now instead of the 'arrow'.

Anyway, the update for Factorio 2.0 is out now! Let's hope everything is working fine now. :-D

New response