Apply AMLA effect to other unit

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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
User avatar
WhiteWolf
Forum Regular
Posts: 589
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Apply AMLA effect to other unit

Post by WhiteWolf »

Hello,

I wish create an [advancement], that has it's effect not on the advancing unit, but some other units when it selected.
I see that [effect] accepts a [filter] argument, but doesn't seem to work - the advancement seems to force its effects only on the advancing unit, so using a filter with another unit means it won't match and nothing happens.

So I thought I'd make the advancement a dummy choice, and I'd use a post advance event. However, how do I filter in the event for the chosen advancement (there are lots of available options)?

Code: Select all

[event]
    name=post advance
    [filter]
        id=the_advancing_unit
        ????? -> Only if the advancement with "dummy_adv_foo_id" had been chosen
    [/filter]
[/event]
What goes to the ??? part? :D I couldn't figure it out yet. Thanks!
Author of the Underness Series, consisting of V parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Standalone works: The Ravagers - now for 1.14, with new bugs!

User avatar
Ravana
Forum Moderator
Posts: 2286
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Apply AMLA effect to other unit

Post by Ravana »

Advancement could add dummy new_ability, and filter based on that.

gfgtdf
Developer
Posts: 1213
Joined: February 10th, 2013, 2:25 pm

Re: Apply AMLA effect to other unit

Post by gfgtdf »

Note that your solution might add the bo uses again the next time the unit advances oven if the player chooses a different advancement at that time. So in your post advance event you need to add some code to remember that the effects are already applied. But ravanas solution is probably what if also do. ( Or use an effect that sets a variable)
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.

User avatar
WhiteWolf
Forum Regular
Posts: 589
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Apply AMLA effect to other unit

Post by WhiteWolf »

Perfect, thanks :)

The modifications to the other unit are done through an object with an ID and take_only_once=yes, that should prevent it from getting stacked up. :)
Author of the Underness Series, consisting of V parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Standalone works: The Ravagers - now for 1.14, with new bugs!

Post Reply