Recommended alternative to deprecated Fog Clearer
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.
- Simons Mith
- Posts: 821
- Joined: January 27th, 2005, 10:46 pm
- Location: Twickenham
- Contact:
Recommended alternative to deprecated Fog Clearer
I understand that the Fog Clearer unit isn't going to be removed after all, for reasons given here:
https://forums.wesnoth.org/viewtopic.ph ... er#p644602
and
https://github.com/wesnoth/wesnoth/blob ... rer.cfg#L7
but I'd still prefer to eliminate all deprecated messages from Fate of a Princess.
What's the best practise here?
Save a copy of Fog Clearer in the campaign and change its unit type to 'Dummy_Unit'?
Continue to use Fog Clearer, and wait for the deprecated warning to be removed again?
Thanks
https://forums.wesnoth.org/viewtopic.ph ... er#p644602
and
https://github.com/wesnoth/wesnoth/blob ... rer.cfg#L7
but I'd still prefer to eliminate all deprecated messages from Fate of a Princess.
What's the best practise here?
Save a copy of Fog Clearer in the campaign and change its unit type to 'Dummy_Unit'?
Continue to use Fog Clearer, and wait for the deprecated warning to be removed again?
Thanks
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Recommended alternative to deprecated Fog Clearer
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- Simons Mith
- Posts: 821
- Joined: January 27th, 2005, 10:46 pm
- Location: Twickenham
- Contact:
Re: Recommended alternative to deprecated Fog Clearer
That's not what I meant; Fate of a Princess is another campaign using it (in half a dozen places) as a dummy unit.
- Lord-Knightmare
- Discord Moderator
- Posts: 2360
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: Recommended alternative to deprecated Fog Clearer
Since it's deprecated, the unit shouldn't be used anymore and the code must be updated with the currentSimons Mith wrote: ↑July 27th, 2021, 9:45 pm That's not what I meant; Fate of a Princess is another campaign using it (in half a dozen places) as a dummy unit.
[lift_fog]
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Recommended alternative to deprecated Fog Clearer
I guess what I'm not sure about is why you need a dummy unit for something other than what the Fog Clearer is meant to be used for. What are you using it for in Fate of a Princess?
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Recommended alternative to deprecated Fog Clearer
Popularity of fog clearer comes from the fact that it did not require download to join. As campaign you can create custom unit types.
- Simons Mith
- Posts: 821
- Joined: January 27th, 2005, 10:46 pm
- Location: Twickenham
- Contact:
Re: Recommended alternative to deprecated Fog Clearer
Well, I don't understand all of SkyOne's coding but here's some cases
{FOAP_UNIT 5 "Fog Clearer" 28 15 rune_fake_unit ai_special=guardian}
{FOAP_UNIT 3 "Fog Clearer" 26 2 Fake_leader ( ...
[unit]
side=2
x,y=3,4
type=Fog Clearer
id=takel_fake
ai_special=guardian
[/unit]
It's also used as placeholders for a couple of orcish assassins prior to an ambush.
The rune_fake is a glowing magical rune - I haven't studied that code yet.
And it does seem that Fog Clearer does have a legitimate use as a placeholder unit - like it says at the github link.
So while I can clone and rename Fog Clearer and create a custom dummy unit, the question remains, is that the recommended way?
Is the deprecated warning going to be removed (in which case I don't need to meddle with SkyOne's code), is an official 'Dummy Unit'
going to be provided in its place (in which case I could just do a simple substitution)? Or something else?
{FOAP_UNIT 5 "Fog Clearer" 28 15 rune_fake_unit ai_special=guardian}
{FOAP_UNIT 3 "Fog Clearer" 26 2 Fake_leader ( ...
[unit]
side=2
x,y=3,4
type=Fog Clearer
id=takel_fake
ai_special=guardian
[/unit]
It's also used as placeholders for a couple of orcish assassins prior to an ambush.
The rune_fake is a glowing magical rune - I haven't studied that code yet.
And it does seem that Fog Clearer does have a legitimate use as a placeholder unit - like it says at the github link.
So while I can clone and rename Fog Clearer and create a custom dummy unit, the question remains, is that the recommended way?
Is the deprecated warning going to be removed (in which case I don't need to meddle with SkyOne's code), is an official 'Dummy Unit'
going to be provided in its place (in which case I could just do a simple substitution)? Or something else?
Last edited by Simons Mith on July 27th, 2021, 10:30 pm, edited 1 time in total.
Re: Recommended alternative to deprecated Fog Clearer
I think best solution is defining your own fake unit type. I dont expect it would get to core, not at this stage into release cycle.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Recommended alternative to deprecated Fog Clearer
I'm fairly confident that there isn't going to be an official dummy unit added unless someone can clearly explain what it would be used for that isn't also doable without a dummy unit. For example:
Why is a dummy unit needed for that? Couldn't either the orcish assassins be placed instead and prevented from moving or the assassins not be placed until the ambush happens?It's also used as placeholders for a couple of orcish assassins prior to an ambush.
That sounds like it should be an [item] rather than a unit.The rune_fake is a glowing magical rune
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
- Simons Mith
- Posts: 821
- Joined: January 27th, 2005, 10:46 pm
- Location: Twickenham
- Contact:
Re: Recommended alternative to deprecated Fog Clearer
I am going to see about imposing sanity on those different use cases. Where I can eliminate dummy units I will. But they're there now and, well, they don't seem glaringly unreasonable. But I'm not remotely a WML expert, and nor was SkyOne .
Fate of a Princess does make creative use of several game features. For example, a shaman healing animation is reused without its halo as a child jumping for joy, which is rather cute. The berserker laugh is used as just a laugh, in a couple of places. So sometimes there's good reasons for the strangeness.
As far as the dummy unit - well - that's not my problem, but the github complaint seems legit to me. Are UMCs that do have a legit use for a dummy unit going to be stuck with a deprecated unit message forever more?
Fate of a Princess does make creative use of several game features. For example, a shaman healing animation is reused without its halo as a child jumping for joy, which is rather cute. The berserker laugh is used as just a laugh, in a couple of places. So sometimes there's good reasons for the strangeness.
As far as the dummy unit - well - that's not my problem, but the github complaint seems legit to me. Are UMCs that do have a legit use for a dummy unit going to be stuck with a deprecated unit message forever more?
Re: Recommended alternative to deprecated Fog Clearer
If there is really need, it is possible to override wesnoth.wml_actions.deprecated_message to disable the message.
Otherwise Boat looks reasonably close to dummy unit.
Otherwise Boat looks reasonably close to dummy unit.
- Pentarctagon
- Project Manager
- Posts: 5564
- Joined: March 22nd, 2009, 10:50 pm
- Location: Earth (occasionally)
Re: Recommended alternative to deprecated Fog Clearer
If you really do need a dummy unit, then yeah the solution right now would be to create your own.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
take one down, patch it around
-2,147,483,648 little bugs in the code
Re: Recommended alternative to deprecated Fog Clearer
Had a bash at updating to include a copy of Fog Clearer (unit_type cfg) in a new units folder, declared that folder in _main.cfg, changed the name/ids and then referenced these in [unit]type=.... but can't get this to work, just get a Lua error ingame that the unit_type isn't recognised, double checked the ID/name to match what I'm declaring, am I missing any obvious steps to declare a copy of the unit_type pls?
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Re: Recommended alternative to deprecated Fog Clearer
in _main.cfg make sure it is inside [+units][/units]
Re: Recommended alternative to deprecated Fog Clearer
Thanks all
p.s. os overlay= also going to be removed from [unit]?
Could this still be done as a variable on the [unit] if it is removed?
p.s. os overlay= also going to be removed from [unit]?
Could this still be done as a variable on the [unit] if it is removed?
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)