About the [teleport] function.
I believe this is the code of the teleport tag.
Would anyone here be able to create a teleport code that could teleport more than one unit at the same time? Similar to the [animate_unit] tag, where we can animate multiple units at once using [animate].
Is it possible?![Pensive :hmm:]()
Code:
wml_actions.teleport = function(cfg)local context = wesnoth.current.event_contextlocal filter = wml.get_child(cfg, "filter") or { x = context.x1, y = context.y1 }local unit = wesnoth.units.find_on_map(filter)[1]if not unit then-- No error if no unit matches.returnendlocal x,y = cfg.x, cfg.yif cfg.location_id thenx,y = table.unpack(wesnoth.current.map.special_locations[cfg.location_id])endunit:teleport(x, y, cfg.check_passability == false, cfg.clear_shroud ~= false, cfg.animate)end
Would anyone here be able to create a teleport code that could teleport more than one unit at the same time? Similar to the [animate_unit] tag, where we can animate multiple units at once using [animate].
Is it possible?

Statistics: Posted by Saizo-Luz — Yesterday, 11:05 pm