WML added halos are not rendered with [move_unit]

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
User avatar
Helmet
Posts: 331
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

WML added halos are not rendered with [move_unit]

Post by Helmet »

WML-added halos appear on the unit, as expected. However, when the unit moves via [move_unit], the halo disappears while the unit moves, then reappears after the unit stops.

I asked for help with this problem in the WML Workshop. WhiteWolf replied:
WhiteWolf wrote: December 8th, 2020, 10:44 pm I checked in 1.14, and it's the same. Apparently WML added halos (so the ones that are not directly in [unit_type]) are not rendered when the unit is moved by WML actions. Looks like a bug to me.
The problem appears with the following code.

Code: Select all

		[modify_unit]
			[filter]
				id=Finya
			[/filter]
			[effect]
				apply_to=halo
				halo=halo/net.png
			[/effect]
		[/modify_unit]
		[move_unit]
			id=Finya
			to_x=6
			to_y=4
		[/move_unit]

Code: Select all

		[store_unit]
			[filter]
				id=Finya
			[/filter]
			variable=target_finya
		[/store_unit]

		[set_variable]
			name=target_finya.halo
			value="halo/net.png"
		[/set_variable]

		[unstore_unit]
			variable=target_finya
			find_vacant=no
		[/unstore_unit]
I'm using 1.15.7 BfW.
Mac OS 10.12.6
User avatar
WhiteWolf
Forum Moderator
Posts: 738
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: WML added halos are not rendered with [move_unit]

Post by WhiteWolf »

A bit of further info:
If a unit already has a halo in [unit_type] (Mage of Light used as example), and I change the halo to something else, then if the unit is moved with [move_unit], it reverts to showing the original halo for the duration of the movement. (And then shows again the new one once stopped).

The way of changing the halo doesn't seem to matter, it's all the same with a direct halo key in [modify_unit], [effect] in modify unit, or [effect] in [object].

I think this happens because [move_unit] on the back end of things is still somewhat related to wesnoth.wml_actions.move_unit_fake, that only cares about the base [unit_type]. (And that's why we always get the vanilla halo key value in [unit_type], no matter what is changed in the actual unit).
So it's possible that it's not entirely a bug, more like a missing feature.
Author of the Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Standalone works: The Ravagers - now for 1.14, with new bugs!
User avatar
Helmet
Posts: 331
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: WML added halos are not rendered with [move_unit]

Post by Helmet »

WhiteWolf wrote: December 9th, 2020, 12:52 am A bit of further info:
If a unit already has a halo in [unit_type] (Mage of Light used as example), and I change the halo to something else, then if the unit is moved with [move_unit], it reverts to showing the original halo for the duration of the movement. (And then shows again the new one once stopped).
Verifying that I experienced this odd, unwelcome behavior, too.

I had replaced a halo, so I expected that the halo would remain replaced. But the former halo returned while the unit moved, then the replacement halo came back.
Post Reply