• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to make unit play alternate animation smoothly

Status
Not open for further replies.
Level 9
Joined
Sep 5, 2015
Messages
369
what the farts going on man i spent like 6 hours trying to get this running and it works but the animation is like half-baked and choppy it doesnt actually play an animation it just goes from 1 model to the other with a weird half-animated transition basically no animation at all.
(the model transitions fine when used as crow ability its flawless and no trigger making a unit cast an ability or something like that is working so i gave up on this)
(using this model btw ----------> Mimic )

This is what i have. it works fine BUT IT DOESNT ACTUALLY PLAY THE ANIMATION?
1641615984513.png



or at best the animation will play strangely (like it will just stand up and not do the flip and other cool stuff) then when it's stopped being attacked it will go back to its former house form.

whenever i put a wait timer inbetween play-animation & unit - replace it almost always makes 2 copys of the monster out of nowhere.

basically Animation - Play IS BROKEN. lol. unless its just this model idk.
 
Level 12
Joined
Mar 13, 2020
Messages
421
what the farts going on man i spent like 6 hours trying to get this running and it works but the animation is like half-baked and choppy it doesnt actually play an animation it just goes from 1 model to the other with a weird half-animated transition basically no animation at all.
(the model transitions fine when used as crow ability its flawless and no trigger making a unit cast an ability or something like that is working so i gave up on this)
(using this model btw ----------> Mimic )

This is what i have. it works fine BUT IT DOESNT ACTUALLY PLAY THE ANIMATION?
View attachment 392928


or at best the animation will play strangely (like it will just stand up and not do the flip and other cool stuff) then when it's stopped being attacked it will go back to its former house form.

whenever i put a wait timer inbetween play-animation & unit - replace it almost always makes 2 copys of the monster out of nowhere.

basically Animation - Play IS BROKEN. lol. unless its just this model idk.
Add a 0.20 Second Pause and check it again if it’s still to short go raise the wait for 0.10 + and test it again

Set the Wait before the Replace

Your unit can’t play the full Animation because the Replacer starts instantly behind
Triggers run from top to Bottom so there is no time to play the animation before you instantly replace the unit and stop the animation

And use my the trigger off I mentioned in your other post...
Because this trigger would run each time the unit is attacked... before he finally Morphed and your condition stops it
 
Last edited:
Level 9
Joined
Sep 5, 2015
Messages
369
Add a 0.20 Second Pause and check it again if it’s still to short go raise the wait for 0.10 + and test it again

Set the Wait before the Replace

Your unit can’t play the full Animation because the Replacer starts instantly behind
Triggers run from top to Bottom so there is no time to play the animation before you instantly replace the unit and stop the animation
ive tried playing with the wait timers (i havent tried add 0.10 every time BECAUSE:) but it will create dupes of the monster once replaced. and even when i go it to work fine (think it was .50 wait or something) the animation just lifts up legs under itself and never does the complete full animation (where it jumps into the area and the house shifts around and stuff. its really smooth tbh. thats why i want it to show so bad)
but i will continue to try the wait timers anyways..

Add a 0.20 Second Pause and check it again if it’s still to short go raise the wait for 0.10 + and test it again
ALSO you saying 0.20 second PAUSE? or 0.20 second wait? didnt know pause could be timed?



ALSO
1641618503031.png

i can set this to 5seconds or 500 seconds but it just doesn't play the animation lmao. 0.20-0.30 seconds make its spawn 3 units now
i think 0.50-1second was 2 units. then i hit the sweet spot at one point before and it wouldnt spawn multiple guys but it still didnt play animation. blizzard is broke.
 
Level 12
Joined
Mar 13, 2020
Messages
421
Wait ... my bad and read the other thread about turn off the trigger after the first hit that would let the wait work and don’t bug your trigger

You don’t get it brother...

Turn the damn trigger off xD I’m on phone and can’t show you an Example also I don’t know if Alternate is the Right AnimationName

Should it not be Morph or something just check the Animation Name of the Animation you want to Play when he do it

Open your Trigger Editor
Add a New Action
Go into Trigger and then
Trigger - Turn off this Trigger
And move it to the first position before you even pause the unit
Then you can add 10 seconds the trigger will run only one time the issue you have is

Your trigger runs
And before the wait is over it runs another two times and then it replace your unit and your condition of the unit type stops then the other times this could run

