Axefighterr's questions

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
axefighterr
Posts: 27
Joined: May 1st, 2012, 9:16 am
Location: Poland
Contact:

Re: Axefighterr's questions

Post by axefighterr »

I'm back again. Question: how to make an attack animation where:
* attacker is not moving, but has a frame (like in ranged),
* there is no missile (or blank one can be used),
* there is a halo on attacker,

I wanted to do an animation where attacker explodes, but this is the only i could do:

Code: Select all

    [attack_anim]
        [filter_attack]
            name=explosion
        [/filter_attack]
        [missile_frame]
            begin=-150
            end=0
            image="misc/blank-hex.png"
            image_diagonal="misc/blank-hex.png"
        [/missile_frame]
        [missile_frame]
            
	halo="projectiles/fireball-impact-[1~16].png~FL(vert):60"
            
	offset=0.0
       
        [/missile_frame]
    [/attack_anim]
Anybody knows how to do it?
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Axefighterr's questions

Post by Ravana »

Check if EoMa_Master_of_Fire inferno animation mechanic is what you wanted.
User avatar
Astoria
Inactive Developer
Posts: 1007
Joined: March 20th, 2008, 5:54 pm
Location: Netherlands

Re: Axefighterr's questions

Post by Astoria »

uhh something like this?

Code: Select all

offset=0.0
start_time=-600
halo_start_time=-500

[frame]
    image=*path here*
[/frame]

[halo_frame]
    halo="projectiles/fireball-impact-[1~16].png~FL(vert):60"
[/halo_frame]
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.
User avatar
axefighterr
Posts: 27
Joined: May 1st, 2012, 9:16 am
Location: Poland
Contact:

Re: Axefighterr's questions

Post by axefighterr »

Ravana, Master of Fire animation fits perfectly. Thanks!

Now another issue: how to give every unit which is damaged by this code a hit and/or death cry? Now it only works for the original target, but should work also for units near the attacker and attacker.

This I have in unit file:

Code: Select all

...
[advancement]
    id=explosion
    description=Explosion
    always_display=true
    image=icons/explosion-red-3.png
    require_amla=hp4
    max_times=1
    [effect]
        apply_to=new_attack
        name=explosion
        description=_"explosion"
        icon=icons/explosion-red-3.png
        type=fire
        range=ranged
        damage=50
        number=1
        [specials]
            {WEAPON_SPECIAL_WA_NOCOUNTER}
            {WEAPON_SPECIAL_MAGICAL}
            {WEAPON_SPECIAL_EXPLOSION}
        [/specials]
    [/effect]
    [effect]
        apply_to=max_experience
        increase=4   
    [/effect]
    [effect]
        apply_to=hitpoints
        increase=30%
    [/effect]
[/advancement]

    {AREA_ATTACK explosion 50 20}
...
And this in macros (code was made by Jarom):

Code: Select all

#define AREA_ATTACK_BODY DMG DMG2 X Y X2 Y2
    [store_unit]
        [filter]
            [filter_adjacent]
                x,y={X},{Y}
            [/filter_adjacent]
            [not]
                x,y={X2},{Y2}
            [/not]
        [/filter]
        variable=inarea
    [/store_unit]
    [store_unit]
        [filter]
            x,y={X},{Y}
        [/filter]
        variable=damager
    [/store_unit]
    [if]
        [variable]
            name=damager.status.slowed
            not_equals=yes
        [/variable]
        [then]
            {VARIABLE areadmg {DMG}}
        [/then]
        [else]
            {VARIABLE areadmg {DMG}}
            {VARIABLE_OP areadmg divide 2}
        [/else]
    [/if]

    {FOREACH inarea i}
        {RANDOM 1..100}
        [if]
            [variable]
                name=random
                less_than_equal_to=70
            [/variable]
            [then]
                [harm_unit]
                    [filter]
                        x,y=$inarea[$i].x,$inarea[$i].y
                    [/filter]
                    [filter_second]
                       x,y={X},{Y}
                    [/filter_second]
                    amount=$areadmg
                    damage_type=fire
                    aligment=lawful
                    fire_event=yes
                    animate=no
                    experience=yes
                [/harm_unit]
            [/then]
        [/if]
    {NEXT i}
    [harm_unit]
        [filter]
            x,y={X},{Y}
        [/filter]
        amount={DMG2}
        damage_type=fire
        aligment=lawful
        fire_event=no
        animate=no
        experience=no
    [/harm_unit]
