Modding a mod - reverting a change to vanilla name

Place to get help with not working mods / modding interface.
Post Reply
Illiander42
Filter Inserter
Filter Inserter
Posts: 409
Joined: Mon Feb 05, 2018 10:01 am
Contact:

Modding a mod - reverting a change to vanilla name

Post 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?

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

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

Post 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
Image

Illiander42
Filter Inserter
Filter Inserter
Posts: 409
Joined: Mon Feb 05, 2018 10:01 am
Contact:

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

Post 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".

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

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

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

Illiander42
Filter Inserter
Filter Inserter
Posts: 409
Joined: Mon Feb 05, 2018 10:01 am
Contact:

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

Post by Illiander42 »

That doesn't work. I guess the vanilla value has been completely overwritten, so maybe the data isn't there anymore?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

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

Post by DaveMcW »

Then you can overwrite it back in /locale/en/en.cfg

Illiander42
Filter Inserter
Filter Inserter
Posts: 409
Joined: Mon Feb 05, 2018 10:01 am
Contact:

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

Post 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.

Post Reply

Return to “Modding help”