Issue with AMLA Ability Addition in WML

The place to post your WML questions and answers.

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.
Post Reply
bing11
Posts: 2
Joined: October 5th, 2018, 7:43 pm

Issue with AMLA Ability Addition in WML

Post by bing11 »

Hi everyone,

I would like to ask how to prevent the repeated appearance of abilities when adding them through AMLA (Advanced Multilevel Advancement). Specifically, I have a unit where the first AMLA choice is Leadership, and the remaining unchosen AMLA option is Heal. However, when I try to apply AMLA again, the options for Heal appear twice in the menu (Heal, Heal).

Currently, my WML script is unable to resolve this issue. Any advice or suggestions would be greatly appreciated.
Shiki
Developer
Posts: 373
Joined: July 13th, 2015, 9:53 pm
Location: Germany

Filtering!

Post by Shiki »

With filtering. The [advancement] tag accepts a [filter] tag.

Code: Select all

[advancement]
    [filter]
        [not]
            ability=healing
            # this will exclude units which have the mainline ability to heal +4 and +8
            # ability_type=heals would exclude any healing ability and also curing
        [/not]
This would not offer the advancement option in the advancement dialogue. But if the advancement option would still be useful, and you just want to avoid that the ability is given twice, one can filter at other places instead. Below two examples, one for the heals ability, and one with a weapon special instead.

Code: Select all

[effect]
    apply_to=new_ability
    [filter]
        [not]
            ability=healing
        [/not]
    [/filter]
    
    [abilities]
        {ABILITY_HEALS}
    [/abilities]
[/effect]

[effect]
    apply_to=attack
    range=melee
    # No filter tag here. If one is used, it checks if the unit has such an attack.
    # Without filter tag it checks if this attack passes the filter.
    [not]
        special_id=firststrike
    [/not]
    [set_specials]
        mode=append
        {WEAPON_SPECIAL_FIRSTSTRIKE}
    [/set_specials]
[/effect]
Try out the dark board theme.
bing11
Posts: 2
Joined: October 5th, 2018, 7:43 pm

Re: Issue with AMLA Ability Addition in WML

Post by bing11 »

Thank you! But I may not have expressed myself clearly.

Below is the WML code I am currently using. The issue right now is that basic abilities and the "loyal" trait do not appear multiple times, but abilities like Heal, Leadership, and Illuminates do.

For example, if I don't choose Leadership the first time and instead select Heal, then on the second AMLA, both Leadership and Illuminates will appear twice in the selection menu.
螢幕擷取畫面 (246).png
螢幕擷取畫面 (247).png
螢幕擷取畫面 (248).png
AMLA.cfg
(38.61 KiB) Downloaded 41 times
User avatar
lhybrideur
Posts: 454
Joined: July 9th, 2019, 1:46 pm

Re: Issue with AMLA Ability Addition in WML

Post by lhybrideur »

That can easily be explained.
In your code (that is poorly incremented BTW), there is a check to see if the loyal amla has already been taken, but neither for leadership nor for illuminate.
Post Reply