[illuminate], negative values, and a workaround.
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.
[illuminate], negative values, and a workaround.
I've been working on a darkens/deluminates ability for a faction i've been toying around with. However, recently i've run into a problem with the abilities of one of my units.
Apparently the [Illuminates] tag doesn't allow for specifying how low (negative, chaotic) a value can go globally, like it does for positive values (the actual illuminates ability). Meaning that an ability I've been working on doesn't work as intended
I've been trying to make a workaround using [if][not][then] tags and a location filter, however wesnoth refuses to recognize the location filter on time_of_day
Here is my current code.
Obviously this code would only work during day (I'm planning on adding in a [not] tag if I can get it to work), however right now it works all of the time.
Any thoughts?
Apparently the [Illuminates] tag doesn't allow for specifying how low (negative, chaotic) a value can go globally, like it does for positive values (the actual illuminates ability). Meaning that an ability I've been working on doesn't work as intended
I've been trying to make a workaround using [if][not][then] tags and a location filter, however wesnoth refuses to recognize the location filter on time_of_day
Here is my current code.
Code: Select all
1.
#define ABILITY_DELUMINATES
2.
3.
# definition of the Deluminates ability
4.
# [abilities] clause.
5.
6.
[illuminates]
7.
8.
[if]
9.
[have_location]
10.
time_of_day=lawful
11.
[/have_location]
12.
[then]
13.
value=-25
14.
[/then]
15.
[else]
16.
value=0
17.
18.
19.
[/else]
20.
[/if]
21.
22.
id=delumination
23.
24.
25.
cumulative=no
26.
27.
name= _ "deluminates"
28.
29.
description= _ "Deluminates:
30.
This unit
31.
32.
dluminates the surrounding area, making chaotic
33.
34.
units fight better, and lawful units fight worse.
35.
36.
Any units adjacent to this unit will fight as if it
37.
38.
were dawn when it is day, and as if it were night
39.
40.
when it is dawn."
41.
affect_self=yes
42.
[/illuminates]
43.
#enddef
Any thoughts?
~Jami
Re: [illuminate], negative values, and a workaround.
You're not the first to think this one up.
Code: Select all
#define ABILITY_DARKENS
[illuminates]
id=darkens
# The next filter is a workaround thought by zookeeper as a substitute for the non working min_value=-25 limit, making this ability not give double TOD bonus/penalty at night. When/if a support for the min_value key inside illuminates is added, the filter will be redundant and should be removed
[filter]
[not]
[filter_location]
time_of_day=chaotic
[/filter_location]
[/not]
[/filter]
value=-25
min_value=-25
max_value=0
cumulative=no
name= _ "darkens"
description= _ "Darkens:
This unit covers the surrounding area in a shroud of darkness, making chaotic units fight better, and lawful units fight worse.
Any units adjacent to this unit will fight as if it were night when it is dusk, and as if it were dusk when it is day."
affect_self=yes
[/illuminates]
#enddef
Re: [illuminate], negative values, and a workaround.
Similar to the above:
Note: [if] tag and children are not valid inside [illumiates] therefore we use [filter_xxxx]
Code: Select all
[illuminates]
id=delumination
[filter_adjacent_location]
time_of_day = lawful
[/filter_adjacent_location]
cumulative=no
name= _ "deluminates"
value=-25
max_value=0
affect_enemies=yes
affect_allies=no
affect_self=no
description= _ "Deluminates:
...
[/illuminates]
Re: [illuminate], negative values, and a workaround.
The main difference between the two is whether it works at dawn/dusk, which I think it should.
Re: [illuminate], negative values, and a workaround.
Neither implementation is causing the ability to respect TOD in any way. :/
~Jami
Re: [illuminate], negative values, and a workaround.
What about this for the filter:
Code: Select all
[filter_self]
[filter_location]
time_of_day = lawful
[/filter_location]
[/filter_self]
Re: [illuminate], negative values, and a workaround.
That did it.
I suppose what we had been trying before didn't tell the game what location to filter, so it was just ignoring the filter, or something like that.
Thanks governor ^^v
I suppose what we had been trying before didn't tell the game what location to filter, so it was just ignoring the filter, or something like that.
Thanks governor ^^v
~Jami
Re: [illuminate], negative values, and a workaround.
Actually Shadow Master created an ability called "obscure" which is the opposite of illuminate. It is currently used in his campaign, IFtU, and will be implemented in mine.
Re: [illuminate], negative values, and a workaround.
Does it work? Sorry, I haven't really tested it in-depth to make sure it does.Espreon wrote:Actually Shadow Master created an ability called "obscure" which is the opposite of illuminate. It is currently used in his campaign, IFtU, and will be implemented in mine.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Re: [illuminate], negative values, and a workaround.
For my part I'm not sure, I always paired Our beloved lich with the Shide having the opposite effect, and don't know what happens if both habilities clash :pShadow Master wrote:Does it work? Sorry, I haven't really tested it in-depth to make sure it does.
However, I think that obscures also appears on Ken oh abilities era, so you can check it too for reassure it works.
"Mysteries are revealed in the light of reason."
Re: [illuminate], negative values, and a workaround.
Ummm, yeah it does! It works beautifully on my beloved Death Knights/Barons and my other undead minions.Shadow Master wrote:Does it work? Sorry, I haven't really tested it in-depth to make sure it does.Espreon wrote:Actually Shadow Master created an ability called "obscure" which is the opposite of illuminate. It is currently used in his campaign, IFtU, and will be implemented in mine.