Page 1 of 1

How to have custom technology effect modifier icons?

Posted: Fri Dec 22, 2017 5:24 am
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?

Re: How to have custom technology effect modifier icons?

Posted: Fri Dec 22, 2017 7:16 am
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

Re: How to have custom technology effect modifier icons?

Posted: Fri Dec 22, 2017 8:48 am
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?

Re: How to have custom technology effect modifier icons?

Posted: Thu Jan 25, 2018 1:11 pm
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