Thanks ever so much for your reply, really really helpful.
I think
this results in this filter (plugging in actual values):The structure I'm trying to build is (assuming I'm right so far) is as above but with My attempt (with added comma
):
or, embed filter_adjacent?:
Hope this makes sense.
Thanks again for your patience!
Cheers!
-- Spannerbag
Assuming I correctly deciphered the original code logic:...It looks like you have it right in terms of syntax, except for one error: you're missing a comma in there. Though I'm not sure if that filter is composed correctly.
Code:
-- The tusker moves as close to enemy as possible -- Closeness to tusklets is secondary criterion local adj_tusklets = wesnoth.units.find_on_map { side = wesnoth.current.side, type = cfg.tusklet_type, { "filter_adjacent", { id = target.id } } }
Code:
side = 3 type = Icemonax [filter_adjacent] id=target.id [/filter_adjacent]
type
replaced by a full filter:Code:
side = 3 type = Icemonax [filter_wml] [variables] wmai=1 [/variables] [/filter_wml] [filter_adjacent] id=target.id [/filter_adjacent]

Code:
local adj_followers = wesnoth.units.find_on_map { side = wesnoth.current.side, { "and", filter_follower }, { "and", "filter_adjacent", { id = target.id } } }
or, embed filter_adjacent?:
Code:
local adj_followers = wesnoth.units.find_on_map { side = wesnoth.current.side, { "and", filter_follower, { "and", "filter_adjacent", { id = target.id }} } }
Hope this makes sense.
Thanks again for your patience!
Cheers!
-- Spannerbag
Statistics: Posted by Spannerbag — Yesterday, 3:17 pm