Usage of variation
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.
Usage of variation
It looks to me like the only ways to make a unit switch to one of its [variation]s are either to have an [object] give it to the unit, or store the unit and set $temp.variation equal to the name of the variation. I have elected to do the latter, since [object] was acting funny. So...
My question is, how can I later REMOVE the variation? I tried setting $temp.variation to a null string, and I tried clearing $temp.variation (using [clear_variable]); neither worked.
Here's the code I used (for the latter method):
AT SOME POINT IN START EVENT:
AT SOME POINT LATER IN THE SCENARIO:
Giving him the initial variation is working, but when I try to take it away, it doesn't. It leaves him exactly as he was before.
My question is, how can I later REMOVE the variation? I tried setting $temp.variation to a null string, and I tried clearing $temp.variation (using [clear_variable]); neither worked.
Here's the code I used (for the latter method):
AT SOME POINT IN START EVENT:
Code: Select all
[store_unit]
[filter]
description=Ravanal
[/filter]
variable=temp
kill=yes
[/store_unit]
[set_variable]
name=temp.variation
value=invisible
[/set_variable]
[unstore_unit]
variable=temp
[/unstore_unit]
[clear_variable]
name=temp
[/clear_variable]
Code: Select all
[store_unit]
[filter]
description=Ravanal
[/filter]
variable=temp
kill=yes
[/store_unit]
[clear_variable]
name=temp.variation
[/clear_variable]
[unstore_unit]
variable=temp
[/unstore_unit]
[clear_variable]
name=temp
[/clear_variable]
Giving him the initial variation is working, but when I try to take it away, it doesn't. It leaves him exactly as he was before.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm
As far as I know effects can't be erased. What if you invoked variation 1 then later on invoke variation 2? Make variation 2 be identical to the normal version of the unit. The Battle for Wesnoth in SVN uses an invisible object to invoke a variation if you want an example.
Edit: what about this?
Edit: what about this?
turin wrote: AT SOME POINT LATER IN THE SCENARIO:Code: Select all
[store_unit] [filter] description=Ravanal [/filter] variable=temp kill=yes [/store_unit] {VARIABLE temp.variation (" ")} [unstore_unit] variable=temp [/unstore_unit] [clear_variable] name=temp [/clear_variable]
Hope springs eternal.
Wesnoth acronym guide.
Wesnoth acronym guide.

For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
And I hate stupid people.
The World of Orbivm