Problem with creating a unit

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
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Problem with creating a unit

Post by Lehor »

Hey, dear people,

I must confess that I am experiencing problems with adding a unit called "Cold Soul" to the units of the faction Despair of Ageless Era. Actually, the unit Cold Soul advances from the Widow and it has a weapon special that is named "Drain". So, I made this extra unit by myself but when I was trying to open a local game there was an error message saying that there were probably nested quote strings related to the abilities file inherent to Wesnoth. Then I noticed that I had put the special ability text in the configuration file of the Cold Soul supposedly at the wrong place and I fixed this. Yet, when opening a local game, I can not choose Ageless Era and I got another error message after the change but now I don't get the error messages anymore.

Here is the configuration file of the unit:

Code: Select all

#textdomain wesnoth-Ageless_Era

[unit_type]
    id=AE_arc_despair_Cold_Soul
    name= _ „Cold Soul„
    race=AE despair
    gender=female
    image="units/despair/phantomcoldsoul.png"
    #    profile="portraits/.png"
    {MAGENTA_IS_THE_TEAM_COLOR}
    ellipse="misc/ellipse"
    hitpoints=38
    movement_type=AE_arc_despair_foot
    movement=6
    experience=100
    level=2
    alignment=chaotic
    advances_to=„AE_arc_despair_Withered_Rose„
    cost=30
    usage=archer
    description= _ „The Cold Souls roam almost eternally through the dark places of this world, hiding for the sun and bound to darkness. Once actually, they were normal women but the wars that devastated them let their hearts turn into ice, there seems to be another guide for them than a heart, right now.“
    die_sound=lich-die.ogg
    [defend]
        start_time=-126
        [if]
            hits=hit,kill
            offset=0.0~-0.05:126,-0.05~0.0:126
            alpha=0.8~0.5:126,0.5~0.8:126
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=150
                image="units/despair/phantomcoldsoul-defend.png"
                sound={SOUND_LIST:HUMAN_FEMALE_HIT}
            [/frame]
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
        [/if]
        [else]
            hits=miss
            offset=0.0~-0.1:126,-0.1~0.0:126
            alpha=0.8~0.25:126,0.25~0.8:126
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=150
                image="units/despair/phantomcoldsoul-defend.png"
            [/frame]
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
        [/else]
    [/defend]
    [attack]
        name=touch
        description=_“Frozen Touch"
        icon=attacks/touch-undead.png
        type=cold
        range=melee
        damage=8
        number=2
    [/attack]
    [attack]
        name=delectation_of_sorrow
        description=_“Delectation of Sorrow“
        icon=attacks/delectation-of-sorrow-icon.png
        type=cold
        range=ranged
        damage=17
        number=2
        [specials]
            {WEAPON_SPECIAL_DRAIN}
        [/specials]
    [/attack]

    [attack_anim]
        [filter_attack]
            name=delectation_of_sorrow
        [/filter_attack]

        [missile_frame]
            begin=0
            end=-50
            image="projectiles/delecation-of-sorrow.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack.png"
        [/missile_frame]
        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=150
            image="units/despair/phantomcoldsoul.png"
            sound=wail.wav
        [/frame]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        start_time=-500
        offset=0.0~1.0:425,0.0:225
        alpha=0.8~0.0:425,0.0~0.8:225

        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=175
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=175
            image="units/despair/phantomcoldsoul-attack.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul-attack.png"
                # change this
                sound=slowed.wav
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul-attack.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
    [/attack_anim]
    {AE_DESPAIR_STAND phantomcoldsoul}
[/unit_type]
I would be really delighted if somebody could help me with this somehow! :) And I thank you for having read this! ;)

Greets
Lehor
User avatar
Ravana
Forum Moderator
Posts: 3319
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Problem with creating a unit

Post by Ravana »

name= _ „Cold Soul„Change quotes like this to normal ".

However please do not use AE_..._..._ type prefix for your units ids, that is just to avoid clashes.
User avatar
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Re: Problem with creating a unit

Post by Lehor »

Hey, Ravana,

