changing the value of 'movment_used' in the [attack] tag ?
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.
changing the value of 'movment_used' in the [attack] tag ?
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.
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.
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]
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.
Re: changing the value of 'movment_used' in the [attack] tag
If you don’t give it skirmish it will still be ZOCed, thuspkz wrote:It can be done by giving the unit skirmish. but i dont want the unit to have that ability.
movement_used=0
will be useless.Re: changing the value of 'movment_used' in the [attack] tag
Then what is the purpose of movement_used in the attack tag if zoc overrides anything you put there?
Re: changing the value of 'movment_used' in the [attack] tag
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.Re: changing the value of 'movment_used' in the [attack] tag
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.
Re: changing the value of 'movment_used' in the [attack] tag
No, that won't work. ZoC zaps movement before the attack.8680 wrote:Also, the unit might be able to move after attacking if you setmovement_cost=
and it kills its target, but that would depend on how exactly ZOC works, which I don’t know.
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).