I'm putting together a "bridging"/compatibility mod to make a few of my favourite mods work more smoothly together, and I find I need to revert the name change one of them made to a vanilla item.
There isn't an entry for it in localisations in the mod that changes it, and trying "Data.raw["storage-tank"]["storage-tank"].LocalisedString = "Storage Tank" didn't seem to do anything.
Is there something obvious I'm missing?
Modding a mod - reverting a change to vanilla name
-
- Filter Inserter
- Posts: 409
- Joined: Mon Feb 05, 2018 10:01 am
- Contact:
- Deadlock989
- Smart Inserter
- Posts: 2528
- Joined: Fri Nov 06, 2015 7:41 pm
Re: Modding a mod - reverting a change to vanilla name
LocalisedString isn't the property name, it's the type of property. You want localised_name and/or localised_description. The value of that property should be a table reference to a mix of strings and locale entries, not just a plain string of the text you want displayed - because then it's not localised.
https://wiki.factorio.com/PrototypeBase#localised_name
https://wiki.factorio.com/Types/LocalisedString
https://wiki.factorio.com/PrototypeBase#localised_name
https://wiki.factorio.com/Types/LocalisedString
-
- Filter Inserter
- Posts: 409
- Joined: Mon Feb 05, 2018 10:01 am
- Contact:
Re: Modding a mod - reverting a change to vanilla name
Thanks, that's let me set it to a string I know.
Is there a way to get it to be the localised name of a vanilla item instead? I tried a few variations from looking at other mods and from the wiki page, but they all came up verbotem when I tried them with "storage-tank".
Is there a way to get it to be the localised name of a vanilla item instead? I tried a few variations from looking at other mods and from the wiki page, but they all came up verbotem when I tried them with "storage-tank".
Re: Modding a mod - reverting a change to vanilla name
Code: Select all
data.raw["storage-tank"]["storage-tank"].localised_name = {"entity-name.storage-tank"}
data.raw["item"]["storage-tank"].localised_name = {"entity-name.storage-tank"}
-
- Filter Inserter
- Posts: 409
- Joined: Mon Feb 05, 2018 10:01 am
- Contact:
Re: Modding a mod - reverting a change to vanilla name
That doesn't work. I guess the vanilla value has been completely overwritten, so maybe the data isn't there anymore?
Re: Modding a mod - reverting a change to vanilla name
Then you can overwrite it back in /locale/en/en.cfg
-
- Filter Inserter
- Posts: 409
- Joined: Mon Feb 05, 2018 10:01 am
- Contact:
Re: Modding a mod - reverting a change to vanilla name
But what if they've changed it in other Locales as well?
I'd really like a solution that doesn't need to to even think about what language people are using.
I'd really like a solution that doesn't need to to even think about what language people are using.