Range attack is using melee attack animation

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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 » January 23rd, 2018, 8:00 pm

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
Forum Regular
Posts: 1409
Joined: March 6th, 2014, 1:32 pm

Re: Range attack is using melee attack animation

Post by ForestDragon » January 24th, 2018, 7:24 am

you can put "offset=0" inside [frame]s in the ranged animation.
Co-creator of Era of Magic
Creator of Tale of Alan (abandoned) and The Golden Age (1.12/1.13, temporarily abandoned again),XP Bank (1.12/1.13),Alliances Mod(1.12),my franken-art
"Real life is like a hyper-realistic VR game, but with permadeath and boring gameplay"

Enderlook
Posts: 38
Joined: January 22nd, 2018, 12:23 am

Re: Range attack is using melee attack animation

Post by Enderlook » January 24th, 2018, 6:17 pm

Thanks it works. So [frame] has already a default offset?

User avatar
ForestDragon
Forum Regular
Posts: 1409
Joined: March 6th, 2014, 1:32 pm

Re: Range attack is using melee attack animation

Post by ForestDragon » January 24th, 2018, 6:25 pm

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)
Co-creator of Era of Magic
Creator of Tale of Alan (abandoned) and The Golden Age (1.12/1.13, temporarily abandoned again),XP Bank (1.12/1.13),Alliances Mod(1.12),my franken-art
"Real life is like a hyper-realistic VR game, but with permadeath and boring gameplay"

Enderlook
Posts: 38
Joined: January 22nd, 2018, 12:23 am

Re: Range attack is using melee attack animation

Post by Enderlook » January 24th, 2018, 7:38 pm

Ok, thanks.

Post Reply