Changing locale key of built-in effect type?

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 574
Joined: Tue May 19, 2015 1:56 am
Contact:

Changing locale key of built-in effect type?

Post by Reika »

In this case "turret damage", because otherwise I get one built from technical entities with names like this:

Image

I am setting the effect's effect_key value but this is having no effect:

Code: Select all

effectcp.effect_key = {"modifier-description." .. effect.turret_id .. "-attack-bonus"}
Image

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

Re: Changing locale key of built-in effect type?

Post by Rseding91 »

"effect_key" has no effect for any modifier outside of the "custom" one.

Because effects aren't prototypes they're all generic and the locale keys are auto-generated from the modifier type. The modifier has no prototype associated so you can't define extra settings outside of what the modifier naively supports (what it modifies, and by how much).
If you want to get ahold of me I'm almost always on Discord.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 574
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Changing locale key of built-in effect type?

Post by Reika »

Rseding91 wrote:"effect_key" has no effect for any modifier outside of the "custom" one.

Because effects aren't prototypes they're all generic and the locale keys are auto-generated from the modifier type. The modifier has no prototype associated so you can't define extra settings outside of what the modifier naively supports (what it modifies, and by how much).
Then is there any way at all to fix this issue, without localizing the technical entities and then having players wonder "what is a gun turret range 6"?
Image

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

Re: Changing locale key of built-in effect type?

Post by Rseding91 »

It's looking for a locale key, that key can show what ever text you want it to.

You can set "modifier.description.gun-turret-rangeboost-6-attack-bonus" = "Cow" for all it matters and it will show "Cow: +N"
If you want to get ahold of me I'm almost always on Discord.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 574
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Changing locale key of built-in effect type?

Post by Reika »

Rseding91 wrote:It's looking for a locale key, that key can show what ever text you want it to.

You can set "modifier.description.gun-turret-rangeboost-6-attack-bonus" = "Cow" for all it matters and it will show "Cow: +N"
Is there a way to do this automatically, since I cannot hardcode locale for every conceivable turret type?
Image

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

Re: Changing locale key of built-in effect type?

Post by Rseding91 »

Reika wrote:Is there a way to do this automatically, since I cannot hardcode locale for every conceivable turret type?
Not currently. The technology effect system was not built for dynamic effects and as such there are limits like this.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 574
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: Changing locale key of built-in effect type?

Post by Reika »

Rseding91 wrote:
Reika wrote:Is there a way to do this automatically, since I cannot hardcode locale for every conceivable turret type?
Not currently. The technology effect system was not built for dynamic effects and as such there are limits like this.
OK, is it possible to hide an effect (without removing it entirely)?
Image


Menzies2552
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Aug 27, 2016 5:08 am
Contact:

Re: Changing locale key of built-in effect type?

Post by Menzies2552 »

Rseding91 wrote:It's looking for a locale key, that key can show what ever text you want it to.

You can set "modifier.description.gun-turret-rangeboost-6-attack-bonus" = "Cow" for all it matters and it will show "Cow: +N"
Hi guys,

I'm having trouble with this one. I've set my locale to the following:
modifier-description.character-crafting-speed=Player crafting speed

However this doesn't add the "+N" from the modification in the technology prototype. Is there a way I can do this or have I set this up incorrectly?

It's common across the following (but not limited to):
modifier-description.character-crafting-speed=Player crafting speed
modifier-description.character-mining-speed=Player mining speed
modifier-description.character-health-bonus=Player health
modifier-description.character-inventory-slots-bonus=Inventory slots
modifier-description.character-running-speed=Player run speed

Technology effect is written like this:
effects =
{
{
type = "character-crafting-speed",
modifier = 0.2,
}
},

Also, the "quick-bars-count" modifier from the http://lua-api.factorio.com/latest/Conc ... l#Modifier page doesn't seem to work.

If anyone has any ideas that would be awesome.

Post Reply

Return to “Modding help”

Who is online

Users browsing this forum: No registered users