[engine] Enhancement to [put_to_recall_list]: refresh objects
Moderator: Forum Moderators
Forum rules
Before posting a new idea, you must read the following:
Before posting a new idea, you must read the following:
[engine] Enhancement to [put_to_recall_list]: refresh objects
Hello,
Currently, if you want your units to be put back to the recall list, healed and cleared of statuses (just like it would happen at the end of a scenario), you can use [put_to_recall_list] with heal=yes.
However, this doesn't recalculate scenario duration objects. And if you recall your units on the next scenario, the objects that should have been cleared are still active, and will only disappear at the end of the current scenario.
The workaround that I found for this, is to give all objects an ID, and remove them by hand before using [put_to_recall_list] on the unit.
My proposal is to enhance the tag with a
It'd save a lot of grief, and I hope it's easy to implement
Currently, if you want your units to be put back to the recall list, healed and cleared of statuses (just like it would happen at the end of a scenario), you can use [put_to_recall_list] with heal=yes.
However, this doesn't recalculate scenario duration objects. And if you recall your units on the next scenario, the objects that should have been cleared are still active, and will only disappear at the end of the current scenario.
The workaround that I found for this, is to give all objects an ID, and remove them by hand before using [put_to_recall_list] on the unit.
My proposal is to enhance the tag with a
refresh_objects
key, so that if it's set to yes, it will remove all scenario (and possibly "turn" as well, if it was applied on that turn?) duration objects.It'd save a lot of grief, and I hope it's easy to implement
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: 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
Old UMC works: 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
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
There is no reason why putting unit to recall list should mean that scenario has ended. If it is in recall list, it can be recalled in same scenario.
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
That wouldn't be a problem if the proposed key defaulted to "no".
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
I don't understand what the proposed key would do. Would it just mean "expire
In the C++ there's an API for expiring modifications:
https://github.com/wesnoth/wesnoth/blob ... 1202-L1254
Sounds like what you want is to call it (with argument
Or maybe you should be creating the objects with
duration=scenario
objects when putting units to the recall list"? If so, maybe the API should take the duration to expire as a string? (expire_objects_by_duration=scenario
, for example)In the C++ there's an API for expiring modifications:
https://github.com/wesnoth/wesnoth/blob ... 1202-L1254
Sounds like what you want is to call it (with argument
"scenario"
) when putting a unit to the recall list...but I don't think it's exposed to Lua, is it?Or maybe you should be creating the objects with
duration=until_putting_to_recall_list
in the first place? (that's not an already-existing duration value, it'd have to be implemented)Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
Here's the case where I would use this feature: let's say a map ended, but you would like to do a little end-scene, with just two of your heroes. And you'll also change the map to a small, scene-map, like a room in a tower or whatever. Then you need to solve all the remaining units on the battlefield in the end. The easiest and quickest is to put them all to the recall list with heal=yes, and they'll be fine for the next scenario.
However, let's say there are weapon specials that dealt lots of [object]'s on the units, some even affecting the max HP, but with scenario duration. At the end, when I put back all units onto the recall list, these objects should expire. Currently they don't.
That's why the object would have duration=scenario, to work like it does now, and the situational put_to_recall_list could make it expire if needed.
However, let's say there are weapon specials that dealt lots of [object]'s on the units, some even affecting the max HP, but with scenario duration. At the end, when I put back all units onto the recall list, these objects should expire. Currently they don't.
Indeed, so the default value should definitely be no. Generally you wouldn't need this key, but I'd find it useful in cases like the one above, or any other mid-scenario map switching, stuff like that.
As long as it's a comma separated list forjosteph wrote: ↑September 1st, 2019, 5:33 pm I don't understand what the proposed key would do. Would it just mean "expireduration=scenario
objects when putting units to the recall list"? If so, maybe the API should take the duration to expire as a string? (expire_objects_by_duration=scenario
, for example)
scenario,turn
cases, I think that sounds good. Maybe you don't need the "by_duration"? So the key is just: expire_objects=
: a comma separated list of forever,scenario,turn (I don't remember if there's anything else) duration objects to expire upon putting the unit back to the recall list.If I understood correctly, than I don't think that's a good idea. The object can't know if it'll be but in a situation where it will have to expire when the unit is put on the recall list. If you specify this duration, it could create a problem like in Ravana's post, that what if you just use the put_to_recall_list in a regular mid-scenario case, and the unit can still be recalled in the same scenario? Then the object expired too soon.Or maybe you should be creating the objects withduration=until_putting_to_recall_list
in the first place? (that's not an already-existing duration value, it'd have to be implemented)
That's why the object would have duration=scenario, to work like it does now, and the situational put_to_recall_list could make it expire if needed.
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: 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
Old UMC works: 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
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
About
About "The object can't know if it'll be but in a situation where it will have to expire when the unit is put on the recall list.", no, the object definition doesn't know its use, but the scenario author does... so maybe the macro that defines the object could take the duration as an argument - maybe even an optional argument defaulting to
expire_objects_by_duration
, I didn't mean propose that as literally the key name to use. Something shorter or entirely different would be fine by me. Agree about a comma separated list, I thought so too but didn't want to complicate the example.About "The object can't know if it'll be but in a situation where it will have to expire when the unit is put on the recall list.", no, the object definition doesn't know its use, but the scenario author does... so maybe the macro that defines the object could take the duration as an argument - maybe even an optional argument defaulting to
forever
- and in scenarios such as yours, the scenario author would specify the duration as scenario
or until_recall
when calling the macro.Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
I'm afraid I still don't entirely understand. Here's how I see it:
#Example 1: use/implement the
Then the object will expire if:
Then the object will expire if:
And then there are scenes like in the above post example, and units are put back to the recall list with the tag, and not by Wesnoth at the end of the scenario. Then, these object should also expire.
But, let's say there's another weapon special that if it hits the enemy it is put back on its side's recall list (I just made this up but it sounds like a weapon special worth experimenting with...).
Anyway, the point is, if the object is defined with duration=until_recall, then it will also expire in this case, which is something we don't want.
However, expire_objects can handle it, the object is defined with duration=scenario, and in the end-scene case it's called with
#Example 1: use/implement the
duration=until_recall
in the object, and not the expire_object
in put_to_recall_list.
Code: Select all
[event]
name=whatever, give to units during the scenario
[object]
duration=until_recall
...stuff
[/object]
[/event]
- The scenario is ended, and Wesnoth returns the unit to the recall list
- Whenever [put_to_recall_list] is called, no matter what.
expire_object
in put_to_recall_list.
Code: Select all
[event]
name=whatever, give to units during the scenario
[object]
duration=scenario
...stuff
[/object]
[/event]
- The scenario is ended, and Wesnoth returns the unit to the recall list
- Whenever [put_to_recall_list] is called, but only with expire_object=scenario enabled.
And then there are scenes like in the above post example, and units are put back to the recall list with the tag, and not by Wesnoth at the end of the scenario. Then, these object should also expire.
But, let's say there's another weapon special that if it hits the enemy it is put back on its side's recall list (I just made this up but it sounds like a weapon special worth experimenting with...).
Anyway, the point is, if the object is defined with duration=until_recall, then it will also expire in this case, which is something we don't want.
However, expire_objects can handle it, the object is defined with duration=scenario, and in the end-scene case it's called with
expire_object=scenario
, and in the put back to recall list-effect weapon special case it's called without it, and doesn't affect objects.Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: 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
Old UMC works: 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
- beetlenaut
- Developer
- Posts: 2825
- Joined: December 8th, 2007, 3:21 am
- Location: Washington State
- Contact:
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
If we do end up adding the ability to expire objects, it should be flexible: You shouldn't be required to move a unit to the recall list to use it, or know when the object is created that you will need it. It seems to me that it would make the most sense as an available tag in modify_unit. (It could certainly be added to other tags like put_to_recall_list as well, but it should start in a more accessible place.)
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
Why don't we just change the engine to expire objects for units on the recall list just as it does for units on the map?
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
yes that's what i'd have suggested aswell.
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.
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
That'd be another great solution I don't know which would be easier to implement.
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: 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
Old UMC works: 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
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
both are easy to implement but my current plan is to do what octalot suggested.
Note that 1.14 already has a `remove_modification` function so you can probably just use
Note that 1.14 already has a `remove_modification` function so you can probably just use
u:remove_modifications({ duration = "scenario" })
before putting the unit u 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.
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
so i'm currently wondering, shoduil the engine only expire these objects or should the unit on the recall list also be healed like the units on the map?
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.
Re: [engine] Enhancement to [put_to_recall_list]: refresh objects
I think it makes sense, yes. It basically means, that your recall list gets the same "treatment" at the end of the scenario that your units on the battlefield get. To which I'd say it's fair.
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: 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
Old UMC works: 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