animated teleport in/out of recall list
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
animated teleport in/out of recall list
Hi. I created a Silver Mage on the recall list.
I'd like him to appear in a village (32,4) and display the fancy teleport animation when he arrives. And when he's done delivering his message, I'd like him to teleport away with the fancy teleport animation.
Evidently I'm not using the teleport macros correctly. How do you do this thing? Thanks.
I'd like him to appear in a village (32,4) and display the fancy teleport animation when he arrives. And when he's done delivering his message, I'd like him to teleport away with the fancy teleport animation.
Evidently I'm not using the teleport macros correctly. How do you do this thing? Thanks.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: animated teleport in/out of recall list
It's not too hard to do this with [animate_unit]. Teleporting in would be
As I recall, the teleport macros are built for teleporting from one location to another, so they don't really apply in this case.
flag=post_teleport
, and teleporting out would be flag=pre_teleport
.As I recall, the teleport macros are built for teleporting from one location to another, so they don't really apply in this case.
Re: animated teleport in/out of recall list
Thanks. I got it halfway working.Celtic_Minstrel wrote: ↑December 30th, 2022, 5:03 am It's not too hard to do this with [animate_unit]. Teleporting in would beflag=post_teleport
, and teleporting out would beflag=pre_teleport
.
As I recall, the teleport macros are built for teleporting from one location to another, so they don't really apply in this case.
Teleporting away works great:
Code: Select all
[animate_unit]
[filter]
x,y=32,4
[/filter]
flag=pre_teleport
[/animate_unit]
[put_to_recall_list]
id=Byrin
[/put_to_recall_list]
Code: Select all
[recall]
id=Byrin
x,y=32,4
[/recall]
[animate_unit]
[filter]
x,y=32,4
[/filter]
flag=post_teleport
[/animate_unit]
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: animated teleport in/out of recall list
I found a work-around to make the Silver Mage appear in a village with his teleport animation.
Instead of creating the Silver Mage into a recall list, I put him in a distant corner of the map, and therefore not visible. With the map focused on the side 1 Leader, I used
The only downside is that I can see his tiny color square in the mini-map. But it works; his cool teleport animation displays.
If there is a more direct way to accomplish the same thing, please let me know.
Instead of creating the Silver Mage into a recall list, I put him in a distant corner of the map, and therefore not visible. With the map focused on the side 1 Leader, I used
[lock_view]
to prevent scrolling, then I had the Silver Mage teleport into the village near the side 1 Leader. After his arrival, I used [unlock_view]
to allow scrolling.The only downside is that I can see his tiny color square in the mini-map. But it works; his cool teleport animation displays.
If there is a more direct way to accomplish the same thing, please let me know.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: animated teleport in/out of recall list
Hmm. This is pretty much identical to what I do in Black Cross of Aleron, except that the unit is placed withHelmet wrote: ↑December 30th, 2022, 5:38 am Arriving with the cool teleportation animation doesn't work correctly. The unit arrives in the village via recall, then disappears for a split second and arrives with the teleportation animation. So he's arriving twice. I need to get rid of the first arrival somehow.
Code: Select all
[recall] id=Byrin x,y=32,4 [/recall] [animate_unit] [filter] x,y=32,4 [/filter] flag=post_teleport [/animate_unit]
[unit]
rather than [recall]
. Does it maybe work if you change the tag? If it does, then that suggests a bug in [recall]
; if it still doesn't work it suggests a more general bug.(Note: I believe the
[unit]
tag does actually recall a unit if there's a matching ID in the recall list. It differs from [recall]
in what happens when there isn't a matching unit.)Re: animated teleport in/out of recall list
I changed the tag like you said, so the Silver Mage is created directly at the village via theCeltic_Minstrel wrote: ↑December 30th, 2022, 3:25 pmDoes it maybe work if you change the tag? If it does, then that suggests a bug in[recall]
; if it still doesn't work it suggests a more general bug.
[unit]
tag.The Silver Mage appears for maybe 1/100th of a second and disappears, then appears properly via teleportation.
Ideally, he shouldn't blink in and out.
Here's the code. It appears in a
[start]
event (v1.17).Code: Select all
[unit]
side=1
type=Silver Mage
x,y=32,4 # village
id=Byrin
name="Byrin"
gender=male
facing=se
random_traits=no
upkeep=0
[movement_costs]
shallow_water=9
[/movement_costs]
[/unit]
[animate_unit]
[filter]
x,y=32,4
[/filter]
flag=post_teleport
[/animate_unit]
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: animated teleport in/out of recall list
What will happen if you add
As a workaround.
hidden=yes
and than [unhide_unit]
?As a workaround.
Re: animated teleport in/out of recall list
Thanks. I tried
[hide_unit]
yesterday. The unit would unhide for a fraction of a second, then vanish, then reappear via the teleport animation.I wonder how many people would notice that the unit blinked in-and-out?
It's not really a big deal. But I always see it and it bugs me. It ruins the awesome teleport animation, imo.
I don't think you are supposed to use
hidden=yes
. It's just for the game engine?Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: animated teleport in/out of recall list
Probably if you use [hide_unit] that millisecond is the one it takes to hide with the command. But if you start with hidden=yes directly (as a property of the unit, put it on [unit] tag), the unit should already appear invisible, without that blink.
- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: animated teleport in/out of recall list
You're not supposed to, but it seems like a reasonable thing to try as a workaround for what appears to be a bug.
Re: animated teleport in/out of recall list
Okay, I tried it. Same result: the unit appears for 1/100th of a second, disappears, and then arrives in the cool teleport animation.Celtic_Minstrel wrote: ↑December 31st, 2022, 6:44 am You're not supposed to, but it seems like a reasonable thing to try as a workaround for what appears to be a bug.
In my opinion, the code is doing what it's supposed to do. The mage is placed onto the map while
hidden
. The mage is revealed via [unhide]
. Then, after all that, the teleport stuff happens. Those 3 things are happening in the order they appear in the code, one at a time.Unless
flag=post_teleport
is supposed to have the power to somehow delay [unhide]
until the animation starts? Code: Select all
[unit]
side=1
type=Silver Mage
x,y=32,4 # village
id=Byrin
name="Byrin"
gender=male
facing=se
random_traits=no
upkeep=0
[movement_costs]
shallow_water=9
[/movement_costs]
hidden=yes
[/unit]
[unhide_unit]
id=Byrin
[/unhide_unit]
[animate_unit]
[filter]
x,y=32,4
[/filter]
flag=post_teleport
[/animate_unit]
[unit]
key called arrive
.arrive=immediate
arrive=fade-in
arrive=teleport
arrive=recruitment_animation
arrive=turn 5
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: animated teleport in/out of recall list
I suppose unhiding after animating just makes it not animate at all?
EDIT: Also, is this issue new in 1.17 or does it happen in 1.16?
EDIT: Also, is this issue new in 1.17 or does it happen in 1.16?
Re: animated teleport in/out of recall list
Correct. I just tested. The unit appeared. No teleport animation.Celtic_Minstrel wrote: ↑January 1st, 2023, 1:59 am I suppose unhiding after animating just makes it not animate at all?
Same thing happens in 1.16.Celtic_Minstrel wrote: ↑January 1st, 2023, 1:59 am EDIT: Also, is this issue new in 1.17 or does it happen in 1.16?
I tested it around 20+ times, and it seemed to work 4-ish times in 1.16...but I may've simply failed to see the unit blinking in and out. Blinking happens quickly. But it definitely did not work all the other times.
Code: Select all
[unit]
side=1
type=Silver Mage
x,y=6,4
id=Byrin
name="Byrin"
gender=male
facing=se
random_traits=no
upkeep=0
[movement_costs]
shallow_water=9
[/movement_costs]
[/unit]
[animate_unit]
[filter]
x,y=6,4
[/filter]
flag=post_teleport
[/animate_unit]
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Spannerbag
- Posts: 759
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: animated teleport in/out of recall list
Hi Helmet,
EDIT: Just tried this, seems to display the same behaviour, the unit appears *then* does the anim.
EDIT 2: Tried again with the CORRECT animation and it seems to work OK, the unittype below works for me with the following code:
x,y=4,4 is a village btw.
this is an 'orrible hack and I haven't tried it, but it might work (the wiki says
Basically create a Silver Mage unittype with
As I say I haven't tried this but here's a starting point:
You'd then need to create your Silver Mage with type=Silver Mage_rt (or whatever you want to call it).
Hopefully I cut and pasted the correct chunk of WML into
The whenever the unit is recalled it should animate as you need it to... maybe, this is spannebag code so all bets are off!
Hope it helps.
Cheers!
-- Spannerbag
EDIT: Just tried this, seems to display the same behaviour, the unit appears *then* does the anim.

EDIT 2: Tried again with the CORRECT animation and it seems to work OK, the unittype below works for me with the following code:
Code: Select all
# Turn 1
# Create + put to recall
[event]
name=turn 1
{DEBUG_MSG (_"Creating Silver Mage_rt")}
{GENERIC_UNIT 1 (Silver Mage_rt) 4 4}
{DEBUG_MSG (_"put to recall")}
[put_to_recall_list]
x,y=4,4
[/put_to_recall_list]
[/event]
# Turn 2
# Test recall
[event]
name=turn 2
{DEBUG_MSG (_"recalling Silver Mage_rt")}
[recall]
type=Silver Mage_rt
x,y=4,4
[/recall]
[/event]
this is an 'orrible hack and I haven't tried it, but it might work (the wiki says
recruit_anim
works for recall so fingers crossed...)Basically create a Silver Mage unittype with
recruit_anim
= teleport in animAs I say I haven't tried this but here's a starting point:
Code: Select all
[unit_type]
id=Silver Mage_rt
[base_unit]
id=Silver Mage
[/base_unit]
[recruit_anim]
start_time=-1200
teleport_sparkle_1_start_time=-1200
teleport_sparkle_2_start_time=-1000
teleport_sparkle_3_start_time=-800
[teleport_sparkle_1_frame]
duration=800
halo=halo/teleport-[9,8,1~9].png
halo_x=10
halo_y=-30~30
[/teleport_sparkle_1_frame]
[teleport_sparkle_2_frame]
duration=800
halo=halo/teleport-[9,8,1~9].png
halo_x=0
halo_y=-40~40
[/teleport_sparkle_2_frame]
[teleport_sparkle_3_frame]
duration=800
halo=halo/teleport-[9,8,1~9].png
halo_x=-10
halo_y=-30~30
[/teleport_sparkle_3_frame]
[frame]
duration=200
image="misc/blank-hex.png"
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-9.png)
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-8.png)
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-7.png)
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-6.png)
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-5.png)
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-4.png)
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-3.png)
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-2.png)
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-1.png)
[/frame]
[frame]
duration=100
image_mod=~MASK(masks/teleport-mask-0.png)
[/frame]
[/recruit_anim]
[/unit_type]
Hopefully I cut and pasted the correct chunk of WML into
recruit_anim
.The whenever the unit is recalled it should animate as you need it to... maybe, this is spannebag code so all bets are off!

Hope it helps.
Cheers!
-- Spannerbag
- Celtic_Minstrel
- Developer
- Posts: 2371
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: animated teleport in/out of recall list
That really is an ugly workaround…