undead variation to recruit list

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
Numero
Posts: 59
Joined: August 7th, 2018, 2:11 pm

undead variation to recruit list

Post by Numero »

Walking corpses and soulless have many variations for different races, is it possible to add a variation to a recruit list/faction? What would be the id of the unit, when I put soulless I only get the standard variant.
Author of 'An Orcish Might' viewtopic.php?t=57032
User avatar
Ravana
Forum Moderator
Posts: 3313
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: undead variation to recruit list

Post by Ravana »

You would need to create separate unit types out of them. Some addons have done that already.
white_haired_uncle
Posts: 1456
Joined: August 26th, 2018, 11:46 pm
Location: A country place, far outside the Wire

Re: undead variation to recruit list

Post by white_haired_uncle »

Be nice if you could say something like soulless.wose. I don't really know anything about variations, so that may not make much sense.
Speak softly, and carry Doombringer.
Numero
Posts: 59
Joined: August 7th, 2018, 2:11 pm

Re: undead variation to recruit list

Post by Numero »

alright, thanks for the info could you tell me a addon that does it for example?
Author of 'An Orcish Might' viewtopic.php?t=57032
gnombat
Posts: 892
Joined: June 10th, 2010, 8:49 pm

Re: undead variation to recruit list

Post by gnombat »

Does RECRUIT_UNIT_VARIATIONS do what you want?
User avatar
Saizo-Luz
Posts: 83
Joined: June 14th, 2024, 12:50 pm
Location: High Heavens

Re: undead variation to recruit list

Post by Saizo-Luz »

could you tell me a addon that does it for example?
The main line campaign 'Secrets of the Ancients'.
The add-on: campaign 'Zombies:Introduction'. (he took from Secrets of the Ancients).

I think I know what you want to do... put the walking corpses and soulless variations on the recruit list itself, right?
It's a good idea! :eng: But I also recommend that you give them a buff, they are too weak. I'm creating a campaign, and I changed the walking corpse to level 1 and the soulless to level 2 - I increased their life and gave them an extra movement too. I personally really like these two units, especially the artwork. But I didn't do what you're going to do (creating unit types for each variation), I'm just going to use variations.
Numero
Posts: 59
Joined: August 7th, 2018, 2:11 pm

Re: undead variation to recruit list

Post by Numero »

@gnombat actually I wanted to add the unit to an era, and I think it may be kinda Frustrating for the Player If it is random, but thank you nonetheless.

@saizo-Luz thanks, I'll Check the campaigns. I will have to See how the unit is balanced in the era. Maybe I'll add some Higher Level Units or Something.

Also sorry for the capitalization, my Phone autocorrects for my native language.
Author of 'An Orcish Might' viewtopic.php?t=57032
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: undead variation to recruit list

Post by Lord-Knightmare »

There is a mod by dwarftough where you can enable and pick what variations of WC/Soulless should be recruited. You can try that.
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
BajMic
Posts: 72
Joined: January 24th, 2023, 1:22 am

Re: undead variation to recruit list

Post by BajMic »

I have a related question.

I am trying to define new unit type, but I want it to inherit from basic Walking Corpse. For some reason, it seems to choose random variation, and I end up with dwarves and falcons. Is there a way to clearly specify the basic Walking Corpse?
User avatar
Saizo-Luz
Posts: 83
Joined: June 14th, 2024, 12:50 pm
Location: High Heavens

Re: undead variation to recruit list

Post by Saizo-Luz »

BajMic wrote: July 25th, 2024, 11:06 am I am trying to define new unit type, but I want it to inherit from basic Walking Corpse. For some reason, it seems to choose random variation, and I end up with dwarves and falcons. Is there a way to clearly specify the basic Walking Corpse?
Do you want to create a unit from the walking corpse without any variation? Just the base 'variation'? :hmm:
Only this one?
Only this one?
zombie.png (804 Bytes) Viewed 2224 times
User avatar
Straff
Posts: 124
Joined: September 27th, 2020, 2:53 pm

Re: undead variation to recruit list

Post by Straff »

