[illuminates] ability question
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
[illuminates] ability question
I've got a strange issue with a cumulative [illuminates] ability: It doesn't accumulate in the dark...
Imagine a unit which illuminates (mage of light), standing besides another which has a special cumulative illumination*. When outside (daylight), lawful units affected by both indeed display the cumulative illumination. When in the dark, they don't, they just display "+0%". How comes?
* The presence of angels and such should affect adjacent units no matter the daylight. I've thus created a special ability like this:
As I said, it works during daylight (giving "+40%"), but not during night (or underground)("+0%"): The "cumulative=yes" part is lost.
Where did I go wrong?
Imagine a unit which illuminates (mage of light), standing besides another which has a special cumulative illumination*. When outside (daylight), lawful units affected by both indeed display the cumulative illumination. When in the dark, they don't, they just display "+0%". How comes?
* The presence of angels and such should affect adjacent units no matter the daylight. I've thus created a special ability like this:
Code: Select all
#define ABILITY_HOLY_AURA
# Variation of the Illuminates ability
[illuminates]
id=holyaura
value=25
max_value=50
cumulative=yes
name= _ "holy aura"
description= _ "This holy unit illuminates the surrounding area, making lawful units fight much better, and chaotic units fight much worse.
Note this is cumulative."
[/illuminates]
#enddefWhere did I go wrong?
Re: [illuminates] ability question
You implemented that 2 abilities ABILITY_HOLY_AURA that target same location are cumulative. You probably didnt give mage of light this ability.
Re: [illuminates] ability question
No, indeed: The "mage of light" unit has his standard stock ability, but is standing adjacent to an "angel" unit with the "Holy Aura" ability.
Units standing where both the mage of light and the angel affect them, display the accumulation during daylight, but not during night.
Re: [illuminates] ability question
Mage of light does not have ability with id=holyaura.
id: this ability will not be cumulative with other abilities using this id. Must be present if cumulative is anything other than 'yes'.
cumulative: if set to 'yes', the [leadership] value will be added to another [leadership] value= same if have same id=, for other abilities, the highest value between value= or base_value will be chosen.
Though cumulative is quite rarely used so it is possible it does not behave exactly as I would expect. Documentation does not make clear what it changes for non-leadership.
id: this ability will not be cumulative with other abilities using this id. Must be present if cumulative is anything other than 'yes'.
cumulative: if set to 'yes', the [leadership] value will be added to another [leadership] value= same if have same id=, for other abilities, the highest value between value= or base_value will be chosen.
Though cumulative is quite rarely used so it is possible it does not behave exactly as I would expect. Documentation does not make clear what it changes for non-leadership.
Re: [illuminates] ability question
I never said that.
Let's put things back in focus please:
• My cumulative illumination works in daylight (result = daylight bonus + mage bonus + angel bonus).
• My cumulative illumination does not work during night (result = just removes the -15% penalty, like a normal illumination).
My actual question is: Why is that difference?
Cumulative illumination should either not work at all, or work all the time.
There seems to be some quirk in the bonus calculation: It seems that if it starts from a negative value, it can't go over 0.
But if it starts from a > 0 value, it works as expected.
- Spannerbag
- Posts: 951
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [illuminates] ability question
Eh, not tested any of this, just a random thought that might help clarify?
Presumably what you are seeing with regards to a lawful unit adjacent to both a Mage of Light (MoL) and Angel is this:
Disclaimer: all results generated by Spannerbag may contain inaccuracies, hallucinations and/or state the bleedin' obvious.
Cheers!
-- Spannerbag
Presumably what you are seeing with regards to a lawful unit adjacent to both a Mage of Light (MoL) and Angel is this:
- Daytime (morning/Afternoon/Midday): +50%
Lawful unit gets best of (not sum of because they are not cumulative abilties) MoL/Angel (i.e. +25%) + another 25% due to daylight. - Night (First Watch/Second Watch/Midnight): +0%.
Again lawful gets +25% from MoL/Angel but -25% due to darkness so 0% overall.
Disclaimer: all results generated by Spannerbag may contain inaccuracies, hallucinations and/or state the bleedin' obvious.
Cheers!
-- Spannerbag
Re: [illuminates] ability question
What do you mean by "best of"? Best of what?Spannerbag wrote: July 16th, 2026, 12:11 pm Daytime (morning/Afternoon/Midday): +50%
Lawful unit gets best of (not sum of because they are not cumulative abilties) MoL/Angel (i.e. +25%) + another 25% due to daylight.
If I understand you right, you're telling me that those +50% I see are simply daylight + angel, no influence from the MoL?
That does make sense.
So
cumulative=yes only works with the environment? That's harsh.
Is there maybe another way to do it?
I want units near an angel to get an additional bonus (the 50 cap was so if there are 2 or more angels nearby the bonus won't rise into silly numbers).
Re: [illuminates] ability question
I already posted what cumulative is documented to do.
- Celtic_Minstrel
- Developer
- Posts: 2476
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [illuminates] ability question
No. Cumulative basically means "cumulative with itself". If you put two angels next to your guy during the day, I bet you'll see +75%.
- Spannerbag
- Posts: 951
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [illuminates] ability question
Heh, was typing this when Celtic_Minstrel posted so apologies for repeating some info.
I understand the wiki can be a bit overwhelming when you're learning.
Under Common keys and tags for every ability:
The key of interest here is
This, I presume, is for balance otherwise units could accumulate multiple ±25%s making their damage output either insanely high or negligible (=1 I would imagine is the minimum).
In addition, your
So will only be cumulative with other units with this ability (
If I might humbly offer a suggestion: it might be a useful exercise to experiment with having 2+ MoL and Angels on a map and seeing how lawful and chaotic units bonuses change depending on time of day and how many MoLs/Angels they are adjacent to?
This would give you a feel of how the bonuses scale in gameplay.
Depending upon what, exactly, you want your Angel's ability to achieve there may be other ways to do what you want?
If you want a sort of "MoL booster unit" it should be possible to create an
Or, you could customise MoLs for your campaign (it would be possible to arrange this in several ways, most of which could be made transparent to the player so that the player believes they are recruiting normal Mage line units).
Personally I would use
Anyway, hope my witterings help!
Cheers!
-- Spannerbag
I understand the wiki can be a bit overwhelming when you're learning.
Under Common keys and tags for every ability:
Further down under Common keys and tags for abilities with a valueid: this ability will not be cumulative with other abilities using this id. Must be present if cumulative is anything other than 'yes'.
Mainline Mage of Light (MoL) hascumulative: if set to 'yes', the [leadership] value will be added to another [leadership] value= same if have same id=, for other abilities, the highest value between value= or base_value will be chosen.
{ABILITY_ILLUMINATES}, defined in macros→abilities.cfg:Code: Select all
#define ABILITY_ILLUMINATES
# Canned definition of the Illuminates ability to be included in an
# [abilities] clause.
#arg HALO
""#endarg
[illuminates]
id=illumination
value=25
max_value=25
cumulative=no
name= _ "illuminates"
female_name= _ "female^illuminates"
description= _ "This unit illuminates the surrounding area, making lawful units fight better, and chaotic units fight worse.
Any units adjacent to this unit will fight as if it were dusk when it is night, and as if it were day when it is dusk."
special_note={INTERNAL:SPECIAL_NOTES_ILLUMINATES}
affect_self=yes
halo_image={HALO}
[/illuminates]
#enddefcumulative=no meaning that regardless of how many MoLs a unit may be adjacent to it only ever receives a ±25% once.This, I presume, is for balance otherwise units could accumulate multiple ±25%s making their damage output either insanely high or negligible (=1 I would imagine is the minimum).
In addition, your
{ABILITY_HOLY_AURA} has id=holyaura:
Code: Select all
#define ABILITY_HOLY_AURA
# Variation of the Illuminates ability
[illuminates]
id=holyaura
value=25
max_value=50
cumulative=yes
...id=holyaura) so cannot be cumulative with MoL (id=illumination).If I might humbly offer a suggestion: it might be a useful exercise to experiment with having 2+ MoL and Angels on a map and seeing how lawful and chaotic units bonuses change depending on time of day and how many MoLs/Angels they are adjacent to?
This would give you a feel of how the bonuses scale in gameplay.
Depending upon what, exactly, you want your Angel's ability to achieve there may be other ways to do what you want?
If you want a sort of "MoL booster unit" it should be possible to create an
[illuminates] ability that acts like MoL (i.e. +25%) when not adjacent to a MoL but increases this bonus to, say, +75 or +100% or whatever when adjacent to MoL(s) or other Angel(s).Or, you could customise MoLs for your campaign (it would be possible to arrange this in several ways, most of which could be made transparent to the player so that the player believes they are recruiting normal Mage line units).
Personally I would use
cumulative=yes with caution because it could easily unbalance your campaign without some limit on this ability (e.g. number of Angels/MoLs etc.).Anyway, hope my witterings help!
Cheers!
-- Spannerbag
Re: [illuminates] ability question
I see, thanks. Well, I was assuming the "cumulative" part was on the actual "illuminate" function. Admit it could had been...Celtic_Minstrel wrote: July 17th, 2026, 12:44 pm No. Cumulative basically means "cumulative with itself". If you put two angels next to your guy during the day, I bet you'll see +75%.
Re: [illuminates] ability question
Indeed. What I am trying to achieve, is to have a unit type which adds to other illuminating units (MoLs or other). And this especially in the dark, because the whole point of this exercise was improving fighting underground or in strange places (I have lots of them!): I needed a unit which adds a positive bonus (instead of just removing the penalty) to lawful units when the time zone's "lawful_bonus" is 0 (or even negative).Spannerbag wrote: July 17th, 2026, 12:45 pm The key of interest here iscumulative=nomeaning that regardless of how many MoLs a unit may be adjacent to it only ever receives a ±25% once.
Indeed, which is why I capped it to 50.Spannerbag wrote: July 17th, 2026, 12:45 pm This, I presume, is for balance otherwise units could accumulate multiple ±25%s making their damage output either insanely high or negligible
As I said it's capped so you could surround the unit with angels, it wouldn't get more than +50%, I've tested.Spannerbag wrote: July 17th, 2026, 12:45 pm it might be a useful exercise to experiment with having 2+ MoL and Angels on a map and seeing how lawful and chaotic units bonuses change depending on time of day and how many MoLs/Angels they are adjacent to?
This would give you a feel of how the bonuses scale in gameplay.
As I said just above what I want to achieve is to give lawful units a boost underground and in strange places where the base "lawful_bonus" value is negative.Spannerbag wrote: July 17th, 2026, 12:45 pm Depending upon what, exactly, you want your Angel's ability to achieve there may be other ways to do what you want?
Currently I'm experimenting with a variation like:
Code: Select all
#define ABILITY_HOLY_AURA
[illuminates]
id=holyaura
value=35
max_value=50
cumulative=yes
name= _ "holy aura"
description= _ "This unit illuminates the surrounding area, making lawful units fight better, and chaotic units fight worse."
[/illuminates]
#enddef
max_value to prevent it from getting ridiculous in daylight. No, I won't touch stock units. When I need a modified version, I create a new unit and use that instead (like for instance boars, of which I created a much nastier version. The ones I've seen in real life were definitely something to respect...
It's the first thing I thought about and as I said I capped it bySpannerbag wrote: July 17th, 2026, 12:45 pm Personally I would usecumulative=yeswith caution because it could easily unbalance your campaign without some limit on this ability (e.g. number of Angels/MoLs etc.).
max_value=50, so no problem with that.Thanks!
- Celtic_Minstrel
- Developer
- Posts: 2476
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [illuminates] ability question
Just for the record, when someone talks about customizing a core unit, this is pretty much exactly what they mean – it's not a suggestion to edit core files.kurt751 wrote: July 17th, 2026, 3:46 pmNo, I won't touch stock units. When I need a modified version, I create a new unit and use that instead (like for instance boars, of which I created a much nastier version. The ones I've seen in real life were definitely something to respect...).
Re: [illuminates] ability question
My bad.Celtic_Minstrel wrote: July 17th, 2026, 5:32 pm Just for the record, when someone talks about customizing a core unit, this is pretty much exactly what they mean – it's not a suggestion to edit core files.
- Spannerbag
- Posts: 951
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: [illuminates] ability question
OK, got that.kurt751 wrote: July 17th, 2026, 3:46 pm ...Indeed, which is why I capped it to 50.
...
As I said it's capped so you could surround the unit with angels, it wouldn't get more than +50%, I've tested.
...
It's the first thing I thought about and as I said I capped it bymax_value=50, so no problem with that...
What I was thinking of was something like the code below.kurt751 wrote: July 17th, 2026, 3:46 pm Indeed. What I am trying to achieve, is to have a unit type which adds to other illuminating units (MoLs or other). And this especially in the dark, because the whole point of this exercise was improving fighting underground or in strange places (I have lots of them!): I needed a unit which adds a positive bonus (instead of just removing the penalty) to lawful units when the time zone's "lawful_bonus" is 0 (or even negative).
I Have not tested this WML, it's only intended to demonstrate the concept.
Code: Select all
#define ABILITY_HOLY_AURA
[illuminates]
id=holyaura
value=35
max_value=50
cumulative=yes
name= _ "holy aura"
description= _ "This unit illuminates the surrounding area, making lawful units fight better, and chaotic units fight worse."
[filter_adjacent]
ability_id_active=illumination,holyaura
is_enemy=no
count=0
[/filter_adjacent]
[/illuminates]
[illuminates]
id=holyaura_hidden
value=50
max_value=50
cumulative=yes
[filter_adjacent]
ability_id_active=illumination,holyaura
is_enemy=no
count=1-6
[/filter_adjacent]
[/illuminates]
#enddefAlso, it might be possible to set
value= higher than max_value= (not tried, don't know).Even if that's not possible you can test for the time of day via [filter_location] and have multiple hidden versions that activate only under certain times of day - tho' I'm sure people cleverer than me will suggest more elegant solutions!
Hope this helps.
Cheers,
-- Spannerbag