Meaning

Unit is attacked

Attacked Unit equal Pladin

Play Animation Stand Channel
Wait 5 Seconds
Create a Footman bla bla

What happens now is my unit get attacked by 1 demon Hunters with 1 Second Attack cooldown

That means

First Attack
The trigger runs

Second attack
Trigger runs two times
On is on second 4 in wait
The second is on wait 5

Third attack
And and and

That means after 5 seconds it will create infinitely each second a Footman because it never stops

And maybe even more Footman because the attack 11 and attack 26 have the same time in wait like attack 28 / 50 / and attack 60

That means sometimes it will create even more Footmans
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
Replace literally removes the current unit and puts a new one in its place. Logically the animation is discontinuous.

I think Reforged added some actions, or at least functions, that can be used to change a unit's model. This would be preferable over the replace action as that also breaks all references to the unit due to it making an entirely new unit.

For the animation you logically need to use a wait of sorts to let the animation play out. You also probably need to specify an explicit animation name to play, not just "alternate" which usually marks an entire set of animations. Such animation is usually a morph, or upgrade.
 
Level 12
Joined
Mar 13, 2020
Messages
421
Replace literally removes the current unit and puts a new one in its place. Logically the animation is discontinuous.

I think Reforged added some actions, or at least functions, that can be used to change a unit's model. This would be preferable over the replace action as that also breaks all references to the unit due to it making an entirely new unit.

For the animation you logically need to use a wait of sorts to let the animation play out. You also probably need to specify an explicit animation name to play, not just "alternate" which usually marks an entire set of animations. Such animation is usually a morph, or upgrade.
He is in an infinity running trigger before the unit replace that means
Before he play the animation
A other unit hits him and the trigger run again and the trigger says play the animation that means the unit plays the animation from beginning before he even stoped the first time causing the unit to play the animation 3 times before he even morphed
 
Level 9
Joined
Sep 5, 2015
Messages
369
Replace literally removes the current unit and puts a new one in its place. Logically the animation is discontinuous.
i know but even when i said a wait timer to let the animation play out it just makes the mimic-house stand up. legs shoot out from under it and its there. then its replaced. it looks "OKAY" but it never plays the animation
I think Reforged added some actions, or at least functions, that can be used to change a unit's model. This would be preferable over the replace action as that also breaks all references to the unit due to it making an entirely new unit.
......fart me..
For the animation you logically need to use a wait of sorts to let the animation play out. You also probably need to specify an explicit animation name to play, not just "alternate" which usually marks an entire set of animations. Such animation is usually a morph, or upgrade.

waits don't work unless im literally handicapped mentally. and as for that i dont know what else i would use. the model doesn't specify in the description what string to use. so naturally i use alternate. tried morph does the same thing. ill try upgrade lol brb
 
Level 9
Joined
Sep 5, 2015
Messages
369
That means after 5 seconds it will create infinitely each second a Footman because it never stops

And maybe even more Footman because the attack 11 and attack 26 have the same time in wait like attack 28 / 50 / and attack 60

That means sometimes it will create even more Footmans
I have gotten this fixed with the pauses (as seen in my original post's picture)
but the animation won't play out fully

only thing i can think of is if i make the computer (i disabled the map initialization so by computer i just mean i don't have control over the ability being turned on or off manually by myself or another player's doing) cast the ability through triggers. which seems to not work either.

Im just confused as to how simple these triggers are but they don't work and it makes no sense (same with trying to use triggers to make a unit cast an ability (which would solve all of my problems))
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
the model doesn't specify in the description what string to use
It kind of does. You can read the animation names off the model preview window of the terrain editor. You can also use third party tools like Retera's Model Studio to look up the animation names directly for a specific model.

could this be the problem? (just want to clarify this_)
Yes it could cause extra difficulties if the animations were not named or setup correctly.

(same with trying to use triggers to make a unit cast an ability (which would solve all of my problems))
This was explained in the thread you necroed. You need to order the unit to cast the ability your custom ability is based off. You also need to make sure not to corrupt the orderID by custom channel abilities using it with a different target type.
 
Level 12
Joined
Mar 13, 2020
Messages
421
  • Create Footman
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Paladin
    • Actions
      • Unit - Pause (Attacked unit)
      • Animation - Play (Attacked unit)'s Stand Channel animation
      • Wait 5.00 seconds
      • Unit - Create 1 Irrwisch for Player 1 (Red) at (Random point in Some Area <gen>) facing Default building facing degrees
      • Unit - Unpause (Attacked unit)
Watch and learn what happens...

  • Create Footman
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacked unit)) Equal to Paladin
    • Actions
      • Trigger - Turn off (This trigger)
      • Unit - Pause (Attacked unit)
      • Animation - Play (Attacked unit)'s Stand Channel animation
      • Wait 5.00 seconds
      • Unit - Create 1 Irrwisch for Player 1 (Red) at (Random point in Some Area <gen>) facing Default building facing degrees
      • Unit - Unpause (Attacked unit)