thank you very much! :)

So, this is the present state of the configuration of the unit "Cold Soul":

Code: Select all

#textdomain wesnoth-Ageless_Era

[unit_type]
    id=Cold_Soul
    name= _ "Cold Soul"
    race=AE despair
    gender=female
    image="units/despair/phantomcoldsoul.png"
    #    profile="portraits/.png"
    {MAGENTA_IS_THE_TEAM_COLOR}
    ellipse="misc/ellipse"
    hitpoints=38
    movement_type=AE_arc_despair_foot
    movement=6
    experience=100
    level=2
    alignment=chaotic
    advances_to="Withered_Rose"
    cost=30
    usage=archer
    description= _ "The Cold Souls roam almost eternally through the dark places of this world, hiding for the sun and bound to darkness. Once actually, they were normal women but the wars that devastated them let their hearts turn into ice, there seems to be another guide for them than a heart, right now."
    die_sound=lich-die.ogg
    [defend]
        start_time=-126
        [if]
            hits=hit,kill
            offset=0.0~-0.05:126,-0.05~0.0:126
            alpha=0.8~0.5:126,0.5~0.8:126
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=150
                image="units/despair/phantomcoldsoul-defend.png"
                sound={SOUND_LIST:HUMAN_FEMALE_HIT}
            [/frame]
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
        [/if]
        [else]
            hits=miss
            offset=0.0~-0.1:126,-0.1~0.0:126
            alpha=0.8~0.25:126,0.25~0.8:126
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=150
                image="units/despair/phantomcoldsoul-defend.png"
            [/frame]
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
        [/else]
    [/defend]
    [attack]
        name=touch
        description=_“Frozen Touch"
        icon=attacks/touch-undead.png
        type=cold
        range=melee
        damage=8
        number=2
    [/attack]
    [attack]
        name=delectation_of_sorrow
        description=_“Delectation of Sorrow“
        icon=attacks/delectation-of-sorrow-icon.png
        type=cold
        range=ranged
        damage=17
        number=2
        [specials]
            {WEAPON_SPECIAL_DRAIN}
        [/specials]
    [/attack]
    [attack_anim]
        [filter_attack]
            name=delectation_of_sorrow
        [/filter_attack]

        [missile_frame]
            begin=0
            end=-50
            image="projectiles/delecation-of-sorrow.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack.png"
        [/missile_frame]
        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=150
            image="units/despair/phantomcoldsoul.png"
            sound=wail.wav
        [/frame]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        start_time=-500
        offset=0.0~1.0:425,0.0:225
        alpha=0.8~0.0:425,0.0~0.8:225

        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=175
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=175
            image="units/despair/phantomcoldsoul-attack.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul-attack.png"
                # change this
                sound=slowed.wav
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul-attack.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
    [/attack_anim]
    {AE_DESPAIR_STAND phantomcoldsoul}
[/unit_type]
Now I screenshot the error message that I still get:
Image
User avatar
Ravana
Forum Moderator
Posts: 3319
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Problem with creating a unit

Post by Ravana »

All cases of those quotes not just with unit name.

Code: Select all

description=_“Delectation of Sorrow“
description=_“Frozen Touch"
User avatar
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Re: Problem with creating a unit

Post by Lehor »

Hello,

I have to reveal that the problem is solved by now! Thank you very much for your second advice! :)

Greets
User avatar
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Re: Problem with creating a unit

Post by Lehor »

Hey,

I got to admit that I encountered another problem:

