Enhanced looping tags for WML
Moderator: Forum Moderators
Re: Enhanced looping tags for WML
I wonder whether it makes sense to add a diffenert type of wml loops:
1)A loop that iterates over a comma sperated list like in
2) A loop that iterates over all childs of wml node (like in iterating over all weapon specialy of an attack, they usually use different tagnames so this canot be done easily with {foreach} )
1)A loop that iterates over a comma sperated list like in
Code: Select all
[foreach]
list="blade,impact,pierce"
variable="damage_type"
[do]
[harm_unit]
...
damage_type="$damage_type"
[/harm_unit]
[/do]
[/foreach]
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
- Pentarctagon
- Project Manager
- Posts: 5565
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Enhanced looping tags for WML
#1 would basically just be a shortcut for [set_variables]/[split], right? That seems like a better candidate for a macro, I think. Either way it would probably make sense to allow the delimiter to be passed in rather than just comma-delimited.
#2 makes sense. To me, the "ideal" solution would be to instead have specials work something like:
though that would probably be more work and would break compatibility with a bunch of add-ons for relatively little gain.
#2 makes sense. To me, the "ideal" solution would be to instead have specials work something like:
Code: Select all
[specials]
[special]
effect="marksman"
...
[/special]
[/specials]
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- Celtic_Minstrel
- Developer
- Posts: 2222
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Enhanced looping tags for WML
#2 can already be done easily in Lua (especially since I made vconfigs iterable), so implementing a WML tag based on it shouldn't be too hard.