• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Passive hero transformation doesn't recognize animation name

Status
Not open for further replies.
Level 25
Joined
Feb 2, 2006
Messages
1,667
When I use passive hero transformation to transform my hero it ignores the animation name "Upgrade" of the unit it is transformed into.
I've also tried:
JASS:
call AddUnitAnimationProperties(this.character().unit(), "Upgrade", true)
after the transformation but it didn't work either.
The unit is displayed properly with the "Upgrade" animation name in the editor.

Any ideas?
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
A quick
JASS:
    call UnitAddAbility( udg_unit, 'A000')
    call UnitRemoveAbility( udg_unit, 'A000')
    call AddUnitAnimationProperties(udg_unit,"Upgrade",true)
with A000 being bear form and udg_unit being a mountain giant works nice for me.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
You're using the "Art - Required Animation Names", right?

Note that with a passive transformation the unit will not automatically use the new animation name. A move command, use of an ability, or something comparable is required to activate it.

The Object Editor field works, so my guess is that your model is faulty.
 
Level 25
Joined
Feb 2, 2006
Messages
1,667
Hm maybe my code is buggy.
So the animation name should work if I move the unit in the game or cast some ability?

I am using this model: http://www.hiveworkshop.com/forums/models-530/villager-255-animations-192204/

with upgrade it should ride a sheep and that is displayed properly in the editor as well as in the game.

For example when I place the alternative unit from the beginning it rides a sheep.
 
Level 25
Joined
Feb 2, 2006
Messages
1,667
Ok I've tried your map and I've added the call with the Stand animation and then the animation name worked but as soon as I moved the unit it disappeared.

Note that I add many other abilities to the unit directly after the transformation:
JASS:
/*
					 * These two lines of code do the passive transformation to a range fighting unit.
					 */
					call UnitAddAbility(this.character().unit(), this.morphAbilityId())
					call UnitRemoveAbility(this.character().unit(), this.morphAbilityId())
					
					// This line suffices as a "refresh" to show the new animation name
					call SetUnitAnimation(this.character().unit(), "stand")
					// TODO after one order the animation name is disabled
					
					set this.m_isMorphed = true
					
					// add unmorph spell
					if (this.disableGrimoire() or this.disableInventory()) then
						call UnitAddAbility(this.character().unit(), this.abilityId())
					endif
					
					/**
					 * Grimoire spells need to be readded.
					 */
					if (not this.disableGrimoire()) then
						call this.character().updateGrimoireAfterPassiveTransformation()
					endif
					
					/**
					 * Equipment needs to be shown.
					 */
					if (not this.disableInventory()) then
						call this.character().updateInventoryAfterPassiveTransformation()
					endif
			
			
					// morph spells are expected to morph immediately
					call this.onMorph.evaluate()
Probably my own code produces the error since in your map everything works.

The inventory items add attachments with tags as well but afterwards (in method updateInventoryAfterPassiveTransformation()). Could this somehow corrupt the animation name?
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Could this somehow corrupt the animation name?
This code doesn't tell much, but since you seem to do other things with animation it's the probable cause.

Maybe a unit can only have one alternative animation tag?
 
Status
Not open for further replies.
Top