Conditional advancement path?

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
Mathel
Posts: 39
Joined: May 26th, 2017, 1:34 pm

Conditional advancement path?

Post by Mathel »

I am building a campaign, and I want a particular unit to be able to advace into another unit, if certain conditions are met.
These conditions would be checked at the start of each scenario, through a variable.

Is it possible, and if so, how?

I tried to look up the definition of ENABLE_ANCIENT_LICH (or a similar macro) in hopes it would help, but could not find it, nor the file that is supposed to contain it.
User avatar
Straff
Posts: 85
Joined: September 27th, 2020, 2:53 pm

Re: Conditional advancement path?

Post by Straff »

I would wait until that particular condition is done, and then add that special advancement to the unit via [ object]
Mathel
Posts: 39
Joined: May 26th, 2017, 1:34 pm

Re: Conditional advancement path?

Post by Mathel »

*facepalms*

[object]. I was trying something similar, with just [modify_unit], which was not working. I will try this.

Edit: I did get it to work with [object]
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Conditional advancement path?

Post by vghetto »

Depending on how you write it, you might need to remove the object after it advances, otherwise it would advance back into that type.
User avatar
Celtic_Minstrel
Developer
Posts: 2166
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Conditional advancement path?

Post by Celtic_Minstrel »

That's easy to avoid, just make the [effect] conditional on the unit being of its original type.

Other than using an [object], a conditional advancement could also be done with an AMLA, which can directly transform the unit's type and thus look outwardly like a regular advancement… although that route makes more sense if you want all units of a given type to have access to that advancement under certain conditions.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
User avatar
beetlenaut
Developer
Posts: 2814
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: Conditional advancement path?

Post by beetlenaut »

The ENABLE_ANCIENT_LICH macro uses [modify_unit_type], which apparently can't go in a scenario anyway. It's in data/core/macros/optional_unit_advancements.cfg if you are still interested in taking a look at it.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Post Reply