Need Help with hides ability

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
FailedGod
Posts: 2
Joined: January 22nd, 2022, 1:21 pm

Need Help with hides ability

Post by FailedGod »

Hi,
I tried to create a hides ability.
The ability shows up ingame, but it's set to inactive.
Maybe it's a problem with my code, but I couldn't find the problem.

Other abilities (but which are copied from the base game and not changed, like Heal or Leadership) work fine

Code:

Code: Select all

#define ABILITY_SWAMPWALK
    # Canned definition of the Swanpwalk ability to be included in an
    # [abilities] clause.
    [hides]
        id=failed swampwalk
        name= _ "swampwalk"
        female_name= _ "female^swampwalk"
        description= _ "This unit can hide in swamps, and remain undetected by its enemies.

Enemy units cannot see this unit while it is in swamp, except if they have units next to it. Any enemy unit that first discovers this unit immediately loses all its remaining movement."
        affect_self=yes
        [filter]
            [filter_location]
                terrain=*^Ss*, *^Sm*
            [/filter_location]
        [/filter]
    [/hides]
#enddef
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2475
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: Need Help with hides ability

Post by Lord-Knightmare »

Swamp terrain is not an overlay. So, you need to adjust those terrain= values
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
Ravana
Forum Moderator
Posts: 3313
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Need Help with hides ability

Post by Ravana »

You filter for non-core terrains. Either update filter to use core swamp, or check your custom terrain to match what ability expects.

https://github.com/inferno8/wesnoth-Era ... 2306939136
FailedGod
Posts: 2
Joined: January 22nd, 2022, 1:21 pm

Re: Need Help with hides ability

Post by FailedGod »

Thanks for the quik reply
Post Reply