Fully healed on recall

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.
Post Reply
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Fully healed on recall

Post by vghetto »

I'm not sure if this is a regression bug or it's been this way before and I'm mistaken about it. But I seem to remember that in wesnoth 1.14.5, when a unit with less than maximum hitpoints is placed on the recall list, and then recalled back, it retains being not fully healed.

On wesnoth 1.14.9 if a unit with lower hitpoints is placed on the recall list and then recalled back, it is fully healed.
How do I stop that?

Here the code to place a unit on the recall list. You can plug it in WML_Guide mod's first scenario to test this.

Code: Select all

[event]
        name=prestart
        [set_menu_item]
                id=menu_stand_down
                [filter_location]
                        terrain=C*,K*
                        [filter]
                                side=1
                                canrecruit=no
                        [/filter]
                        [and]
                                [filter]
                                        side=1
                                        canrecruit=yes
                                        [filter_location]
                                                terrain=K*
                                        [/filter_location]
                                [/filter]
                                radius=99
                                [filter_radius]
                                        terrain=C*,K*
                                [/filter_radius]
                        [/and]
                [/filter_location]
                description=_"Stand down"
                [command]
                        [store_unit]
                                [filter]
                                        x,y=$x1,$y1
                                [/filter]
                                variable=temp_unit
                        [/store_unit]
                        {PUT_TO_RECALL_LIST id=$temp_unit.id}
                        {CLEAR_VARIABLE temp_unit}
                [/command]
        [/set_menu_item]
[/event]
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Fully healed on recall

Post by vghetto »

I checked the value of the units hitpoints on prerecall and recall events and it was max hitpoints on both even though in the recall dialog it showed that the unit was 1/37
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Fully healed on recall

Post by gfgtdf »

What you are describing here sounds really unlikely, since we would not change behaviour within a stable release in such a way at least not intentionally. Please make sure that you are 100% sure about this behviour change and if possible try to figure out during which version exactly the behaviour has changed.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Fully healed on recall

Post by vghetto »

gfgtdf wrote: March 28th, 2020, 1:46 pm What you are describing here sounds really unlikely, since we would not change behaviour within a stable release in such a way at least not intentionally. Please make sure that you are 100% sure about this behviour change and if possible try to figure out during which version exactly the behaviour has changed.
What is the current standard wesnoth behavior, is to heal when recalled or not?
If it is to heal, then my question is how do I make it not auto-heal.

I'm using wesnoth 1.14.9 debian sid package. It would be a real hassle to downgrade back to 1.14.5 just to see if this was the same behavior. And between those 2 I cannot test on any other wesnoth versions.

I'm attaching a replay showing what is happening on 1.14.9. The unit will get hurt, then it will go on the recall list, then it is recalled back fully healed. No where in the code did it explicitly heal that unit.
If that is not what you see happening in the replay, then something really strange is going on.

This is the standard WML_Guide addon mod with the attached scenario including the recall changes.
Attachments
WMLG-Darth Syntax replay.gz
(7.55 KiB) Downloaded 121 times
01_Darth_Syntax.cfg
(8.32 KiB) Downloaded 119 times
User avatar
Ravana
Forum Moderator
Posts: 3004
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Fully healed on recall

Post by Ravana »

heal: (default=no) Whether the unit should be refreshed, similar to the unit moving to the recall list at the end of a scenario.
Whether it heals or not depends on how you implemented PUT_TO_RECALL_LIST.
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Fully healed on recall

Post by vghetto »

Ravana wrote: March 28th, 2020, 4:48 pm
heal: (default=no) Whether the unit should be refreshed, similar to the unit moving to the recall list at the end of a scenario.
Whether it heals or not depends on how you implemented PUT_TO_RECALL_LIST.
PUT_TO_RECALL_LIST is part of wesnoth's macros. /usr/share/games/wesnoth/1.14/data/core/macros/utils.cfg and as the wiki says it defaults to heal=no.
I did indeed try to call [put_to_recall_list] directly with heal=no, same result on the recall.
Notice this is not the issue here, when the unit is on the recall list it will show that the unit is not healed, whether you see the unit in the recall dialogue or in the game inspector, it will show the unit not fully healed or at maximum hitpoints. It's only after you click on the recall dialogue that the unit becomes at max hitpoints.

And could someone give me straight answer on whether on recall the unit gets healed is the standard behavior of wesnoth or is this a bug, please?
User avatar
Ravana
Forum Moderator
Posts: 3004
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Fully healed on recall

Post by Ravana »

Ok, going to try out 1.14.5 vs steam then.

1.14.5

Code: Select all

$ u=wesnoth.get_units()
$ a=u[3]
$ b=u[4]
$ wesnoth.wml_actions.put_to_recall_list{id=a.id}
$ wesnoth.wml_actions.put_to_recall_list{id=b.id, heal=true}
Result as described, preview shows expected health, but when recalled, both are full.

Same with 1.14.11.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Fully healed on recall

Post by gfgtdf »

vghetto wrote: March 28th, 2020, 3:40 pm What is the current standard wesnoth behavior, is to heal when recalled or not?
If it is to heal, then my question is how do I make it not auto-heal.

If you say that 1.14.9 does heal the unit and that you are not sure whether 1.14.5 healed the unit, i'd say that healing the unit is the standard. That said, i think it would make more sense if it wouldn't, but thats not something we can change in 1.14 unless you can prove that is also bhaved that way in 1.14.5 . We can change this bheviour in wesntoh 1.15 though

Ravana wrote: March 28th, 2020, 4:48 pm
heal: (default=no) Whether the unit should be refreshed, similar to the unit moving to the recall list at the end of a scenario.
Whether it heals or not depends on how you implemented PUT_TO_RECALL_LIST.
The problem here is that the unit gets heled when its recalled not when its put to the recall list
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Ravana
Forum Moderator
Posts: 3004
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Fully healed on recall

Post by Ravana »

I finished testing - no regression, but general bug.
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: Fully healed on recall

Post by vghetto »

Cool, I hope it gets fixed eventually. I find it a bit strange that the code to heal a unit when placing it on the recall list "heal=no" or refreshing the recall list at the end of the scenario was necessary in the first place if the act of recalling has always been to heal anyways. It probably wasn't the case prior to 1.14.x.
I'll try to downgrade to 1.14.5 and test this, I do remember experiencing it, but I might be wrong and with a false memory.

Edit1:
If someone can point me to the file responsible for the recalling, I could git blame and see if it's always been the case or things changed and when they changed. I'm not good at cpp but i'll try.
Post Reply