--1--
When you write
But the WML you've written is like the following:
So to get that in Lua, you use
--2--
You seem to have left out the actual error message, but it's fairly obvious what's wrong here. When assigning to
Assuming the tag is implemented in Lua, you should be able to find a function called
When you write
config.filter
, you're expecting WML like the following:Code:
[ftest]filter=something[/ftest]
Code:
[ftest][filter]id=whatever[/filter][/ftest]
wml.get_child('filter')
. See here for more info.--2--
You seem to have left out the actual error message, but it's fairly obvious what's wrong here. When assigning to
wml.array_variables.ftest
, the right-hand side must be an array of WML tables. However, you've assigned an array of units instead. You can convert an array of units to an array of WML tables representing the units with the following code:Code:
for i = 1, #units dounits[i] = units[i].__cfgend
The code for most ActionWML tags is located either in data/lua/wml-tags.lua or one of the files in data/lua/wml/. A few are located in other places – data/lua/wml-flow.lua or even in the C++ source code in game_events/action_wml.cpp.I did look for the code for[store_unit]
but couldn't find it - if I've missed it, please let me know where it's located.
Assuming the tag is implemented in Lua, you should be able to find a function called
wml_actions.tag_name
in one of the above files. I believe [store_unit]
is in wml-tags.lua.Statistics: Posted by Celtic_Minstrel — Today, 1:02 pm