Page 1 of 1

Modding a mod - reverting a change to vanilla name

Posted: Sat Jan 04, 2020 2:09 pm
by Illiander42
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?

Re: Modding a mod - reverting a change to vanilla name

Posted: Sat Jan 04, 2020 2:15 pm
by Deadlock989
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

Re: Modding a mod - reverting a change to vanilla name

Posted: Sun Jan 05, 2020 6:36 am
by Illiander42
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".

Re: Modding a mod - reverting a change to vanilla name

Posted: Sun Jan 05, 2020 5:15 pm
by DaveMcW

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"}

Re: Modding a mod - reverting a change to vanilla name

Posted: Sun Jan 05, 2020 8:10 pm
by Illiander42
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

Posted: Sun Jan 05, 2020 8:46 pm
by DaveMcW
Then you can overwrite it back in /locale/en/en.cfg

Re: Modding a mod - reverting a change to vanilla name

Posted: Mon Jan 06, 2020 11:40 am
by Illiander42
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.