

Since no one was capable of creating a code to do such a thing, I was using the lousy alternative to teleport more than one unit: animate pre_teleport flag, hide units, teleport them with animate=no, unhide and animate post_teleport flag.

The problem was that when I unhide the units, sometimes (not always) they appear before displaying the animation - and that bothered me!


So I decided to take a look at the code of the [unhide_unit] tag. And I realized there was a [redraw] tag in it. Look...
Code:
function wml_actions.unhide_unit(cfg)for i,u in ipairs(wesnoth.units.find_on_map(cfg)) dou.hidden = falseendwml_actions.redraw {} #HERE!end

Code:
function wesnoth.wml_actions.el_unhide_unit(cfg)for i,u in ipairs(wesnoth.units.find_on_map(cfg)) dou.hidden = falseendend

Code:
#define TELEPORT_3_UNITS X Y ONE X1 Y1 TWO X2 Y2 THREE X3 Y3 {ANIMATE_UNIT id={ONE} pre_teleport {ANIMATE id={TWO} pre_teleport {ANIMATE id={THREE} pre_teleport ()}}} [hide_unit] id={ONE},{TWO},{THREE} [/hide_unit] {TELEPORT id={ONE} {X1} {Y1} no} {TELEPORT id={TWO} {X2} {Y2} no} {TELEPORT id={THREE} {X3} {Y3} no} {SCROLL_TO {X} {Y}} [el_unhide_unit] id={ONE},{TWO},{THREE} [/el_unhide_unit] {ANIMATE_UNIT id={ONE} post_teleport {ANIMATE id={TWO} post_teleport {ANIMATE id={THREE} post_teleport ()}}}#enddef

Statistics: Posted by Saizo-Luz — Today, 11:16 am