Three-way transformation w/ independent cooldowns

denmax

You can change this now in User CP.
Reaction score
155
Okay, I'll make it simple.

I want an ability that allows me to change a Hero to another one with different spells (basically the same on everything else). That Hero can then change to another one with its own different spells, and the last one can change back to the first Hero. Preferrably, I want that one Hero to be provided with two of the transformation abilities, but I can deal with not having that. If you've played Dota and saw Troll Warlord's Berserker's Rage interacting with Whirling Axes - that's what I basically want except three way. (http://dota2.gamepedia.com/Troll_Warlord)

I've never really tested using things like Robo-Goblin and somesuch, but I assumed using one of the metamorphing bases provided by blizz isn't going to cut it. I assume that if I let it transform to another unit with different spells with different Base Order Strings, I'll be left with a Hero with no skills learned. I guess that would mean that I should use Channel as a base for all of the Heroes spells, but I want a way that I would not need to resort to rebuilding everything again.

I also cannot use toggle spells like Immolation because, again, it is three way. Worse of all, I also want the spells' cooldowns to be independent.

I had an idea that I should just trigger the whole transformation thing by hiding the Hero when casting the transformation (not creating - I want the cooldowns stay there when they transform back to their previous form), then unhiding other ones and setting its exp and ability levels. I'm not sure if this is the ideal method.

Basically I'm not asking for a trigger (would be nice to get one tho), rather, I'm asking for confirmation about my assumptions, and if my proposed solution is the most ideal one. Or if there actually is a much simpler solution on the horizon - that does not involve JASS.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
If you want to preserve cooldowns, then the best way is to use "Player - Set <ability> as available/unavailable for Player 1 (red)". Note that this is an MPI option (if you disable the ability, then it is disabled for all the player's units), but you should be able to get it to work in your map by having separate abilities reserved for the heroes only (and ensure that no two heroes have the same spells).

For morphing, you would make the ability permanent so that it remains when the unit transforms. (there is a function for that)

And morphing is good IMO, it tends to preserve things like buffs, stats, items, selection, etc. I would just make three morph abilities. Add all the unit's abilities to the unit, but disable all the ones that shouldn't work in his normal form. When he morphs, just disable his normal form's abilities and enable the ones for the morphed unit. I do something *sort of* similar in this:
http://www.hiveworkshop.com/forums/...-0-0-a-193521/?prev=search=Libram&d=list&r=20
It isn't what you want, but it has a similar process as far as enabling/disabling the abilities (although, it is written in vJASS so the code won't be of much use to you). But it just demonstrates the effectiveness of it.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
For morphing, you would make the ability permanent so that it remains when the unit transforms. (there is a function for that)
Specifically, this one.

Code:
call UnitMakeAbilityPermanent(whichUnit, boolean_permanent, integer_abilityId)
call UnitMakeAbilityPermanent(GetTriggerUnit(), true, 'A000')
 

denmax

You can change this now in User CP.
Reaction score
155
I'll try to understand what you guys meant. Let's say for example we have some guy who can shift between fire, ice and earth - with fire as a base. I guess what you guys mean is:

• Have a base unit, with the morphing ability and its other abilities (e.g. fire).
• Add abilities intended for other modes (e.g. ice and earth) to this unit through triggers and disable these abilities
In total:
3 unit abilities - used to morph to fire, ice, and earth. corresponding morph to "element" is disabled when he is at that element
12 hero abilities - each mode has 4 hero abilities. the fourth is the placeholder for the morphing skill itself - there has to be a way to learn it and level it up when at ice form or earth form. basically the "learned" skill is a passive that tells you your current mode.
• When base unit levels his abilities, disabled abilities are also leveled up (e.g. fire ups skill at slot x-0 y-2, ice and earth skills intended to take slot x-0 y-2 - which are disabled - also level up)
• When unit casts morphing ability, enable spells corresponding to its mode/transformation, and disable its old abilities.

What I'm unsure of is if you can actually set the level of disabled abilities. I know you can set the level of abilities within a disabled spellbook, but I haven't tried the former.

And what happens if my Hero levels up while at, let's say, earth form? How would he go about leveling his abilities by then? Should he go back to fire to do that?

And since I'm not intending to really change anything about the hero but its abilities, would using the above method mean I can actually avoid having to create multiple unit-types? I just assumed I needed it to transform to a different unit-type because it would change abilities, but after reading what you guys were (probably) trying to say, then I wouldn't need other unit-types, correct?

And what happens if this Hero dies? I'm guessing it sticks to whatever mode/transformation it was in as it revives.

EDIT:

I think the Libram that Purge made is what I'm intending to do. Except with Hero abilities that you learn throughout the game.
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
Actually, if all you intend to change are the hero's abilities, you could just use Engineering Upgrade to change the abilities available to each form.
 

denmax

You can change this now in User CP.
Reaction score
155
Actually, if all you intend to change are the hero's abilities, you could just use Engineering Upgrade to change the abilities available to each form.


Hmm.. how would I go about with that exactly? Especially three-way?
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Yeah you can avoid having multiple unit-types. And yes, you should be able to level up an ability that is disabled. If I recall correctly, the unit will still have the ability, it is just disabled (so it can still be removed/leveled up). Maybe I'll make a sample test map.

I don't recommend using Libram because tbh I really needed to test it more (it bugs out with some transformations and it bugged a little with some MPI testing). It was mostly just a creative sample.
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top