movement question
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.
movement question
Is there a way to increase a unit's movement for a limited amount of time, say 1 turn? If so then can someone tell me what it is.
Thanks.
Thanks.
- Luke the Flaming
- Posts: 215
- Joined: October 18th, 2006, 6:25 pm
Re: movement question
Have an [event] triggering when you wish (using proper name= and [filter] ) to:
-) store the unit;
-) modify its movement (+1);
-) add a variable (let's say "extra_mov=yes") in its [variables] ;
-) unstore the unit.
Have another [event] with name=side 1 turn (assuming it's side 1 that you want to affect, otherwise modify it accordingly; and don't forget first_time_only=no !) storing units with extra_mov=yes (use [filter_wml] inside [filter] ), reducing their movement by 1, removing the extra_mov variable and unstoring them.
If you want effects lasting longer than 1 turn (e.g. 3), set extra_mov="$turn_number+3" rather than "yes" and check when extra_mov is equal to $turn_number to end the effect.
-) store the unit;
-) modify its movement (+1);
-) add a variable (let's say "extra_mov=yes") in its [variables] ;
-) unstore the unit.
Have another [event] with name=side 1 turn (assuming it's side 1 that you want to affect, otherwise modify it accordingly; and don't forget first_time_only=no !) storing units with extra_mov=yes (use [filter_wml] inside [filter] ), reducing their movement by 1, removing the extra_mov variable and unstoring them.
If you want effects lasting longer than 1 turn (e.g. 3), set extra_mov="$turn_number+3" rather than "yes" and check when extra_mov is equal to $turn_number to end the effect.
O, Wind, if Winter comes, can Spring be far behind?
-
- Inactive Developer
- Posts: 2461
- Joined: August 15th, 2008, 8:46 pm
- Location: Germany
Re: movement question
If it's just one turn for some specific units, do {VARIABLE unit.moves $new_movement} (store it previously, unstore afterwards), in the next turn it'll be unit.max_moves again, then.
A good way to let something happen a fixed number of turns than something else is a structure like (untested)
A good way to let something happen a fixed number of turns than something else is a structure like (untested)
Code: Select all
[event]
{VARIABLE turns "$($turn_number + 1)"}
[event]
name=turn $turns
delayed_variable_substitution=no
[/event]
[/event]
projects (BfW 1.12):
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign
A Simple Campaign: campaign draft for wml starters • Plan Your Advancements: mp mod
The Earth's Gut: sp campaign • Settlers of Wesnoth: mp scenario • Wesnoth Lua Pack: lua tags and utils
updated to 1.8 and handed over: A Gryphon's Tale: sp campaign