changing the value of 'movment_used' in the [attack] tag ?

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
pkz
Posts: 30
Joined: April 14th, 2009, 1:11 am

changing the value of 'movment_used' in the [attack] tag ?

Post by pkz »

I have been trying to create a unit that can move, attack and then move again.

After giving up on trying to change it in game i made some custom units. To test, i made a bat. it is a copy of the default, but i changed the ID

the only other changes i made were in the [attack] tag.

Code: Select all

    [attack]
        name=fangs
        description=_"fangs"
        icon=attacks/fangs-animal.png
        type=blade
        range=melee
        damage=5
        number=3
	movement_used=0
        [specials]
            {WEAPON_SPECIAL_SLOW}
        [/specials]
    [/attack]
i added the 'movement_used=0' and changed the weapon special to slow. But the attack still leaves the bat with 0 move after.

This was not very complicated, and seemed pretty straight forward. I have no clue why its not working, or what i am doing wrong.

I had also tried other methods. It can be done by giving the unit skirmish. but i dont want the unit to have that ability. I also hoped i could set the variable in game with a [store_unit] then something like unit.attack[1].(unknown_move_used_variable). But i could never find that mystery variable. It doesnt show in save games. I guess it either doesnt exist, or doesnt show since it is null by default.
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: changing the value of 'movment_used' in the [attack] tag

Post by 8680 »

pkz wrote:It can be done by giving the unit skirmish. but i dont want the unit to have that ability.
If you don’t give it skirmish it will still be ZOCed, thus movement_used=0 will be useless.
pkz
Posts: 30
Joined: April 14th, 2009, 1:11 am

Re: changing the value of 'movment_used' in the [attack] tag

Post by pkz »

Then what is the purpose of movement_used in the attack tag if zoc overrides anything you put there?
User avatar
8680
Moderator Emeritus
Posts: 742
Joined: March 20th, 2011, 11:45 pm
Location: The past

Re: changing the value of 'movment_used' in the [attack] tag

Post by 8680 »

If the unit has skirmisher, then you can use movement_cost= to control how many movement points it loses when it attacks, or in other words how far it can move after attacking. Also, the unit might be able to move after attacking if you set movement_cost= and it kills its target, but that would depend on how exactly ZOC works, which I don’t know.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: changing the value of 'movment_used' in the [attack] tag

Post by zookeeper »

Not to mention that you could have a unit start its turn next to an enemy, attack it, and not lose movement because it never entered anyone's ZoC during that turn.
JaMiT
Inactive Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: changing the value of 'movment_used' in the [attack] tag

Post by JaMiT »

8680 wrote:Also, the unit might be able to move after attacking if you set movement_cost= and it kills its target, but that would depend on how exactly ZOC works, which I don’t know.
No, that won't work. ZoC zaps movement before the attack.

Another case where one could move after attacking is if the unit being attacked does not have a zone of control (such as level 0 units, or maybe the zone was negated by a special ability).
Post Reply