• 🏆 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!

[Solved] Abilities causing a unit to morph into different units.

Status
Not open for further replies.
Level 2
Joined
Jul 7, 2016
Messages
4
Hello gents.

I'm tying to design a series of abilities that allows a unit (a Spider in this case) to transform into one of three different units (Spitting Spider, Giant Spider and Broodmother, respectively). The transformation should be permanent, and each unit has completely different abilities.

I tried using the Obsidian Destroyer Transform ability, but all three abilities morph into the same unit (Broodmother). I'm assuming it's because the abilities are all based on the same source.

I know that it can be done using Triggers, but I'm relatively new to the whole custom maps thing, so I can't quite seem to figure out how to check and subtract the resource cost.

Any help would be greatly appreciated.
 
Level 12
Joined
May 22, 2015
Messages
1,051
You are correct in why it is not working - it will always just use the first ability if they all are based on the same ability (they all use the same order string, so it just grabs the first one it finds - not certain how it chooses which one is first).

I'd go with the triggers route. There's an ability called "Chaos" or something like that. When you give it to a unit, they permanently become some other kind of unit. It was used to morph all the regular orcs into the chaos orcs in the campaign.

For the morph spells, I'd use the "Charge Gold and Lumber" spell. It is just a regular ability that can have gold and lumber costs on it. This is perfect for the resource costs because it's built in to the ability. The bonus here is that you can actually set the order string for this ability. Just change two of them to other spells that have no target. I suggest war stomp and thunder clap if you are not using those on the base spider unit already. Use the regular war stomp and thunder clap abilities to find the order strings.

Then the triggers will looks something like this:
  • Morph Broodmother
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to (Broodmother Charge Gold and Lumber Ability)
  • Actions
    • Unit - Add (Broodmother Morph Ability) to (Triggering Unit)
You'd create two more for the other types of morphs.
 
Level 2
Joined
Jul 7, 2016
Messages
4
You are correct in why it is not working - it will always just use the first ability if they all are based on the same ability (they all use the same order string, so it just grabs the first one it finds - not certain how it chooses which one is first).

I'd go with the triggers route. There's an ability called "Chaos" or something like that. When you give it to a unit, they permanently become some other kind of unit. It was used to morph all the regular orcs into the chaos orcs in the campaign.

For the morph spells, I'd use the "Charge Gold and Lumber" spell. It is just a regular ability that can have gold and lumber costs on it. This is perfect for the resource costs because it's built in to the ability. The bonus here is that you can actually set the order string for this ability. Just change two of them to other spells that have no target. I suggest war stomp and thunder clap if you are not using those on the base spider unit already. Use the regular war stomp and thunder clap abilities to find the order strings.

Then the triggers will looks something like this:
  • Morph Broodmother
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to (Broodmother Charge Gold and Lumber Ability)
  • Actions
    • Unit - Add (Broodmother Morph Ability) to (Triggering Unit)
You'd create two more for the other types of morphs.


Works perfectly. Thank you.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
It should be noted that using Chaos to transform units is fine, but with heroes it can get a little wonky. Attributes/max health and mana of old and new units gets added together and I think some abilities can get screwy (not sure the specifics on that, just what I remember).

Instead, a safe and easy solution is to use a modified reverse bear form morph: Hero passive transformation
 
Status
Not open for further replies.
Top