Catching an advance event filtered by the level-up unit type
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.
Catching an advance event filtered by the level-up unit type
I want to apply a modification of a unit when it levels up to a certain advancement type.
I tried to rely on the
My problem is that the
Anyone knows if there is a known way to apply a change to a unit on advancement based on the unit type that will be created after the level-up is completed?
PS: I considered
I tried to rely on the
name=post advance
event as it is documented to be applied after the unit is replaced by the new unit.My problem is that the
[filter] type=...
seems to be applied using the original unit type (before level up).Anyone knows if there is a known way to apply a change to a unit on advancement based on the unit type that will be created after the level-up is completed?
PS: I considered
name=unit placed
too but as documented it doesn't cover the case of advancement.-
- Code Contributor
- Posts: 172
- Joined: October 6th, 2017, 12:57 pm
Re: Catching an advance event filtered by the level-up unit type
try with
Code: Select all
[filter] advances_to=..
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: Catching an advance event filtered by the level-up unit type
I tried this, and it worked fine for me. The [filter] applied to the new type of the unit, and the [unit] variable also held the new type. It seems like your problem must be somewhere else. If you posted your code, someone could probably find it pretty quickly.
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
Re: Catching an advance event filtered by the level-up unit type
I started adding filters to go from a situation where the event was fired much too often to a situation where it didn't happen anymore.beetlenaut wrote: ↑December 10th, 2021, 1:18 am The [filter] applied to the new type of the unit, and the [unit] variable also held the new type.
I missed the sweet spot where the event is happening just at the right time. I think I am there right now. Thanks for trying that.