Code: Select all

    [attack_anim]
        [filter_attack]
            name=delectation_of_sorrow
        [/filter_attack]
        
        [frame]
            begin=150
            end=300
            image="units/despair/phantomcoldsoul.png"
            image="projectiles/delectation-of-sorrow-attack-1.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-1.png"
        [/frame]

        [frame]
            begin=300
            end=450
            image="units/despair/phantomcoldsoul.png"
            image="projectiles/delectation-of-sorrow-attack-2.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-2.png"
        [/frame]

        [frame]
            begin=450
            end=600
            image="units/despair/phantomcoldsoul.png"
            image="projectiles/delectation-of-sorrow-attack-3.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-3.png"
        [/frame]

        [frame]
            begin=600
            end=750
            image="units/despair/phantomcoldsoul.png"
            image="projectiles/delectation-of-sorrow-attack-4.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-4.png"
        [/frame]

        [frame]
            begin=750
            end=900
            image="units/despair/phantomcoldsoul.png"
            image="projectiles/delectation-of-sorrow-attack-5.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-5.png"
        [/frame]

        [frame]
            begin=900
            end=1050
            image="units/despair/phantomcoldsoul.png"
            image="projectiles/delectation-of-sorrow-attack-6.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-6.png"
        [/frame]

        [frame]
            begin=1050
            end=1200
            image="units/despair/phantomcoldsoul.png"
            image="projectiles/delectation-of-sorrow-attack-7.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-7.png"
        [/frame]
 
        [frame]
            begin=0
            end=1200
            image="units/despair/phantomcoldsoul.png"
        [/frame]

    [/attack_anim]
The unit keeps on disappearing, when casting the attack, the animation of Delectation of Sorrow works actually, apart from the unit's animation. And the unit also seems to move forward somehow but this is a magical attack and it should just stay in the same place, does anybody know how to fix this? :)
User avatar
Ravana
Forum Moderator
Posts: 3319
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Problem with creating a unit

Post by Ravana »

Possibly requires use of [missile_frame].
User avatar
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Re: Problem with creating a unit

Post by Lehor »

Hi,

thank you. :) But using such frame the animation of the attack doesn't change, only one picture is employed though the animation consists of seven pictures.

Greets
Lehor
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Problem with creating a unit

Post by zookeeper »

Reference mainline units. The begin/end syntax is obsolete, and you can't have two of the same key (image= in your case) in the same tag ever anywhere.
User avatar
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Re: Problem with creating a unit

Post by Lehor »

Hey,

thanks, now I got it looking like this:

Code: Select all

[attack_anim]
        [filter_attack]
            name=delectation_of_sorrow
        [/filter_attack]
        [frame]
            image="units/despair/phantomcoldsoul.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-1.png"
        [/frame]
        [frame]
            image="units/despair/phantomcoldsoul.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-2.png"
        [/frame]
        [frame]
            image="units/despair/phantomcoldsoul.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-3.png"
        [/frame]
        [frame]
            image=„units/despair/phantomcoldsoul.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-4.png"
        [/frame]
        [frame]
            image="units/despair/phantomcoldsoul.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-5.png"
        [/frame]
        [frame]
            image="units/despair/phantomcoldsoul.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-6.png"
        [/frame]
        [frame]
            image="units/despair/phantomcoldsoul.png"
            image_diagonal="projectiles/delectation-of-sorrow-attack-7.png"
        [/frame]
    [/attack_anim]
However the attack's animation is absent though the unit is visible by now. Do you know how to render this attack's animation visible as well? :)
User avatar
Crow_T
Posts: 851
Joined: February 24th, 2011, 4:20 am

Re: Problem with creating a unit

Post by Crow_T »

Don't save over anything, because I'm not used to the new format, but first you should try commenting out all the

Code: Select all

image="units/despair/phantomcoldsoul.png"
If that doesn't work, get rid of everything and change it to this, which I got from here: http://wiki.wesnoth.org/AnimationWML

Code: Select all

 [frame]
           image=projectiles/delectation-of-sorrow-attack-[1~7].png
       [/frame]
Not sure about the image_diagonal thing you have going on there though.
User avatar
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Re: Problem with creating a unit

Post by Lehor »

Hi,

thanks. However both the unit's animation and the attack's animation disappear having this text:

Code: Select all

#textdomain wesnoth-Ageless_Era

