animated teleport in/out of recall list

The place to post your WML questions and answers.

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.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: animated teleport in/out of recall list

Post by Helmet »

Spannerbag wrote: January 1st, 2023, 1:05 pm...Tried again with the CORRECT animation and it seems to work OK, the unittype below works for me with the following code:[/b]
Holy moly, that is a clever mind-boggling solution, using a recruit animation. Thanks.

I've changed the WML for the Silver Mage so many times, I think my computer is about to run out of pixels.
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.
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: animated teleport in/out of recall list

Post by gnombat »

Celtic_Minstrel wrote: December 30th, 2022, 3:25 pm This is pretty much identical to what I do in Black Cross of Aleron
I tried playing your campaign and I couldn't see anything before the animation, but then I made a screen recording and played it in slow motion...
Last edited by gnombat on January 23rd, 2025, 1:17 pm, edited 1 time in total.
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: animated teleport in/out of recall list

Post by Helmet »

gnombat wrote: January 1st, 2023, 5:46 pm I tried playing your campaign and I couldn't see anything before the animation, but then I made a screen recording and played it in slow motion...
Whoa! The unit blinked in and out!
Maybe the code for teleport animation has never worked as intended?
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.
User avatar
Toranks
Translator
Posts: 168
Joined: October 21st, 2022, 8:59 pm
Location: Sevilla
Contact:

Re: animated teleport in/out of recall list

Post by Toranks »

It is possible that a combination of the CPU power, the monitor's refresh rate, and the subjective vision of the eye results in one people see flickering and other people not.
User avatar
Celtic_Minstrel
Developer
Posts: 2371
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: animated teleport in/out of recall list

Post by Celtic_Minstrel »

gnombat wrote: January 1st, 2023, 5:46 pm
Celtic_Minstrel wrote: December 30th, 2022, 3:25 pm This is pretty much identical to what I do in Black Cross of Aleron
I tried playing your campaign and I couldn't see anything before the animation, but then I made a screen recording and played it in slow motion...
What version of the game is that in?
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: animated teleport in/out of recall list

Post by gnombat »

Celtic_Minstrel wrote: January 1st, 2023, 8:49 pm What version of the game is that in?
That was 1.14.17.
User avatar
Spannerbag
Posts: 759
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: animated teleport in/out of recall list

Post by Spannerbag »

Celtic_Minstrel wrote: January 1st, 2023, 3:11 pm That really is an ugly workaround…
Thought you'd appreciate it :)
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.18, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Saizo-Luz
Posts: 83
Joined: June 14th, 2024, 12:50 pm
Location: High Heavens

Re: animated teleport in/out of recall list

Post by Saizo-Luz »

This issue can be easily solved with a new [unhide_unit] code. The original [unhide_unit] code has a [redraw] tag in the end. So that's why the unit appear before displaying the animation; when it doesn't appear it's because your computer is absurdly fast. Below is a new code without the [redraw] tag.

Code: Select all

[lua]
        code = <<
function wesnoth.wml_actions.new_unhide_unit(cfg)
	for i,u in ipairs(wesnoth.units.find_on_map(cfg)) do
		u.hidden = false
	end
end
>>
    [/lua]
You just have to scroll the screen before unhiding it; otherwise the scroll will redraw the screen.

Code: Select all

[scroll_to]
	x= LOC X
	y= LOC Y
[/scroll_to]
[new_unhide_unit]
	id= UNIT
[/new_unhide_unit] #It won't redraw.
[animate_unit]
	#blah blah blah
	flag=post_teleport
[/animate_unit]
I'm using this on my campaign to teleport several units at once. If you're recall the unit, you have to hide it and then unhide again. The wiki says the [recall] tag uses the same attributes as [unit] tag. So hidden=yes should work fine! Recall it hidden, scroll, unhide (new code - without redraw) and animate.
Post Reply