Age of Mythology: Extended Edition

Age of Mythology: Extended Edition

Advance to the Steam Age
Explore modified graphics as well as new scenarios, maps, AI, and more! Ready to share your creations with the world? Upload right from the in-game mod manager.
nate_e 4 27 Aug, 2019 @ 2:47pm
ChargedRangedAttack not working.
I've been modding this game for a long time and I'm very good at it, but I've encountered something that stumped me.

I'm trying to create a unit (an infantry but shouldn't matter) that only attacks every 3 or so seconds but does a powerful area attack. I have this in proto2.7 (irrelevant data cut out):

<Flag>AreaDamageConstant</Flag>
<ProjectileProtoUnit>Arrow</ProjectileProtoUnit> <!--Todo: Change this-->
<RechargeTime>3.0</RechargeTime>
<Command>Work</Command>
<Action name="RangedAttack">
<Param name="MaximumRange" value1="0.5"/>
<Param name="Rate" type="All" value1="1"/>
</Action>
<Action name="ChargedRangedAttack">
<Param name="MaximumRange" value1="0.5"/>
<Param name="Rate" type="All" value1="1"/>
<Param name="AttackAction"/>
<Param name="ChargeAction"/>
<Param name="Accuracy" value1="1.0"/>
<Param name="TrackRating" value1="10"/>
<Param name="Damage" type="Hack" value1="25" value2="4.0" options="AttackEnemy|AttackGaiaUnits|AttackGaiaBuildings"/>
<Param name="DamageBonus" type="LogicalTypeMinimapFilterEconomic" value1="0.25"/>
<Param name="NumberProjectiles" value1="1"/>
</Action>

The "RangedAttack" is only there so that it can be ordered to attack while recharging, it does no damage (think I've seen this before with no issues).
In its anim file I've defined Charging (as a copy of its Idle) and ChargedRangedAttack, RangedAttack, and even Attack (refering to handattack action which this guy doe not even have) as duplicates of its sword-swinging action.

Yet when this unit gets close enough to attack, he just stands there and makes no attempt to do any kind of attack. Anybody got anything?

Edit: I should add that I *could* make it a regular HandAttack and then put "length 3.0" in its anim file, but I don't want to for several reasons. 1. If I can get this to work, I had visions of applying it to all the protos and then when referencing an action in techtree, I can just say ChargedRangedAttack instead of having to constantly refer to HandAttack or RangedAttack dpending on the unit. 2. The above would cause the attack to be visually performed very slowly and the unit couldn't be retasked while mid-attack. This way it works more like a rate-of-fire/attack-and-reload approach.
Last edited by nate_e; 27 Aug, 2019 @ 2:54pm
< >
Showing 1-3 of 3 comments
XLightningStormL 54 27 Aug, 2019 @ 10:57pm 
Judging by the situation, the only thing I can think of is either the unitaitype or the attack tags in the anim file's section. Can you post an excerpt of the unitaitype, and the "Charging" section of the anim please?
Zeus 19 28 Aug, 2019 @ 5:51am 
Like said above, unitaitype should block the action. You picked a warrior ( close range ai type ) to have charged#ranged# to inflict damage to close range....why not whirlwind or gore?

Last edited by Zeus; 28 Aug, 2019 @ 5:52am
nate_e 4 30 Aug, 2019 @ 6:31pm 
The UnitAIType only dictates what classes the unit is allowed to target with an attack action. It shouldn't make a difference with whether a particular action can exist for a proto. I even tried changing the unitaitype to RangedCombative (even tho it would allow him to target flying units) and nothing.

I did "fix" the problem by changing this action to whirlwind attack and defining an anim for whirlwind attack. So it would seem there is some hard-coded shenanigans with ChargedRangedAttack, having requirements on the maximum range (my guess). I had hoped I could use charged ranged attack on both ranged and hand units, but it wasn't meant to be...
< >
Showing 1-3 of 3 comments
Per page: 1530 50