[unit_type]
    id=Cold_Soul
    name= _ "Cold Soul"
    race=AE despair
    gender=female
    image="units/despair/phantomcoldsoul.png"
    #    profile="portraits/.png"
    {MAGENTA_IS_THE_TEAM_COLOR}
    ellipse="misc/ellipse"
    hitpoints=38
    movement_type=AE_arc_despair_foot
    movement=6
    experience=100
    level=2
    alignment=chaotic
    advances_to="Withered_Rose"
    cost=30
    usage=archer
    description= _ "The Cold Souls roam almost eternally through the dark places of this world, hiding for the sun and bound to darkness. Once actually, they were normal women but the wars that devastated them let their hearts turn into ice, there seems to be another guide for them than a heart, right now."
    die_sound=lich-die.ogg
       [defend]
        start_time=-126
        [if]
            hits=hit,kill
            offset=0.0~-0.05:126,-0.05~0.0:126
            alpha=0.8~0.5:126,0.5~0.8:126
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=150
                image="units/despair/phantomcoldsoul-defend.png"
                sound={SOUND_LIST:HUMAN_FEMALE_HIT}
            [/frame]
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
        [/if]
        [else]
            hits=miss
            offset=0.0~-0.1:126,-0.1~0.0:126
            alpha=0.8~0.25:126,0.25~0.8:126
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul.png"
            [/frame]
            [frame]
                duration=150
                image="units/despair/phantomcoldsoul-defend.png"
            [/frame]
            [frame]
                duration=1
                image="units/despair/phantomcoldsoul.png"
            [/frame]
        [/else]
    [/defend]
    [attack]
        name=touch
        description=_"Frozen Touch"
        icon=attacks/touch-undead.png
        type=cold
        range=melee
        damage=8
        number=2
    [/attack]
    [attack]
        name=delectation_of_sorrow
        description=_"Delectation of Sorrow"
        icon=attacks/delectation-of-sorrow-icon.png
        type=cold
        range=ranged
        damage=13
        number=2
        [specials]
            {WEAPON_SPECIAL_DRAIN}
        [/specials]
    [/attack]
    [attack_anim]
        [filter_attack]
            name=delectation_of_sorrow
        [/filter_attack]
        [frame]
           image=projectiles/delectation-of-sorrow-attack-[1~7].png
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=touch
        [/filter_attack]
        start_time=-500
        offset=0.0~1.0:425,0.0:225
        alpha=0.8~0.0:425,0.0~0.8:225

        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=175
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=175
            image="units/despair/phantomcoldsoul-attack.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul-attack.png"
                # change this
                sound=slowed.wav
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                duration=100
                image="units/despair/phantomcoldsoul-attack.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=75
            image="units/despair/phantomcoldsoul.png"
        [/frame]
        [frame]
            duration=25
            image="units/despair/phantomcoldsoul.png"
        [/frame]
    [/attack_anim]
    {AE_DESPAIR_STAND phantomcoldsoul}
[/unit_type]
I sent the whole configuration file's text because I reckoned that the problem might originate from another place.
User avatar
doofus-01
Art Director
Posts: 4180
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: Problem with creating a unit

Post by doofus-01 »

You are missing a lot in that animation. Like zookeeper said, use a reference. You could even use the ranged animation of the original widow unit as a reference. (Assuming Ageless Era didn't change it strangely.)
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
User avatar
Lehor
Posts: 17
Joined: January 8th, 2013, 6:22 pm

Re: Problem with creating a unit

Post by Lehor »

Hi,

okay, thanks. But how can I add such reference? Having googled it, I couldn't find it, actually.
User avatar
doofus-01
Art Director
Posts: 4180
Joined: January 6th, 2008, 9:27 pm
Location: USA

Re: Problem with creating a unit

Post by doofus-01 »

I'm not sure what you mean, I think we are having a failure to communicate.

The file that you originally edited to get this far had a ranged animation, right? Take a look at that. The {MISSILE_FRAME_WAIL} line (again, I'm assuming Ageless Era didn't change that from the original) may be a bit confusing, but check out the file <wherever-you-have-wesnoth-data-installed>/data/core/macros/animation-utils.cfg and see how that macro expands, if you want to change something, you can just copy&paste the macro contents into the [attack_anim] and edit it to your needs.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Post Reply