Use [modify_unit] for MODIFY_UNIT
This commit is contained in:
parent
238a489444
commit
02ecc00b76
1 changed files with 6 additions and 20 deletions
|
@ -299,33 +299,19 @@
|
|||
#enddef
|
||||
|
||||
#define MODIFY_UNIT FILTER VAR VALUE
|
||||
# Alters a unit variable (such as unit.x, unit.type,
|
||||
# unit.side), handling all the storing and unstoring.
|
||||
# Alters a specific unit variable for units matching FILTER
|
||||
# Eg, unit.x, unit.type, unit.side
|
||||
#
|
||||
# Example that flips all spearmen to side 2:
|
||||
#! {MODIFY_UNIT type=Spearman side 2}
|
||||
[store_unit]
|
||||
|
||||
[modify_unit]
|
||||
[filter]
|
||||
{FILTER}
|
||||
[/filter]
|
||||
|
||||
variable=MODIFY_UNIT_store
|
||||
kill=yes
|
||||
[/store_unit]
|
||||
|
||||
{FOREACH MODIFY_UNIT_store MODIFY_UNIT_i}
|
||||
[set_variable]
|
||||
name=MODIFY_UNIT_store[$MODIFY_UNIT_i].{VAR}
|
||||
value={VALUE}
|
||||
[/set_variable]
|
||||
|
||||
[unstore_unit]
|
||||
variable=MODIFY_UNIT_store[$MODIFY_UNIT_i]
|
||||
find_vacant=no
|
||||
[/unstore_unit]
|
||||
{NEXT MODIFY_UNIT_i}
|
||||
|
||||
{CLEAR_VARIABLE MODIFY_UNIT_store,MODIFY_UNIT_i}
|
||||
{VAR}={VALUE}
|
||||
[/modify_unit]
|
||||
#enddef
|
||||
|
||||
#define MOVE_UNIT_BY FILTER OFFSET_X OFFSET_Y
|
||||
|
|
Loading…
Add table
Reference in a new issue