conditional modify unit type

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
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

conditional modify unit type

Post by CookieLord »

Is it possible to have a [modify_unit_type] tag conditional of an option.
this is my [checkbox] nested in an [option] tag.

Code: Select all

		[checkbox]
			id=eoua_nightblade
			name=_"Orcish Nightblade"
			description=_"Allow Orcish Slayer to advance to Orcish Nightblade"
		[/checkbox]

Code: Select all

	[if]
		[variable]
			name=eoua_nightblade
			boolean_equals=true
		[/variable]
		[then]
			[modify_unit_type]
				type="Orcish Slayer"
				add_advancement="Orcish Nightblade"
			[/modify_unit_type]
		[/then]
	[/if]
Am I using the [if] tag incorrectly or is this not possible the way I'm trying it?
All of this is in a [modification] top level tag.
User avatar
Celtic_Minstrel
Developer
Posts: 2166
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: conditional modify unit type

Post by Celtic_Minstrel »

No. [modify_unit_type] is not an ActionWML tag. It can only go in an addon (like [campaign]).

If you want the advancement to depend on a variable, you can handle "unit placed" and/or "advance" events and use [modify_unit] or [object] (or both) to add the advancement.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
CookieLord
Posts: 19
Joined: June 22nd, 2022, 8:57 pm

Re: conditional modify unit type

Post by CookieLord »

thanks
Post Reply