Apply AMLA effect to other unit
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.
Apply AMLA effect to other unit
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)?
What goes to the ??? part? I couldn't figure it out yet. Thanks!
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]
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Re: Apply AMLA effect to other unit
Advancement could add dummy new_ability, and filter based on that.
Re: Apply AMLA effect to other unit
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.
Re: Apply AMLA effect to other unit
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.
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.
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
- Celtic_Minstrel
- Developer
- Posts: 2207
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Apply AMLA effect to other unit
Setting take_only_once=yes on the object probably won't do what you want - it will mean that the effect happens only the first time a unit of that type chooses that advancement. Using an ID probably won't have the correct effect, either, assuming the idea is to affect units near the advancing unit - it'll mean that any given unit can receive the benefit of the effect exactly once.
If the unit with this advancement is a unique hero unit though, none of that matters; all of the above assumes there could be more than one of the unit on the field.
If the unit with this advancement is a unique hero unit though, none of that matters; all of the above assumes there could be more than one of the unit on the field.