Wiki wrote:undead_variation: Will override the default provided by the [unit_type]. This is generally not set manually.
https://wiki.wesnoth.org/SingleUnitWML
BajMic
Posts: 72
Joined: January 24th, 2023, 1:22 am

Re: undead variation to recruit list

Post by BajMic »

Saizo-Luz wrote: July 27th, 2024, 11:42 am
BajMic wrote: July 25th, 2024, 11:06 am I am trying to define new unit type, but I want it to inherit from basic Walking Corpse. For some reason, it seems to choose random variation, and I end up with dwarves and falcons. Is there a way to clearly specify the basic Walking Corpse?
Do you want to create a unit from the walking corpse without any variation? Just the base 'variation'? :hmm:

zombie.png
That was the idea. I somehow ended with falcons and dwarfs.
User avatar
Saizo-Luz
Posts: 83
Joined: June 14th, 2024, 12:50 pm
Location: High Heavens

Re: undead variation to recruit list

Post by Saizo-Luz »

BajMic wrote: July 30th, 2024, 12:41 pm That was the idea. I somehow ended with falcons and dwarfs.
You just need to copy the walking body file and make the change, removing all variations. I'll do it for you...

Code: Select all

[unit_type]
    id=Walking_Corpse_Base
    name= _ "Walking Corpse"
    profile=portraits/undead/walking-corpse.png
    race=undead
    {TRAIT_FEARLESS_MUSTHAVE}
    image="units/undead/zombie.png"
    hitpoints=18
    movement_type=smallfoot
    movement=4
    level=0
    experience=24
    alignment=chaotic
    advances_to=Soulless
    cost=8
    usage=fighter
    description= _ "Walking Corpses are the bodies of the dead, re-animated by dark magic. Though not especially dangerous to a trained soldier, the sight of one’s former comrades amongst their number is frightening to say the least."
    die_sound={SOUND_LIST:ZOMBIE_WEAK_HIT}
    {DEFENSE_ANIM "units/undead/zombie-defend.png" "units/undead/zombie.png" {SOUND_LIST:ZOMBIE_WEAK_HIT}}
    [death]
        start_time=0
        [frame]
            image="units/undead/zombie-die-[1~4].png:150,units/undead/soulless-die-[5~10].png:150"
        [/frame]
    [/death]

    [resistance]
        arcane=140
    [/resistance]
    [movement_costs]
        deep_water=4
    [/movement_costs]
    [defense]
        deep_water=90
    [/defense]

    [attack]
        name=touch
        description=_"touch"
        icon=attacks/touch-zombie.png
        type=impact
        range=melee
        damage=6
        number=2
        [specials]
            {WEAPON_SPECIAL_PLAGUE}
        [/specials]
    [/attack]

    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        direction=s
        start_time=-200
        [frame]
            image="units/undead/zombie-attack-s.png:400"
            sound=zombie-attack.wav
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        direction=n
        start_time=-200
        [frame]
            image="units/undead/zombie-attack-n.png:400"
            sound=zombie-attack.wav
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        direction=se,sw,ne,nw
        start_time=-200
        [frame]
            image="units/undead/zombie-attack.png:400"
            sound=zombie-attack.wav
        [/frame]
    [/attack_anim]
[/unit_type]
There! ;) No variations... only the base unit!
You can make whatever changes you want - hp, xp, moves, etc. Increase level, improve attack damage... whatever you want.
BajMic
Posts: 72
Joined: January 24th, 2023, 1:22 am

Re: undead variation to recruit list

Post by BajMic »

Nice, thanks!
User avatar
Celtic_Minstrel
Developer
Posts: 2371
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: undead variation to recruit list

Post by Celtic_Minstrel »

If you want to use [base_unit] to avoid duplication, then you would need to delete all the variations in the inherited unit. I think that would mean adding about 20 copies of this block to your [unit_type]:

Code: Select all

[variation]
	__remove=yes
[/variation]
It's likely easier to just make a copy instead, like Saizo-Luz said, but in case you find that to be an issue, this alternative does exist.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
Post Reply