• 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.

Changing hero model in 1.26

Status
Not open for further replies.
Level 10
Joined
May 24, 2016
Messages
339
So basically, I needed a mount system that is based on a channelling skill. Once it casted, Paladin gets on horse (HOTS like mount system), still able to use his skills, items and attacks as before, but if he gets damage, he will get unmounted back to his original model.

The problem is, since warcraft 1.26 has no any proper functions to change model, I HAVE TO switch Paladins player's hero between 2 types of him, holding 1 type outside the playground of a map, changing its ownership to neutral player. Once paladin (his standard type or mounted) cast any spell, other one has to cast it too, so I can sync their spell cd in case of their swap.

This is ridiculous, but it least it works, except the thing that if "controllable hero" (the one that currently is controlled by player) will start casting any spell and then just stops it, the other one will still use it's spell, making their spell cd desync.

Is there a proper way to detect if spell is going to be used before spell effect is already casted? I mean, if I try to sync them with "spell effect" event, there might be a chance that their swap will be faster than the other one outside the playground will cast his skill too before getting swapped with controllable.
 
Level 10
Joined
May 24, 2016
Messages
339
I found that there's a "endcast" event in warcraft editor, so maybe I can sync abilities perfectly. Dont know need to check out later.
I guess I kinda solved the problem, for now. Still, syncing items seems completely nightmare thing, Id better just disable inventory for Paladin mounted type.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
You can use the Metamorphosis ability, Chemical Rage, Bear Form, Hawk Form etc.

Take a look at the Demon Hunter, it shows how you can go from a standard Melee hero to a Ranged hero with Chaos attack, while retaining all of the ability data, items, hit points, mana, stats, etc.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
But it is indefinite, just gotta toggle the little check box that makes it so.
That doesn’t leave an expiration timer on the unit UI?
I would just have a hidden Bear Form ability and use triggers to Order it on/off when need be.
But that won’t work if the unit is crowd controlled and needs to transform back to base form. The passive transform will.
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
That doesn’t leave an expiration timer on the unit UI?

But that won’t work if the unit is crowd controlled and needs to transform back to base form. The passive transform will.
Yeah, that's how Bear Form works, I think it's morph flag is called Permanent or something. It's definitely doable even with disables, every 0.01s order the unit to morph until it finally goes through. Maybe not as pretty as you'd like, but many compromises are made with this game.
 
Level 10
Joined
May 24, 2016
Messages
339
I fail to see how repeatedly issuing an order until it goes through is a simpler solution than adding and instantly removing an ability.
you gave a link to read, thx you, but due to my language problems Im not sure is this going to work

1) Hero should be transformed from mounted to unmounted version if damaged. So it should immediately turn him out of mount version to unmounted once he is damaged
2) Even if hero gets stunned, that still should happen.
 
Level 10
Joined
May 24, 2016
Messages
339
I fail to see how repeatedly issuing an order until it goes through is a simpler solution than adding and instantly removing an ability.
Once my unit is transformed into "type 2", can I easily switch him back to type 1 by triggers?
And if so, are his skills cd are going to be reset? (that shouldnot happen)

Also Im wondering if this morph ability does require more than 1 free spell slot to work on unit.
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
Once my unit is transformed into "type 2", can I easily switch him back to type 1 by triggers?
You will need two abilities total. One transforms 1->2, the other transforms 2->1.

The way this method works to change A into B is by tricking the game into thinking the unit in form A is already transformed at the moment you remove the ability, so it automatically puts it "back" into its normal form B. When the ability is added nothing happens. When the ability is removed the game checks the normal form and alternate form unit types and determines if it "needs" to be returned to its normal form (since it no longer has the ability required to un-transform). That is why the "destination" unit-type goes in "normal form" and why the "source" unit-type goes in "alternate form".
And if so, are his skills cd are going to be reset? (that shouldnot happen)
Abilities that are on both unit-types' ability list (or have been added in-game and been properly made permanent) will have their cooldowns preserved across the morph.
Also Im wondering if this morph ability does require more than 1 free spell slot to work on unit.
They will be unit abilities, not hero abilities. They will be instantly removed as soon as they are added and are never actually cast. Units can have any number of hero and unit abilities, but the UI can only show so many at once; abilities in excess of this limit will function (if they are passive) and can be ordered to be used with triggers despite not being shown.
 
Level 10
Joined
May 24, 2016
Messages
339
You will need two abilities total. One transforms 1->2, the other transforms 2->1.

The way this method works to change A into B is by tricking the game into thinking the unit in form A is already transformed at the moment you remove the ability, so it automatically puts it "back" into its normal form B. When the ability is added nothing happens. When the ability is removed the game checks the normal form and alternate form unit types and determines if it "needs" to be returned to its normal form (since it no longer has the ability required to un-transform). That is why the "destination" unit-type goes in "normal form" and why the "source" unit-type goes in "alternate form".

Abilities that are on both unit-types' ability list (or have been added in-game and been properly made permanent) will have their cooldowns preserved across the morph.

They will be unit abilities, not hero abilities. They will be instantly removed as soon as they are added and are never actually cast. Units can have any number of hero and unit abilities, but the UI can only show so many at once; abilities in excess of this limit will function (if they are passive) and can be ordered to be used with triggers despite not being shown.
My man you saved my day. Thx god I decided to post a question, saved me from a lot of pointless work.
I tested so much transformations, and yet I had no idea this one will work that way.
This method should not break anything, I guess, since unit remain the same object unit.
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
You can play the animation manually with a trigger. The problem is that the morph can't 'happen' until the animation has played as long as you want it to. I would give the spell a cast time and perhaps you can apply animation tags in the OE directly. If not, detect the various stages of casting and play the animation there.
 
Level 10
Joined
May 24, 2016
Messages
339
You can play the animation manually with a trigger. The problem is that the morph can't 'happen' until the animation has played as long as you want it to. I would give the spell a cast time and perhaps you can apply animation tags in the OE directly. If not, detect the various stages of casting and play the animation there.
Hello my friend
I want your help

I have an aura ability with negative numbers (seen on screenshot)

And I give to unit right in the time he got damaged and morphed into his "unmounted version"

And yeah it's much likely the reason why it gives crashes
Not all the times, but with a little chance.

What's the reason?

JASS:
call UnitAddAbility(PDDS.target,'A01V') // that aura abil. PDDS target is a value that is used in looking_for_help damage system that I use for a looong time
call GroupAddUnit(UnmountedSlow, PDDS.target) // Unmounted slow is the group that I recycle, it's like much any other groups I recycle to have it's time duration to elapse
call SaveReal(Hash, GetHandleId(PDDS.target), StringHash("UnmountedSlow_r"),3.)
 

Attachments

  • Screenshot_29.png
    Screenshot_29.png
    8.1 KB · Views: 3
Level 10
Joined
May 24, 2016
Messages
339
You're chasing phantoms and haven't found what's actually crashing your map. Whatever crashes wouldn't happen a few seconds before the crash, it would happen at the exact moment of the crash so you're not likely to notice it.
The thing is, "morph" does not actually manage to happen in the game, map freezes a little before. I guessed future trigger action and made a conclusion that this is the thing.
 
Status
Not open for further replies.
Top