How to have custom technology effect modifier icons?

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

How to have custom technology effect modifier icons?

Post by Reika »

The 0.16 changelog mentioned that this was now possible:
Changed technology modifier icons so they can be defined per-modifier-type instead of always using the red "+" icon.
However, I cannot work out how to actually do this. I tried adding 20 different variations of "icon", "sprite", "modifier_icon", and others to the effect and technology prototypes, and that did nothing. I tried adding entries into data.raw["utility-sprites"]["default"], with keys based on the name of the technology, and the non-programmatic part of the effect_description (eg "turret_range" from {"modifier-description.turret-range", tostring(TURRET_RANGE_BOOSTS[l]), tostring(TURRET_RANGE_BOOST_SUMS[l])}). None of it works.

How is this accomplished?
Image
Rseding91
Factorio Staff
Factorio Staff
Posts: 16016
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: How to have custom technology effect modifier icons?

Post by Rseding91 »

They're defined in the utility-sprites.lua file. All of them use the default "+" icon in the base game.

Things like ammo damage, turret speed and so on can also have an icon defined that matches "*turret-name*_turret_attack_modifier_icon" in the utility sprites and it will use that.

*ammo-category*_ammo_damage_modifier_icon
*ammo-category*_gun_speed_modifier_icon
*turret-name*_turret_attack_modifier_icon
If you want to get ahold of me I'm almost always on Discord.
User avatar
Reika
Filter Inserter
Filter Inserter
Posts: 587
Joined: Tue May 19, 2015 1:56 am
Contact:

Re: How to have custom technology effect modifier icons?

Post by Reika »

Rseding91 wrote:They're defined in the utility-sprites.lua file. All of them use the default "+" icon in the base game.

Things like ammo damage, turret speed and so on can also have an icon defined that matches "*turret-name*_turret_attack_modifier_icon" in the utility sprites and it will use that.
*ammo-category*_ammo_damage_modifier_icon
*ammo-category*_gun_speed_modifier_icon
*turret-name*_turret_attack_modifier_icon
And what of custom (ie "nothing") modifiers?
Image
User avatar
lovely_santa
Filter Inserter
Filter Inserter
Posts: 502
Joined: Sat Feb 18, 2017 9:41 pm
Contact:

Re: How to have custom technology effect modifier icons?

Post by lovely_santa »

*BUMP* :lol:

Rseding, I want 'nothing' effect on my technology research, but is there anyway to get a custom icon on it, so it's not the default + sign or some alternative for the other types...

How can we add custom icons to the nothing effect?

As it originaly was requested in 38690 its easy to have an icon to be defined
(As that is for 0.15, i would expect also an icon_size for 0.16)

Hope you'll get back to me :roll:

Greetings
lovely_santa
You can find all my mods on the mod portal. Also helping on Arch666Angel's mods.
Image
Post Reply

Return to “Modding help”