How to filter on AMLA chosen in post advance event?
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.
How to filter on AMLA chosen in post advance event?
how can I find out in "advance" and "post advance" events what advancement was chosen by player?
EDIT: there may be no point in doing so in "advance" event as gfgtdf pointed out
EDIT: there may be no point in doing so in "advance" event as gfgtdf pointed out
Last edited by lea on December 27th, 2016, 8:21 pm, edited 2 times in total.
author of: Altered Era/Ruleset (AKA "Altera"), latest version is on add-ons servers for BfW 1.16 and 1.14, latest version also still supports BfW 1.12 and 1.10, 1.10 server is stuck with older buggy version)
Re: How to filter on AMLA chosen in post advance event?
With [filter_wml]? Check with :inspect how the advancements appear in units, and write a corresponding filter which will match if the unit has advancement X.
Re: How to filter on AMLA chosen in post advance event?
The "advance" event fire after the advancement is cosen but before it is added to the unit. Afaik there is no way to know which advancements waas chosen.
The "post advance" event fires after the modification was added ot the unit so you can just check the last [advancement] addded to that unit
The "post advance" event fires after the modification was added ot the unit so you can just check the last [advancement] addded to that unit
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: How to filter on AMLA chosen in post advance event?
I would like to detect that certain advancement was chosen, not if it is present on unit (perhaps from previous advances). is it possible to get a list of advancements from $unit variable or result of [store_unit] tag?zookeeper wrote:With [filter_wml]? Check with :inspect how the advancements appear in units, and write a corresponding filter which will match if the unit has advancement X.
author of: Altered Era/Ruleset (AKA "Altera"), latest version is on add-ons servers for BfW 1.16 and 1.14, latest version also still supports BfW 1.12 and 1.10, 1.10 server is stuck with older buggy version)
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: How to filter on AMLA chosen in post advance event?
You can use :inspect to find all the keys that are stored using [store_unit]. ($unit is the same, it's just automatically stored.) The key advances_to holds a comma-separated list of advancements. You can load that list into an array using [split] in [set_variables].lea wrote:is it possible to get a list of advancements from $unit variable or result of [store_unit] tag?
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: How to filter on AMLA chosen in post advance event?
thanks, will last chosen one be always last in this list? experiments supply this assumption but could not find any info on that on the wikibeetlenaut wrote:You can use :inspect to find all the keys that are stored using [store_unit]. ($unit is the same, it's just automatically stored.) The key advances_to holds a comma-separated list of advancements. You can load that list into an array using [split] in [set_variables].lea wrote:is it possible to get a list of advancements from $unit variable or result of [store_unit] tag?
author of: Altered Era/Ruleset (AKA "Altera"), latest version is on add-ons servers for BfW 1.16 and 1.14, latest version also still supports BfW 1.12 and 1.10, 1.10 server is stuck with older buggy version)
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: How to filter on AMLA chosen in post advance event?
No, that list just contains the unit types the unit can level into. I think I was answering the wrong question, so this isn't what you need.
The [advancement] that gfgtdf mentioned is an array of AMLAs that you can access with [store_unit]. In that list, the last one would always be the most recently chosen. (Unless they are added in reverse order, in which case it would be the first. I don't remember which way it goes.)
The [advancement] that gfgtdf mentioned is an array of AMLAs that you can access with [store_unit]. In that list, the last one would always be the most recently chosen. (Unless they are added in reverse order, in which case it would be the first. I don't remember which way it goes.)
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: How to filter on AMLA chosen in post advance event?
note that the actual tagnames has changes in 1.13 from [advance] to [advancement]to you miht need some
#ifdef here to make sure your code works in 1.12 and 1.13
#ifdef here to make sure your code works in 1.12 and 1.13
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: How to filter on AMLA chosen in post advance event?
it works and since my advancement can be removed (it has no lasting effects but I did not know that advancements can be removed with [clear_variable]) I can search for it in a loopbeetlenaut wrote:No, that list just contains the unit types the unit can level into. I think I was answering the wrong question, so this isn't what you need.
The [advancement] that gfgtdf mentioned is an array of AMLAs that you can access with [store_unit]. In that list, the last one would always be the most recently chosen. (Unless they are added in reverse order, in which case it would be the first. I don't remember which way it goes.)
thanks to everybody for help
author of: Altered Era/Ruleset (AKA "Altera"), latest version is on add-ons servers for BfW 1.16 and 1.14, latest version also still supports BfW 1.12 and 1.10, 1.10 server is stuck with older buggy version)