Recommended alternative to deprecated Fog Clearer

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
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Recommended alternative to deprecated Fog Clearer

Post by Simons Mith »

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
 
User avatar
Pentarctagon
Project Manager
Posts: 5526
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Recommended alternative to deprecated Fog Clearer

Post by Pentarctagon »

99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Recommended alternative to deprecated Fog Clearer

Post by Simons Mith »

That's not what I meant; Fate of a Princess is another campaign using it (in half a dozen places) as a dummy unit.
 
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2340
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

Post by Lord-Knightmare »

Simons 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.
Since it's deprecated, the unit shouldn't be used anymore and the code must be updated with the current [lift_fog]
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Pentarctagon
Project Manager
Posts: 5526
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Recommended alternative to deprecated Fog Clearer

Post by Pentarctagon »

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
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Recommended alternative to deprecated Fog Clearer

Post by Ravana »

Popularity of fog clearer comes from the fact that it did not require download to join. As campaign you can create custom unit types.
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Recommended alternative to deprecated Fog Clearer

Post by Simons Mith »

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?
Last edited by Simons Mith on July 27th, 2021, 10:30 pm, edited 1 time in total.
 
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Recommended alternative to deprecated Fog Clearer

Post by Ravana »

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.
User avatar
Pentarctagon
Project Manager
Posts: 5526
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Recommended alternative to deprecated Fog Clearer

Post by Pentarctagon »

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:
It's also used as placeholders for a couple of orcish assassins prior to an ambush.
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?
The rune_fake is a glowing magical rune
That sounds like it should be an [item] rather than a unit.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Recommended alternative to deprecated Fog Clearer

Post by Simons Mith »

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?
 
User avatar
Ravana
Forum Moderator
Posts: 2949
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Recommended alternative to deprecated Fog Clearer

Post by Ravana »

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.
User avatar
Pentarctagon
Project Manager
Posts: 5526
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Recommended alternative to deprecated Fog Clearer

Post by Pentarctagon »

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
User avatar
Gwledig
Posts: 568
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: Recommended alternative to deprecated Fog Clearer

Post by Gwledig »

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

Re: Recommended alternative to deprecated Fog Clearer

Post by vghetto »

in _main.cfg make sure it is inside [+units][/units]
User avatar
Gwledig
Posts: 568
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: Recommended alternative to deprecated Fog Clearer

Post by Gwledig »

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?
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Post Reply