Hello mates,
I'm making a mod bringing some ecology stuff in game and I got stuck on wind turbines. In-game entities that produce power have "Generates power" label and production bar in their description (screenshot 1). So I wanna make same thing with my wind turbine, but I didn't find the corresponding attribute for the entity prototype.
Will appreciate any help possible.
https://imgur.com/2N7DXR1
https://imgur.com/SkJGCfQ
"Generates electricity" label
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: "Generates electricity" label
This is likely an automatic thing that is tagged on either for the entity type or anything that net generates power (without script).
There does exist a few other wind turbine mods already. You can check them out to see if they solved that issue or not and how.
There does exist a few other wind turbine mods already. You can check them out to see if they solved that issue or not and how.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Re: "Generates electricity" label
Actually I did check some other mods having wind turbines and they didn’t solve this problem either.
It just doesn’t seem right that I can’t put this thing into my entity’s description, so maybe it should be done from control script or something…
It just doesn’t seem right that I can’t put this thing into my entity’s description, so maybe it should be done from control script or something…
- Stringweasel
- Filter Inserter
- Posts: 405
- Joined: Thu Apr 27, 2017 8:22 pm
- Contact:
Re: "Generates electricity" label
It's possible to add custom tooltips. It won't look exactly like normal generators, but at least the information will be there. I do something similar in my mod Biter Power to display the change of escape
In the prototype you add the field `localised_description`
And then have the field in you local/en/locale.cfg file something like this
In the prototype you add the field `localised_description`
Code: Select all
{
name = "bp-generator",
type = "burner-generator",
localised_description = {"",
{"entity-description.bp-generator"},
{"bp-text.escape-modifier", 5},
},
...
}
Code: Select all
[bp-text]
escape-modifier=\n[img=tooltip-category-turret][font=default-bold][color=#FFD249]Chance of Escape[/color][/font]\n[font=default-semibold][color=#ffe6c0]Containment modifier:[/color][/font] __1__
Alt-F4 Author | Factorio Modder
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock |Weasel's Demolition Derby
Official Contributor to Space Exploration
My Mods: Hall of Fame | Better Victory Screen | Fluidic Power | Biter Power | Space Spidertron | Spidertron Dock |
Official Contributor to Space Exploration
Re: "Generates electricity" label
Oh, actually it's quite close to what I'm trying to accomplish, thanks!Stringweasel wrote: ↑Tue Feb 27, 2024 1:49 pmIt's possible to add custom tooltips. It won't look exactly like normal generators, but at least the information will be there. I do something similar in my mod Biter Power to display the change of escape
However, making description that way doesn' look exactly like vanilla ones. Also, your "generator" has "Working" status and energy production bar - I suppose you just copied vanilla generator entity, so it just works for you. Maybe if you know, can I just also copy generator entity instead of
Code: Select all
type = "electric-energy-interface"