Can't recruit custom units

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
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Can't recruit custom units

Post by Graziani »

Hi!

I'm still working on my troll campaign, all was working fine, and i've just renamed all my id's units.

The game do'nt crash, the level start up, but i can't recruit at all!

If someone can help me...

The code in the scenario

Code: Select all

[side]
type=Godug
id=Godug
name=Godug
facing=sw
x=40
y=29
side=1
team_name=trolls
user_team_name=_"Trolls"
canrecruit=yes
controller=human
recruit=DRS Troll Whelp,DRS Troll Bowler,DRS Initiate
gold=100
shroud=on
[/side]

One of the custom units

Code: Select all

#textdomain wesnoth-frab
[unit_type]
    id=DRS Troll Whelp
    name= _ "Troll Whelp"
    race=troll
    image="units/trolls/whelp.png"
    profile="portraits/trolls/whelp.png"
    ellipse="misc/ellipse"
    {MAGENTA_IS_THE_TEAM_COLOR}
    hitpoints=42
    movement_type=largefoot
    movement=4
    experience=36
    level=1
    alignment=chaotic
    advances_to=DRS Troll
    undead_variation=troll
    cost=13
    usage=fighter
    description= _ "Describing a troll as a whelp is something of an oxymoron, given that their bodies are already much hardier than that of a grown man. They are clumsy and not yet capable of walking properly, forced instead to shamble about on all fours, but any difficulty this causes them is more than made up for by the raw strength of their race."+{SPECIAL_NOTES}+{SPECIAL_NOTES_REGENERATES}
    die_sound={SOUND_LIST:TROLL_DIE}
    [abilities]
        {ABILITY_REGENERATES}
    [/abilities]
    [portrait]
        size=400
        side="left"
        mirror="false"
        image="portraits/trolls/transparent/whelp.png"
    [/portrait]
    [portrait]
        size=400
        side="right"
        mirror="true"
        image="portraits/trolls/transparent/whelp.png"
    [/portrait]
    [attack]
        name=fist
        description=_"fist"
        icon=attacks/fist-troll.png
        type=impact
        range=melee
        damage=7
        number=2
    [/attack]
    {DEFENSE_ANIM "units/trolls/whelp-defend.png" "units/trolls/whelp-defend-2.png" {SOUND_LIST:TROLL_HIT} }
    # images for death are still based on the old, green baseframe
    # commenting out till the images are updated
    #    [death]
    #        start_time=0
    #        [frame]
    #            duration=100
    #            image="units/trolls/whelp-die-1.png"
    #        [/frame]
    #        [frame]
    #            duration=100
    #            image="units/trolls/whelp-die-2.png"
    #        [/frame]
    #        [frame]
    #            duration=100
    #            image="units/trolls/whelp-die-3.png"
    #       [/frame]
    #        [frame]
    #            duration=100
    #            image="units/trolls/whelp-die-4.png"
    #        [/frame]
    #        [frame]
    #            duration=200
    #            image="units/trolls/whelp-skeleton.png"
    #        [/frame]
    #        [frame]
    #            duration=100
    #            image="units/trolls/whelp-die-5.png"
    #        [/frame]
    #        [frame]
    #            duration=100
    #            image="units/trolls/whelp-die-6.png"
    #        [/frame]
    #        [frame]
    #            duration=250
    #            image="units/trolls/whelp-die-7.png"
    #        [/frame]
    #    [/death]
    [idle_anim]
        {STANDARD_IDLE_FILTER}
        start_time=0
        [frame]
            duration=100
            image="units/trolls/whelp-idle-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-6.png"
        [/frame]
        [frame]
            duration=150
            image="units/trolls/whelp-idle-7.png"
        [/frame]
        [frame]
            duration=175
            image="units/trolls/whelp-idle-6.png"
        [/frame]
        [frame]
            duration=150
            image="units/trolls/whelp-idle-7.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-6.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/trolls/whelp-idle-1.png"
        [/frame]
    [/idle_anim]
    [attack_anim]
        [filter_attack]
            name=fist
        [/filter_attack]
        start_time=-250
        [frame]
            duration=100
            image="units/trolls/whelp-attack-1.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                duration=125
                image="units/trolls/whelp-attack-2.png"
                sound=fist.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                duration=125
                image="units/trolls/whelp-attack-2.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            duration=100
            image="units/trolls/whelp-attack-3.png"
        [/frame]
        [frame]
            duration=75
            image="units/trolls/whelp-attack-1.png"
        [/frame]
        [frame]
            duration=50
            image="units/trolls/whelp.png"
        [/frame]
    [/attack_anim]
