status invulnerable

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
KanoFromMK
Posts: 17
Joined: April 1st, 2024, 10:35 pm

status invulnerable

Post by KanoFromMK »

there is a scenario named Pebbles_in_the_Flood
from The_South_Guard campaign
there are such enemies with invulnerable status
where is this status defined? how can i use it in my campaigns or to attach this status to my created units
Soshen_
Posts: 13
Joined: May 12th, 2020, 12:01 pm

Re: status invulnerable

Post by Soshen_ »

Just here !
https://wiki.wesnoth.org/SingleUnitWML#status

I can't help you more ^^"
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2364
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: status invulnerable

Post by Lord-Knightmare »

try:

Code: Select all

[unit]
    [status]
        invulnerable=yes
    [/status]
[/unit]
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
KanoFromMK
Posts: 17
Joined: April 1st, 2024, 10:35 pm

Re: status invulnerable

Post by KanoFromMK »

Lord-Knightmare wrote: April 2nd, 2024, 4:59 am try:

Code: Select all

[unit]
    [status]
        invulnerable=yes
    [/status]
[/unit]
this by itself does not work
i suppose, bc its a status, it starts only with the scenario, and i cant set a status to a unit hoping it will get this status everytime
thats why i need to understand where is this status defined, like where the game sees this and understands what it means?
where are all statuses defined?
User avatar
Ravana
Forum Moderator
Posts: 3009
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: status invulnerable

Post by Ravana »

There is no such thing as defined status. All legal WML keys are also valid status names.
KanoFromMK
Posts: 17
Joined: April 1st, 2024, 10:35 pm

Re: status invulnerable

Post by KanoFromMK »

but there must be a way to set a status as default to a unit_type created by me
how can AI act accordingly if it does not know what invulnerable means? and if it does know then somewhere in the files must be a in code description of what this status does
i refuse to believe it is impossible to know)
white_haired_uncle
Posts: 1187
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: status invulnerable

Post by white_haired_uncle »

I'm not entirely sure what you are trying to do, but maybe this will give you a hint. I don't think it's quite what you want, but it might be close enough to get you moving. Of course, you'd need an advance event if you actually went this route.

Code: Select all

    [event]
        name=prerecruit
        first_time_only=no
        [filter]
            side=2
        [/filter]
        [if]
            [variable]
                name=unit.type
                equals=Mage of Light
            [/variable]
            [then]
                {VARIABLE unit.status.invulnerable yes}
                [unstore_unit]
                    variable=unit
                    find_vacant=no
                [/unstore_unit]
            [/then]
        [/if]
    [/event]
Speak softly, and carry Doombringer.
KanoFromMK
Posts: 17
Joined: April 1st, 2024, 10:35 pm

Re: status invulnerable

Post by KanoFromMK »

thats too heavy for me) sorry
i dropped the idea of implementing it in a scenario, now im merely interested in what does Invulnerability do exactly
like does it decrease the chance of being hit to 0 or decrease the chance of the enemy's weapon to hit to 0. How does it work... god knows, and wesnoth developers
KanoFromMK
Posts: 17
Joined: April 1st, 2024, 10:35 pm

Re: status invulnerable

Post by KanoFromMK »

"I'm not entirely sure what you are trying to do"

Now what im trying to do is create a character that has a trait, or something, that gives him invulnerable status. You create this unit through debug in any scenario and it has this status, that works like in Pebbles_in_the_Flood.
This trait should be by default, you should be able to recall it in the next scenario with this status still available, still working
KanoFromMK
Posts: 17
Joined: April 1st, 2024, 10:35 pm

Re: status invulnerable

Post by KanoFromMK »

I thought im probably asking too much, thats why my question from the start was how does invulnerable status work
KanoFromMK
Posts: 17
Joined: April 1st, 2024, 10:35 pm

Re: status invulnerable

Post by KanoFromMK »

Code: Select all

[defense]
            shallow_water=0
            reef=0
            swamp_water=0
            flat=0
            sand=0
            forest=0
            hills=0
            mountains=0
            village=0
            castle=0
            cave=0
            frozen=0
            fungus=0
[/defense]
gives the same effect, except magical attacks that overwrite the defence capabilities and give the same minimum 70%
Last edited by WhiteWolf on April 16th, 2024, 12:04 pm, edited 1 time in total.
Reason: [code]
User avatar
Ravana
Forum Moderator
Posts: 3009
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: status invulnerable

Post by Ravana »

Compare how undead trait gives status unpoisonable https://github.com/wesnoth/wesnoth/blob ... ts.cfg#L50
KanoFromMK
Posts: 17
Joined: April 1st, 2024, 10:35 pm

Re: status invulnerable

Post by KanoFromMK »

Ravana wrote: April 2nd, 2024, 9:31 pm Compare how undead trait gives status unpoisonable https://github.com/wesnoth/wesnoth/blob ... ts.cfg#L50
yes, this indeed does what i want, thank you
alas i couldnt find out how invulnerable works, but thanks to you and all good people here this works unclear how but works, thank you again
btw how can i put this post in closed? since i found the answer
User avatar
Celtic_Minstrel
Developer
Posts: 2222
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: status invulnerable

Post by Celtic_Minstrel »

Regarding how invulnerable works, it just forces the hit chance to zero.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
KanoFromMK
Posts: 17
Joined: April 1st, 2024, 10:35 pm

Re: status invulnerable

Post by KanoFromMK »

Celtic_Minstrel wrote: April 8th, 2024, 5:39 pm Regarding how invulnerable works, it just forces the hit chance to zero.
danke)
Post Reply