Watch now with Turn the Trigger Off


Thats your first Problem...

you dont turn the trigger off..

the second problem is you are using the Wrong Animation Name... can you link the custom unit that you have here so we can check the animation name...?
 
Level 9
Joined
Sep 5, 2015
Messages
369
It kind of does. You can read the animation names off the model preview window of the terrain editor. You can also use third party tools like Retera's Model Studio to look up the animation names directly for a specific model.
wow i had totally forgotten about that little feature man thanks for the reminder. also i tried morph it doesnt work (it's morph)
This was explained in the thread you necroed. You need to order the unit to cast the ability your custom ability is based off. You also need to make sure not to corrupt the orderID by custom channel abilities using it with a different target type.
I only tried editing the Default Metamorphosis and then Druid Crow form abilities. Never tried using channel or a dummy. did you guys assume that I had?
 
Level 9
Joined
Sep 5, 2015
Messages
369
what happens with your try with metamorphosis? why should it not work?
1641621217968.png


i tried this with metamorphosis AND druid of talon/crow ability.

idk why it doesnt work. i didnt even make a custom ability just changed the default ability that the trigger should path to. no?

alternate works for the model
morph/alternate/upgrade all work for the trigger by the way.

so the name shouldn't be the issue...unless it matters when used on an ability. I only used "alternate" for the ability the times i tried it.
 
Level 12
Joined
Mar 13, 2020
Messages
421
Did you even read or just write into this forum... first thing when using metamorphosis show me a screen of your object editor where you changed the ability I can 100% say that you don’t do things Right you missed some things...

Did you removed the Requirement
Or
Data Normal Form Unit
Or the alternate Form Unit

If the Unit you downloaded has the Alternate Animations inside

That means his AlternateForm and NormalForm are the same look into this some Screen from the Alternate Unit from demonhunter
You need to create Two Units and one with this

F400B7FE-48A3-426B-82A9-48321E2ABBA0.jpeg


I did it with the phone so don’t blame me...
 
Last edited:
Level 9
Joined
Sep 5, 2015
Messages
369
Did you even read or just write into this forum... first thing when using metamorphosis show me a screen of your object editor where you changed the ability I can 100% say that you don’t do things Right you missed some things...
i feel like you are misunderstanding me lol
the ability works fine when i put it on my hero and i manually left click it (or a player clicks it)
the trigger (when trying to force cast it for the neutral-hostile) doesn't cast it.
tried on both metamorphosis and druid-crow abilities.

i haven't tried it with Channel/dummy yet. trying to avoid that as this seemed to be as simple as triggers get but just doesn't work.
ITS A CUSTOM MODEL and i think this is why. im going to have to find a way to get the neutral-hostile to activate the ability and set the duration to 3600seconds to make it last long enough
 
Level 12
Joined
Mar 13, 2020
Messages
421
i feel like you are misunderstanding me lol
the ability works fine when i put it on my hero and i manually left click it (or a player clicks it)
the trigger (when trying to force cast it for the neutral-hostile) doesn't cast it.
tried on both metamorphosis and druid-crow abilities.
Ok I got your Problem now my bad... I know there is a issue with some Orders for Abilitys like Stempde had it once for me driving me crazy...

Is your unit preplaced in editor ??
 
Level 9
Joined
Sep 5, 2015
Messages
369
View attachment 392942
Told you your missing something you need to activate Abilitys for preplaced units
omfg....LMAO
i will try this in a second

but since i made this and uploaded it please watch anyways lol

just seems strange that a basic trigger wouldn't let this work? ability works tho so i will try ur way one second. brb
also i really appreciate your help brother
.
.
 
Level 9
Joined
Sep 5, 2015
Messages
369
bro told you you are missing to much stuff thats the problem and then you blame blizzard xD
you are driving me crazy i started doing pictures with my phone only to solve your problem as fast as i can...

added a Video... on my last post
it worked lol!!!!!!!!!!!!
thanks you man i really appreciate the help and thanks to DrSuperGood.

(I still don't get why the trigger: "unit - play animation" doesn't work. it seemed pretty straight forward (and is straight forward lol).
It must have been the custom model...only thing i can think of because with say a footman or paladin it plays the animations fine if i remember right)


I will delete my trigger and use the unit - order (to cast ability) now <3
 
Level 9
Joined
Sep 5, 2015
Messages
369
wait i lied.
instead of 25% health to cast metamorphosis
it auto casts it at 50% because i gave the computer an ability
its just casting it by itself. F***!!!!!!!!!
and then it stands there and doesn't fight back anymore.


someone kill me please thanks

the trigger still fails (ill play around with it some more but damn how hard is it to make a basic trigger that forces a unit to cast a spell. LMAO !!!!!!!!!!!!!!!!blizzard!!!!!!!!!!!!!!!!!!!!!!!!!)
 
Level 12
Joined
Mar 13, 2020
Messages
421
then add the ability at 25% and then order the methamorphosis....


  • Unit - Add Metamorphose to (Attacked unit)
  • Unit - Order Attacked unit to Night Elf Demon Hunter - Metamorphosis.
post your trigger then i want to check and pls test it out like you are the boss and change the paladins to hostiles near you just to see what fucked up...
 
Level 9
Joined
Sep 5, 2015
Messages
369
then add the ability at 25% and then order the methamorphosis....


  • Unit - Add Metamorphose to (Attacked unit)
  • Unit - Order Attacked unit to Night Elf Demon Hunter - Metamorphosis.
well the trigger just doesn't work
but you gave me an idea...i can add the ability to the unit at 25% HP and just let the unit auto cast it (which it will do (hopefully)) and leave it at that. much much simpler than anything else

thank you <3 brb

{also my brother was stationed in germany for years}
{for the United States Army.}
{he said it was one of the best countries he's ever been to}
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
The trigger that orders the unit to morph is disabled. As such it does not even exist in the resulting map script so actions cannot run.

Make sure the unit has the ability to be able to cast it. The player owned unit shown did not as you had to manually learn the ability before it could be cast.

Neutral Hostile units might sometimes ignore orders, not attack buildings and other AI behaviour oddities. They are not intended to be used for bosses and the like as they have a lot of hard coded AI for melee attached to them that cannot be disabled. If possible use a computer player slot.

If adding an ability by trigger, make sure it is a normal unit ability and not a hero ability. Since your boss is a hero another approach to avoid the AI auto cast would be to force it to learn the ability when you want it to cast it, and then order it to cast it. AI heroes will not automatically learn abilities.
 
Level 9
Joined
Sep 5, 2015
Messages
369
The trigger that orders the unit to morph is disabled. As such it does not even exist in the resulting map script so actions cannot run.

Make sure the unit has the ability to be able to cast it. The player owned unit shown did not as you had to manually learn the ability before it could be cast.

Neutral Hostile units might sometimes ignore orders, not attack buildings and other AI behaviour oddities. They are not intended to be used for bosses and the like as they have a lot of hard coded AI for melee attached to them that cannot be disabled. If possible use a computer player slot.

If adding an ability by trigger, make sure it is a normal unit ability and not a hero ability. Since your boss is a hero another approach to avoid the AI auto cast would be to force it to learn the ability when you want it to cast it, and then order it to cast it. AI heroes will not automatically learn abilities.
hmmm okay
i didnt have it auto-learn (i figured it would auto learn it if i set it to level 1 etc (i think it would with melee scripts running but obviously i dont want those on but anyways)

thank you this is another approach i will try here in a sec

also why add an ability for normal unit ability when it's a hero? and the ability im adding is a hero ability (metaphorphosis) i suppose i could use Druid-Crow ability its basically the same thing but
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
also why add an ability for normal unit ability when it's a hero? and the ability im adding is a hero ability (metaphorphosis) i suppose i could use Druid-Crow ability its basically the same thing but
I am unsure how it would behave since adding hero abilities does not work the same as if the unit has the ability added in the object editor as a learnable ability. It certainly will not be learnable after being added.
i didnt have it auto-learn (i figured it would auto learn it if i set it to level 1 etc (i think it would with melee scripts running but obviously i dont want those on but anyways)
Melee scripts will only auto learn hero abilities if the hero is a melee hero, owned by a computer player of the appropriate race and that computer player has had melee AI started, assuming the script has no bugs.

Neutral Hostile will never learn hero abilities. Its AI seems entirely reflexive.
 
Level 9
Joined
Sep 5, 2015
Messages
369
I am unsure how it would behave since adding hero abilities does not work the same as if the unit has the ability added in the object editor as a learnable ability. It certainly will not be learnable after being added.
ya everything is running fine but after it morphs it just stands there and will not attack even if i wait 10-20 seconds
is this the kind of behavior you're talking about or no?
 
Level 9
Joined
Sep 5, 2015
Messages
369
Possibly. It could also be caused by triggers interrupting the unit constantly.
and this would possibly be avoided if i made a custom ability and turned metamorphosis into a non-hero ability?
what do you know about morphosis vs. druid-crow-morph? why am i under the impression morphosis is buggier and trash in general compared to druid-crow?
cuz the thing just stands there now and wont attack back (i just cant win and now im on the edge of being completely confused between all of the possible fixes lmao which i will continue to try and reread but)
 
Level 9
Joined
Sep 5, 2015
Messages
369
also if it were to somehow regain all of its HP back while being in the morphed form (which has a CD of 3600sec obviously to create the illusion that it just permanently changed stances and is now up on its feet stomping around) would the trigger possibly replay itself because the unit was never replaced? as i have this:
1641626022239.png


before it was replaced with ,,(another model) its alternate form,, thus nullifying this problem from happening

just curious, thanks.
 
Level 9
Joined
Sep 5, 2015
Messages
369
Wait ... my bad and read the other thread about turn off the trigger after the first hit that would let the wait work and don’t bug your trigger

You don’t get it brother...

Turn the damn trigger off xD I’m on phone and can’t show you an Example also I don’t know if Alternate is the Right AnimationName

Should it not be Morph or something just check the Animation Name of the Animation you want to Play when he do it

Open your Trigger Editor
Add a New Action
Go into Trigger and then
Trigger - Turn off this Trigger
And move it to the first position before you even pause the unit
Then you can add 10 seconds the trigger will run only one time the issue you have is

Your trigger runs
And before the wait is over it runs another two times and then it replace your unit and your condition of the unit type stops then the other times this could run

edit:(nextday): i would've tried this but to me it reads events->conditions-> then first action is "turn off the trigger" why would it continue to read the trigger down? anyways it works. weird.
1641627234857.png



i finally figured this out and it seems to be working (so far lol)

and i remember thinking "what the fart...didnt i see this somewhere" and CTRL+F and typed in "turn off" and yup...you said this way back in the beginning IDK how i misread that or overlooked it or what but anyways a lot was going on and different ideas everything but ya this finally works thank you guys
 
Last edited:
Level 12
Joined
Mar 13, 2020
Messages
421
View attachment 392950


i finally figured this out and it seems to be working (so far lol)

and i remember thinking "what the fart...didnt i see this somewhere" and CTRL+F and typed in "turn off" and yup...you said this way back in the beginning IDK how i misread that or overlooked it or what but anyways a lot was going on and different ideas everything but ya this finally works thank you guys
You misread it? XD

I did 4 Explainations
2 Videos about
And told you several times ;)
 
Level 9
Joined
Sep 5, 2015
Messages
369
You misread it? XD

I did 4 Explainations
2 Videos about
And told you several times ;)
there were several ideas going around man lol. i was trying to try them all. it gets confusing but yes initially you were right the whole time
ALTHOUGH the animation was still not playing even if i used turn on turn off (i believe. never tried it but im sure it would've failed because it just won't work with the custom model)
ani.gif
Animation - Play (attacked units) animation <--- this simply does not work with custom model or something so i got rid of it

but i really appreciate you helping me see this through brother.

I learned more than I ever have so far with the editor.... (time for variables? xD)
 
Status
Not open for further replies.
Top