I have actually changed entity.name to entity.prototype.localised_name in inserters mod, due to a similar error, because some I change the names of some inserters in logistics. I guess I didn't go and do the same to classes.eradicator wrote: ↑Mon Sep 07, 2020 9:17 pm I'm currently working on a skin-changer (@Pi-C might have talked to you?) when i noticed that in bobclasses gui you useYou should instead useCode: Select all
caption = {"entity-name." .. entity.name}
to respect characters with procedurally generated names.Code: Select all
caption = game.entity_prototypes[entity.name].localised_name
Given that your mod probably assumes that it's the only one doing any character changes i'm not sure how important that is to you. But it should be an easy fix. And...well, experience says that localised_name is always preferred over guessing the name yourself .
And yes, you can get an entity's prototype from the entity itself, you don't need to go through game.entity_prototypes[entity.name] to get it.