Range attack is using melee attack animation

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
Enderlook
Posts: 38
Joined: January 22nd, 2018, 12:23 am

Range attack is using melee attack animation

Post by Enderlook »

I don't know why but my Healer Saurian moves toward the enemy when he use his range attack.

He has two attack, melee and range:

Code: Select all

    [attack]
        name=staff
        description= _ "staff"
        icon="attacks/staff-magic.png"
        type=impact
        range=melee
        damage=4
        number=2
    [/attack]
    [attack]
        name=missile
        description=_"missile"
        icon=attacks/magic-missile.png
        type=fire
        range=ranged
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
        [/specials]
        damage=6
        number=2
    [/attack]
Also he has two animations:

Code: Select all

[attack_anim]
        [filter_attack]
            name=staff
        [/filter_attack]
        offset=0.0~0.3,0.3~0.45,0.45~0.3,0.3~0.0
        start_time=-250
        [frame]
            duration=150
            image="units/saurians/healer-melee-1.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                duration=100
                image="units/saurians/healer-melee-2.png"
                sound=staff.wav
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                duration=100
                image="units/saurians/healer-melee-2.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            duration=100
            image="units/saurians/healer-melee-3.png"
        [/frame]
        [frame]
            duration=90
            image="units/saurians/healer-melee-4.png"
        [/frame]
        [frame]
            duration=80
            image="units/saurians/healer-melee-5.png"
        [/frame]
        [frame]
            duration=50
            image="units/saurians/healer-defend-1.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=missile
        [/filter_attack]
        {MAGIC_MISSILE 11 -20}
		{HALO_FRAME_SAURIAN}

        start_time=-300
        [frame]
            duration=50
            image="units/saurians/healer-magic-1.png"
            halo="halo/saurian-magic-halo-1.png"
        [/frame]
        [frame]
            duration=60
            image="units/saurians/healer-magic-1.png"
            halo="halo/saurian-magic-halo-2.png"
            sound=magicmissile.wav
        [/frame]
        [frame]
            duration=70
            image="units/saurians/healer-magic-2.png"
            halo="halo/saurian-magic-halo-3.png"
        [/frame]
        [frame]
            duration=80
            image="units/saurians/healer-magic-2.png"
            halo="halo/saurian-magic-halo-4.png"
        [/frame]
        [frame]
            duration=90
            image="units/saurians/healer-magic-2.png"
            halo="halo/saurian-magic-halo-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/saurians/healer.png"
            halo="halo/saurian-magic-halo-6.png"
        [/frame]
        [frame]
            duration=100
            image="units/saurians/healer.png"
            halo="halo/saurian-magic-halo-7.png"
        [/frame]
    [/attack_anim]
I am not sure why I am having this error. Could someone please help me?
User avatar
ForestDragon
Posts: 1770
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: Range attack is using melee attack animation

Post by ForestDragon »

you can put "offset=0" inside [frame]s in the ranged animation.
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
Enderlook
Posts: 38
Joined: January 22nd, 2018, 12:23 am

Re: Range attack is using melee attack animation

Post by Enderlook »

Thanks it works. So [frame] has already a default offset?
User avatar
ForestDragon
Posts: 1770
Joined: March 6th, 2014, 1:32 pm
Location: Ukraine

Re: Range attack is using melee attack animation

Post by ForestDragon »

Enderlook wrote:Thanks it works. So [frame] has already a default offset?
yes. though If there is a [missile_frame] present, the default offset is 0 (offset= value in [frame] still has the higher priority for the animation, though)
My active add-ons: The Great Steppe Era,XP Bank,Alliances Mod,Pestilence,GSE+EoMa,Ogre Crusaders,Battle Royale,EoMaifier,Steppeifier,Hardcoreifier
My inactive add-ons (1.12): Tale of Alan, The Golden Age
Co-creator of Era of Magic
Enderlook
Posts: 38
Joined: January 22nd, 2018, 12:23 am

Re: Range attack is using melee attack animation

Post by Enderlook »

Ok, thanks.
Post Reply