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

Unit Transformation Abilities

Status
Not open for further replies.
Level 2
Joined
Dec 9, 2021
Messages
4
I'm making a map where there is a base unit who can go to different locations on the map and recieve training that grants them an ability allowing them to transform into the higher tier unit. This gives an element of leveling individual units because they have to actually go get the training in order to gain the ability and they can gain multiple abilities/recieve multiple types of training.
My question (for the moment) is if there is a way to put into the training trigger a condition on whether or not the triggering unit has already set of this trigger or already has the granted ability? I can't seem to find a way. Thanks!
 
Last edited:
Level 2
Joined
Dec 9, 2021
Messages
4
The only issue this really is addressing is that i also have the unit hidden for x amount of time to undergo the training before returning with the ability, so they disappear every time they enter the area. not a huge deal just something im trying to work out. this will be an interesting project and im sure ill have more questions moving forward
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Hello!

If you want to check whether a unit has an ability or not you can use an Integer comparison:
  • Conditions:
  • (Level of YourAbility for (Triggering unit)) Greater than or equal to 1
If the unit doesn't have the specified ability then it's Level will be considered 0.

Also, I think the thread title is misleading since it's unrelated to Summoned units (Water Elemental, Feral Spirit, etc). Could you please change the title to something more fitting? I guess something along the lines of "Checking if unit has ability" and/or "Upgrading unit tier". And try to edit existing comments before posting new ones when possible. You can still reply to users in a new comment. Thanks!
 
Level 2
Joined
Dec 9, 2021
Messages
4
If you want to check whether a unit has an ability or not you can use an Integer comparison:
  • Conditions:
  • (Level of YourAbility for (Triggering unit)) Greater than or equal to 1
If the unit doesn't have the specified ability then it's Level will be considered 0.
ah, i missed that one, thank you! and yes sorry, i had intended on listing off a few other questions about the summoned units here as well, all of this is centered around them so i had been thinking of them as all summoned units questions when you are correct not all of them are. Such as if one summoned unit can turn into another summoned unit (i made abilities based off of the brewmasters transformation) is there a way to pause the initial summons duration timer? i figured out how to change their color upon summon... and i suppose i will have to find out through testing unless you know if abilities learned in this way while "transformed" as a summoned unit will carry back to the original unit once the transformation transpires, and will they be there still if the unit transforms into the form the ability was learned in again? sorry this is kind of a lot of strange stuff ive been reading here for a week or two and seems like you guys know your way around
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
That's fine then, maybe update the title in the meantime until you've gotten all of your questions across or I guess leave it as is.

If you want the abilities to remain after transforming I believe you need to make them permanent:
  • Set Variable Unit = Some unit
  • Set Variable Ability = Some ability
  • Custom script: call UnitMakeAbilityPermanent(udg_Unit, true, udg_Ability)
Some functions (Actions) aren't available in the trigger editor but can accessed through code (Custom script) which is the case here.

I assume a summoned unit that has transformed will have it's expiration timer paused automatically (initial summon duration). Have you tested this yet?
Anyway, you can Pause/Unpause summoned units using this:
  • Unit - Pause the expiration timer for (Triggering unit).
 
Level 2
Joined
Dec 9, 2021
Messages
4
Remarkably the base unit Does gain the ability when learned in another form, but the summon form does not. And actually the initial summon counter does not pause if it enters another form and will bump you back to base regardless of time remaining on the second transformation. Everything is going fairly well, this is interesting stuff to work on, with one exception... I have 3 transformations for the base unit, all made from brewmaster ability. i have set their button locations so they dont overlap but it seems to be random which one activates when i press any of them. i thought maybe it was ranking them by proximity of the 0,0 space, but some went up and some went down. i had 3 guys all attempt the same transformation and literally got one of each of the possible three. do i need to recreate the others off of a different base ability, or...? whacky stuff
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Remarkably the base unit Does gain the ability when learned in another form, but the summon form does not. And actually the initial summon counter does not pause if it enters another form and will bump you back to base regardless of time remaining on the second transformation. Everything is going fairly well, this is interesting stuff to work on, with one exception... I have 3 transformations for the base unit, all made from brewmaster ability. i have set their button locations so they dont overlap but it seems to be random which one activates when i press any of them. i thought maybe it was ranking them by proximity of the 0,0 space, but some went up and some went down. i had 3 guys all attempt the same transformation and literally got one of each of the possible three. do i need to recreate the others off of a different base ability, or...? whacky stuff
Whenever you tell a unit to do something you issue it an Order. Abilities are no exception and have their own Orders.

You can see the Order String of an ability on the ability itself under Text - Order String - Use/Turn On. Other Order String types can be found here as well.
You CANNOT modify this field, despite appearances. It's something that should've been fixed ages ago.

So for example, Storm, Earth, And Fire uses the Order String "elementalfury" .
(why this isn't called "stormearthandfire" is probably because the ability was originally named Elemental Fury during development)

So when you click the Storm, Earth, And Fire ability the unit is issued the Order "elementalfury", which then tells the unit to cast any ability it has that uses this Order String. But in your case you have multiple abilities that use this Order String so the game runs into a problem. Units can't cast multiple spells at the same exact time so only one of these abilities can happen. Which one it chooses is probably out of your control.

Simple solution:
Use different transformation abilities. Some options off the top of my head: Bear Form, Storm Crow Form, Chemical Rage, Metamorphosis.

Advanced solution:
Use the Channel ability, which has a unique field called Base Order Id which allows you to modify the Text - Order String - Use/Turn On field. In other words, you can give a unit any number of Channel abilities as long as they each have a different Base Order Id (Order String). This ability is designed to work with triggers and has all sorts of features that allow you to customize how it functions. Setting the Follow Through Time to 0.00 and Disable Other Abilities to False will turn it into a non-channeling ability. Also, make sure that it's set to Visible in the Options field otherwise the button/icon will be hidden.

The idea here would be to trigger the transformation stuff yourself, which can be a pain to get working but can also open up the door for more possibilities.
 
Last edited:
Status
Not open for further replies.
Top