Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [event]
- name=moveto
- first_time_only=no
- [store_unit_type_ids]
- variable=unit_types
- [/store_unit_type_ids]
- [set_variables]
- name=split_list
- mode=replace
- [split]
- list=$unit_types
- key=id
- separator=,
- remove_empty=yes
- [/split]
- [/set_variables]
- {VARIABLE output ""}
- {VARIABLE output1 ""}
- {VARIABLE output2 ""}
- {VARIABLE output3 ""}
- {VARIABLE output4 ""}
- {FOREACH split_list i}
- # dont want other eras
- [if]
- [variable]
- name=split_list[$i].id
- contains="AE"
- [/variable]
- [then]
- [set_variables]
- name=ageless_list
- mode=append
- [value]
- id=$split_list[$i].id
- [/value]
- [/set_variables]
- [/then]
- [/if]
- {NEXT i}
- {FOREACH ageless_list i}
- [unit]
- type=$ageless_list[$i].id
- side=2
- to_variable=unit
- [/unit]
- [if]
- [variable]
- name=unit.level
- equals=0
- [/variable]
- [then]
- [set_variables]
- name=units_zero
- mode=append
- [value]
- id=$ageless_list[$i].id
- [/value]
- [/set_variables]
- #{VARIABLE output ($output tmpdfbr $ageless_list[$i].id|)}
- # With Wesnoth 1.9, [set_variable]format= no longer exists. One must use [set_variable]value=. (See InternalActionsWML.) One should change every {VARIABLE_OP x format y} to {VARIABLE x y}.
- {VARIABLE output "$output,$ageless_list[$i].id"}
- [/then]
- [/if]
- [if]
- [variable]
- name=unit.level
- equals=1
- [/variable]
- [then]
- [set_variables]
- name=units_one
- mode=append
- [value]
- id=$ageless_list[$i].id
- [/value]
- [/set_variables]
- {VARIABLE output1 "$output1,$ageless_list[$i].id"}
- [/then]
- [/if]
- [if]
- [variable]
- name=unit.level
- equals=2
- [/variable]
- [then]
- [set_variables]
- name=units_two
- mode=append
- [value]
- id=$ageless_list[$i].id
- [/value]
- [/set_variables]
- {VARIABLE output2 "$output2,$ageless_list[$i].id"}
- [/then]
- [/if]
- [if]
- [variable]
- name=unit.level
- equals=3
- [/variable]
- [then]
- [set_variables]
- name=units_three
- mode=append
- [value]
- id=$ageless_list[$i].id
- [/value]
- [/set_variables]
- {VARIABLE output3 "$output3,$ageless_list[$i].id"}
- [/then]
- [/if]
- [if]
- [variable]
- name=unit.level
- equals=4
- [/variable]
- [then]
- [set_variables]
- name=units_four
- mode=append
- [value]
- id=$ageless_list[$i].id
- [/value]
- [/set_variables]
- {VARIABLE output4 "$output4,$ageless_list[$i].id"}
- [/then]
- [/if]
- {NEXT i}
- [chat]
- message=_"0: $units_zero.length"
- [/chat]
- [chat]
- message=_"1: $units_one.length"
- [/chat]
- [chat]
- message=_"2: $units_two.length"
- [/chat]
- [chat]
- message=_"3: $units_three.length"
- [/chat]
- [chat]
- message=_"4: $units_four.length"
- [/chat]
- # ONLY ONE AT ONCE, one error >> that is hacky way to be able to copy this from stderr >> one error halts event, so uncomment new one and reload to get other levels
- #[unit]
- # type=$output
- # x=10
- # y=10
- # side=1
- #[/unit]
- #[unit]
- # type=$output1
- # x=10
- # y=10
- # side=1
- #[/unit]
- #[unit]
- # type=$output2
- # x=10
- # y=10
- # side=1
- #[/unit]
- #[unit]
- # type=$output3
- # x=10
- # y=10
- # side=1
- #[/unit]
- [unit]
- type=$output4
- x=10
- y=10
- side=1
- [/unit]
- [/event]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement