[NotImplemented] Existence of localisation key

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

[NotImplemented] Existence of localisation key

Post by Mooncat »

I know it is already inside the engine, please expose it to lua so I can use it in data phase. :P
(Yes, not a usual request. This request is for the data phase, not control phase.)

See this for details about how I know that and why I need that: viewtopic.php?f=66&t=33732

TL;DR Based on "offshore-pump", I know recipe names can be generated based on the sequence: get the localised string of {"recipe-name.<recipe name>"}, if such key is not found -> {"item-name.<product's item name"}, if not found -> {"entity-name.<product place_result's entity-name>"}, if not found -> "unknown key: entity-name...."

I am making a mod which will do the same thing for determining recipe name. Now everything is ready, except I am stuck at "if such key is not found" so that some recipes have wrong names.
(I am doing it in reverse way, i.e. if no recipe.localised_name -> if product has place_result or placed_as_equipment_result, then use entity-name or equipment-name, otherwise, item-name or fluid-name. As the result, recipe.name is always ignored.)

Such API will help me to fix this problem. So, please? :)
Last edited by Mooncat on Wed Oct 05, 2016 4:03 pm, edited 2 times in total.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13338
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: API for checking existence of localisation key in data phase

Post by Rseding91 »

Unfortunately that can't be used as it can lead to desyncs. The existence of a localized key is conditional on the locale you're currently using which is not deterministic across peers/game instances.

So, while on English you might have a given locale key but then in German when someone loads up they don't and you end up with different prototypes.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: API for checking existence of localisation key in data phase

Post by Mooncat »

Rseding91 wrote:Unfortunately that can't be used as it can lead to desyncs. The existence of a localized key is conditional on the locale you're currently using which is not deterministic across peers/game instances.

So, while on English you might have a given locale key but then in German when someone loads up they don't and you end up with different prototypes.
awwwwwww.... you are right... :(
Nvm, I will make request for another thing. It would be doable I guess. :mrgreen:

Edit: tada - viewtopic.php?f=28&t=33823

Post Reply

Return to “Modding interface requests”