#enddef

#define WEAPON_SPECIAL_EXPLOSION
    [dummy]
        id=explosion
        name= _ "explosion"
        description=_"This attack hits all enemies near to the attacker. Additionally attacker receives some damage due to recoil."
    [/dummy]
#enddef

#define AREA_ATTACK WEAPON DMG DMG2
    [event]
        name=attacker hits
        first_time_only=no

        [filter_attack]
            name={WEAPON}
        [/filter_attack]
       
        {AREA_ATTACK_BODY {DMG} {DMG2} $x1 $y1 $x2 $y2}
    [/event]
    [event]
        name=attacker misses
        first_time_only=no

        [filter_attack]
            name={WEAPON}
        [/filter_attack]
       
        {AREA_ATTACK_BODY {DMG} {DMG2} $x1 $y1 $x2 $y2}
    [/event]
#enddef
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Axefighterr's questions

Post by Ravana »

Currently you have animate=no and fire_event=no. One of that might affect sounds too.

If that fails you can add sounds to event.
User avatar
axefighterr
Posts: 27
Joined: May 1st, 2012, 9:16 am
Location: Poland
Contact:

Re: Axefighterr's questions

Post by axefighterr »

Another question: how to enable additional unit advancements (Like Ancient Lich and Dwarvish Arcanister) in UMC Era without making new unit.cfg files? I want make an Era with mixed sets of units on which even people without it could play with me.
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Axefighterr's questions

Post by Ravana »

(post)advance event. Can change unit.advances_to.
User avatar
axefighterr
Posts: 27
Joined: May 1st, 2012, 9:16 am
Location: Poland
Contact:

Re: Axefighterr's questions

Post by axefighterr »

Can you tell where insert it? In Era_Eras.cfg, _main.cfg or faction.cfg?
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Axefighterr's questions

Post by Ravana »

In [era], no matter in which of these files you keep it.
User avatar
axefighterr
Posts: 27
Joined: May 1st, 2012, 9:16 am
Location: Poland
Contact:

Re: Axefighterr's questions

Post by axefighterr »

Okay, but how to change unit's advancement via event? Like Inferno Drake -> Armageddon Drake. I tried something here: http://wiki.wesnoth.org/Effectwml but with no results. I just want make an add-on which is not required from second player to play with him. Anybody has any advice?
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Axefighterr's questions

Post by Ravana »

{VARIABLE unit.advances_to (Armageddon Drake)} and unstore.
User avatar
axefighterr
Posts: 27
Joined: May 1st, 2012, 9:16 am
Location: Poland
Contact:

Re: Axefighterr's questions

Post by axefighterr »

Reviving my old thread with possibly silly question: how to implement a feature in an UNIT.CFG file which will remember how many times you picked a non-standard advancement (like in UtBS)? For example: fighter with 40hp and 10-2 sword attack levels up and can advance in 3 ways: +4hp (infinite), +1 melee damage (infinite), +6-3 mace attack. And I want to be sure that damage bonus will be retroactive when I choose a mace, so there should be no damage difference between damage->mace and mace->damage. I know that it is possible (like in SXC), but i want it to be implemented in an unit file, because my scenario will be more level-driven than money-driven.

Thanks in advance.
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Axefighterr's questions

Post by Ravana »

Try with unit.variables.something and on picking new weapon using that value.
User avatar
Eagle_11
Posts: 759
Joined: November 20th, 2013, 12:20 pm

Re: Axefighterr's questions

Post by Eagle_11 »

Umm, sorry for asking but i need to learn.
How exactly to use this:

Code: Select all

unit.advances_to
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Axefighterr's questions

Post by Ravana »

You can modify that key to change what unit type advancement possibilities that unit has.
Post Reply