ForestDragon's WML questions
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.
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: ForestDragon's WML questions
i tested, it workedzookeeper wrote:That cannot work. There's no [unit] tag to filter for in a unit any more than there is a [unit_type] tag.
EDIT: oh, well, it didn't. i guess i could do like this: $storedunit.undead_variation maybe?
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
- skeptical_troll
- Posts: 500
- Joined: August 31st, 2015, 11:06 pm
Re: ForestDragon's WML questions
I think what you need is simply
i.e. inside the 'filter wml' tag you should put exactly what you expect to find inside the unit description with inspect
Code: Select all
[filter]
[filter_wml]
undead_variation="mounted"
[/filter_wml]
[/filter]
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: ForestDragon's WML questions
oh, ok, thanks, i'll try it that wayskeptical_troll wrote:I think what you need is simplyi.e. inside the 'filter wml' tag you should put exactly what you expect to find inside the unit description with inspectCode: Select all
[filter] [filter_wml] undead_variation="mounted" [/filter_wml] [/filter]
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: ForestDragon's WML questions
hi, i am having problems with making an ability like illuminates, that affects only enemies, i tried so far, but i doesn't work:
Code: Select all
[illuminates]
id=illumination_enemy
value=25
max_value=25
cumulative=no
name= _ "illuminates (enemies only)"
female_name= _ "female^illuminates (enemies only)"
description= _ "This unit illuminates the surrounding area, making enemy chaotic units fight worse.
Any units adjacent to this enemies will fight as if it were dusk when it is night, and as if it were day when it is dusk."
affect_self=yes
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[/affect_adjacent]
[/illuminates]
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
Re: ForestDragon's WML questions
How would self be enemy?affect_self=yes
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: ForestDragon's WML questions
ooops, thanks for helping me noticeRavana wrote:How would self be enemy?affect_self=yes
i guess this will do?:
Code: Select all
[illuminates]
id=illumination_enemy
value=25
max_value=25
cumulative=no
name= _ "illuminates (enemies only)"
female_name= _ "female^illuminates (enemies only)"
description= _ "This unit illuminates the surrounding area, making enemy chaotic units fight worse.
Any units adjacent to this enemies will fight as if it were dusk when it is night, and as if it were day when it is dusk."
affect_self=no
affect_allies=no
affect_enemies=yes
[affect_adjacent]
adjacent=n,ne,se,s,sw,nw
[/affect_adjacent]
[/illuminates]
Last edited by ForestDragon on August 3rd, 2016, 2:54 pm, edited 1 time in total.
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: ForestDragon's WML questions
You also don't filter for the enemy anywhere.
Edit: Okay, now you do. That should work.
Edit: Okay, now you do. That should work.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: ForestDragon's WML questions
works now, thanks! you guys are very helpful unlike some communities where the only thing moderators/admins really do is banning
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: ForestDragon's WML questions
hi, so, i am having trouble with having an ability use a [set_menu_item] tag in an event, her is how i done it:
the [dummy] ability tag is working, but not the event/set_menu_item tag
Code: Select all
#define ABILITY_AVIAN_FLIGHT
[dummy]
id=Avian_Flight
name= _"flight"
description = _"This unit can fly. Open the right-click menu to activate flight."
[/dummy]
[/abilities]
#fly menu item
[event]
name=start
first_time_only=no
[set_menu_item]
id=Avian_Flight
description = _"Take off"
[filter_location]
[filter]
ability=Avian_Flight
[filter_wml]
[not]
moves=0
[/not]
[/filter_wml]
side=$side_number
[/filter]
[/filter_location]
#[default_hotkey] ###soon
#key = v
#[/default_hotkey]
[command]
[animate_unit]
flag=flying
[/animate_unit]
[store_unit]
[filter]
x,y=$x1,$y1
[/filter]
variable=unit_to_fly
[/store_unit]
[modify_unit]
[filter]
x,y=$x1,$y1
[/filter]
variation=flying
[/modify_unit]
[modify_unit]
[filter]
x,y=$x1,$y1
[/filter]
moves=$($this_unit.moves - 1)
[/modify_unit]
[/command]
[/set_menu_item]
[/event]
[+abilities]
#enddef
#define ABILITY_AVIAN_LAND
[dummy]
id=Avian_Land
name= _"land"
description = _"This unit can land. Open the right-click menu to land."
[/dummy]
[/abilities]
#land menu item
[event]
name=start
first_time_only=no
[set_menu_item]
id=Avian_Land
description = _"Land"
[filter_location]
[filter]
ability=Avian_Land
side=$side_number
[/filter]
[/filter_location]
[command]
[animate_unit]
flag=landing
[/animate_unit]
[store_unit]
[filter]
x,y=$x1,$y1
[/filter]
variable=unit_to_land
[/store_unit]
[modify_unit]
[filter]
x,y=$x1,$y1
[/filter]
variation=none
[/modify_unit]
[/command]
[/set_menu_item]
[/event]
[+abilities]
#enddef
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
- skeptical_troll
- Posts: 500
- Joined: August 31st, 2015, 11:06 pm
Re: ForestDragon's WML questions
Not sure if this is your case, but if this [event] tag is inside a [unit] description, then it is mandatory to specify the event 'id' keyword
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: ForestDragon's WML questions
hmmm... never tried that, might try, thanksskeptical_troll wrote:Not sure if this is your case, but if this [event] tag is inside a [unit] description, then it is mandatory to specify the event 'id' keyword
EDIT:still not working
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
- skeptical_troll
- Posts: 500
- Joined: August 31st, 2015, 11:06 pm
Re: ForestDragon's WML questions
hmm, could it be due to the fact that it is triggered by'start' and maybe at the start you don't have units with that ability? Try triggering it at 'recall' /'recruit', or whenever you expect such units to appear?
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: ForestDragon's WML questions
hmmm... that's an interesting ideaskeptical_troll wrote:hmm, could it be due to the fact that it is triggered by'start' and maybe at the start you don't have units with that ability? Try triggering it at 'recall' /'recruit', or whenever you expect such units to appear?
EDIT: works now, i used a 'moveto' event name
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
- ForestDragon
- Posts: 1771
- Joined: March 6th, 2014, 1:32 pm
- Location: Ukraine
Re: ForestDragon's WML questions
hi, i am making an improved ai, since all of it's unit are chaotic, i wanted to make it work differently during day, so far everything looks fine, but i want to make a filter to make it NOT avoid unit with less than half of their hp, here is the current state of the [avoid] tag inside the ai (the 'hitpoints=' is empty due to the fact that i don't know how to do it):
Code: Select all
[avoid]
[filter]
side=1,2
[not]
level=0
[or]
[filter_wml]
hitpoints=
[/filter_wml]
[/or]
[/not]
[/filter]
radius=2
[/avoid]
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
Re: ForestDragon's WML questions
I would use something like
Code: Select all
formula="(($this_unit.max_hitpoints -1+1) / ($this_unit.hitpoints -1+1)) > 2"