[/unit_type]

Thanks in advance!
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
Huston
Posts: 1070
Joined: April 29th, 2009, 8:26 pm
Location: Somewhere in this World(I Think)

Re: Can't recruit custom units

Post by Huston »

did you include the location of the custom units in the _main.cfg? like in Era of the future i made a mini(micro) campaign to go with it. had to include the place to find the custom units.
coded Rebellion During the Dark Age
Currently working on:
Era of the Future
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Can't recruit custom units

Post by Graziani »

My main cfg:

Code: Select all

#textdomain wesnoth-frab
[textdomain]
    name="wesnoth-frab"
[/textdomain]

# wmlscope: set export=no
[campaign]
    id=De_rocs_et_de_sang
    icon="data/add-ons/De_rocs_et_de_sang/images/units/trolls/godug.png~RC(magenta>red)"
    image="data/add-ons/De_rocs_et_de_sang/images/campaign_image.png"
    name= _ "De rocs et de sang"
    abbrev= _ "DRS"
    rank=15
    first_scenario="01_Un_nouveau_chef"
    difficulties="EASY,NORMAL,HARD"
    difficulty_descriptions={MENU_IMG_TXT2 "units/trolls/whelp.png~RC(magenta>red)" _"Ptit gars" _"(Beginner)"} +
    ";*" + {MENU_IMG_TXT2 "units/trolls/grunt.png~RC(magenta>red)" _"Cogneur" _"(Normal)"} + ";" +
    {MENU_IMG_TXT2 "units/trolls/warrior.png~RC(magenta>red)" _"Guerrier" _"(Challenging)"}
    define="CAMPAIGN_DE_ROCS_ET_DE_SANG"
    description=_ "Il est temps d'unifier les trolls et de faire taire les querelles incessantes avec les voisins! Que ce soit pacifiquement ou dans le sang n'a plus d'importance!

" + _"(Advanced level, 14 scenarios.)"

[/campaign]

#ifdef CAMPAIGN_DE_ROCS_ET_DE_SANG
[binary_path]
    path="data/add-ons/De_rocs_et_de_sang"
[/binary_path]
[+units]
	{~add-ons/De_rocs_et_de_sang/units/}
[/units]
{~add-ons/De_rocs_et_de_sang/utils}
{~add-ons/De_rocs_et_de_sang/scenarios}
{~add-ons/De_rocs_et_de_sang/maps}
#endif
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Can't recruit custom units

Post by zookeeper »

Graziani wrote:

Code: Select all

[+units]
	{~add-ons/De_rocs_et_de_sang/units/}
[/units]
So do you have your unit .cfg's in that directory or in subdirectories? It needs to be the former.
Graziani wrote:

Code: Select all

{~add-ons/De_rocs_et_de_sang/maps}
No need to do that, it does nothing.
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Can't recruit custom units

Post by Graziani »

Here are the cfg units in the good directory. I really don't understand
Attachments
units.rar
(26.95 KiB) Downloaded 118 times
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Can't recruit custom units

Post by Graziani »

And this is the campaign file organization...
Attachments
main.png
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Can't recruit custom units

Post by zookeeper »

You have "DRS Initiate" in your recruit list, whereas the unit id is presumably "DRS Troll Initiate". An unrecognized unit type in a recruit list (unfortunately) causes the recruit list to not work at all.
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Can't recruit custom units

Post by Graziani »

That's it!!!!!!

Thanks a lot and like always it was very simple error...

Thanks!
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
Post Reply