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

[Trigger] Custom GUI for Metamorphosis, wrong?

Status
Not open for further replies.
Level 8
Joined
Feb 6, 2013
Messages
432
[Fixed] Custom GUI for Metamorphosis, wrong?

I want a create other unit, which doesn't have alternate animations for Demon Hunter. Example: I want... Doom Guard transforms into Demon Hunter (Demon From)
Now I have some materials: (Please read this carefully!!)
- Blood Elf Demon Hunter (which I want to transform into Demon Hunter (Demon From) (Remember doesn't have morph animations!)
- Dummy (use Demon Hunter (NE model) with 0% red, 0% green and 0% blue)
- RegionforPositionofBloodElfDemonHunter
- RegionforPositionofDummy

I used triggers and like that:
  • GUI Metamorphosis
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Unit-type of (Casting unit)) Equal to Blood Elf Demon Hunter
      • (Ability being cast) Equal to Metamorphosis
    • Actions
      • Region - Center Position of RegionforPositionofBloodElfDemonHunter <gen> on (Position of (Casting unit))
      • Unit - Create 1 Dummy for (Owner of Casting unit)) at (Position of (Casting unit)) facing (Facing of (Casting unit)) degrees
      • Region - Center Position of RegionforPositionofDummy <gen> on (Position of (Last created unit))
      • Animation - Change (Casting unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) With 100.00% transparency
      • Unit - Move (Casting unit) instantly to RegionforPositionofDummy <gen>
      • Unit - Move (Last created unit) instantly to RegionforPositionofBloodElfDemonHunter <gen>
      • Animation - Play (Last created unit)'s morph animation
      • Wait 0.50 seconds
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) With 0.00% transparency
      • Wait 0.40 seconds
      • Unit - Remove (Last created unit) from the game
      • Wait 1.20 seconds
      • Animation - Change (Casting unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) With 0.00% transparency
That is all, but I have some problem: Afterwards, Demon Hunter can't become to Demon, he loses 150 manas and he is in normal from! I don't know why, or some actions wrong.
Please help me. I know someone can test in game and find that problem. Hope I get your answer as fast as you can.
 
Last edited:
Level 8
Joined
Feb 6, 2013
Messages
432
I let new units have Metamorphosis ability. Had it, but nothing happened after doing triggers, then he loses 150 manas!
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
I let new units have Metamorphosis ability. Had it, but nothing happened after doing triggers, then he loses 150 manas!
Of course they will loose mana and will not morph - the trigger you posted has nothing to do with the spell itself, because what the trigger does is it changes color of Blood Elf Demon Hunter and create dummy unit.

If you based off your ability off the original Metamorphosis, then find this ability in object editor and find "Data - Normal Form Unit" - here change the unit to Blood Elf Demon Hunter; and then find "Data - Alternate Form Unit" and change the unit there to Demon Hunter (Demon From).

Now also find in object editor your Blood Elf Demon Hunter unit and find "Techtree - Dependency Equivalent" and add Demon Hunter (Demon From) unit there.
--------------

Now for your trigger:
1) pred1980 is correct. If you have 1 unit cast your Metamoprhosis spell and another unit cast the same spell about 1 second later, you will end up with 1 dummy unit permanently in game and the 1st casting unit will remain permanently invisible (= 100% transparency).

2) You leak a lot - Both your regions leak, because you center them at "position of (casting unit)" <- this line leaks. You will need to save "position of (casting unit)" into variable and at the end of the trigger destroy it and null it, however if you save those positions into variable, you will not need regions at all.

3) Your actions "move unitX to location Y" don't make sense. Here's what you did:
You center regionA at the position of your casting unit.
Then you create dummy unit at the position of your casting unit.
Then you move regionB to the position your last created unit (= the dummy unit).
Finally, you move casting unit to regionB and dummy unit to regionA.

What is the point? If you look at it closely, both points are overlapping one another (they're centered around the same point).

4) You should change (casting unit) to (triggering unit). Triggering unit acts the same as Casting unit, however (triggering unit) works with waits, while (casting unit) does not.

Edit:
5) also change your event from "Unit begins casting an ability" to "Unit starts the effect of an ability". The difference between those 2 is that "Begins casting an ability" fires before spell's cooldown starts and before mana from casting unit is taken, while "Starts the effect of an ability" fires after mana has been taken and after cooldown starts.

A more detailed explanation is in hidden tags
An example situation could be a triggered healing spell. If you used "Begins casting an ability" event to fire this spell, a player could abuse this by ordering the unit to cast the ability and quickly stopping that unit. However the spell would still fire and it would take no mana and start no cooldown. This way, instead of spell you could use once per 10 seconds, it could be used infinitely and without any mana cost.

In your case, if I were to start metamorphosis and then quickly stop it, my hero would still fade out, change color and a dummy unit would be created - although I stopped the spell.

"Begins casting an ability" event is usually used to check if specific conditions are true. For example I want my ability to be usable only on peon-type units. You cannot set this anywhere in object editor, so you use trigger for this instead. You will use "A unit begins casting an ability" and then you check if the unit-type is peon. If it's not, you will order the caster to stop casting. That way you have triggered ability usable only on specific unit type
 
Last edited:
Level 8
Joined
Feb 6, 2013
Messages
432
Of course they will loose mana and will not morph - the trigger you posted has nothing to do with the spell itself, because what the trigger does is it changes color of Blood Elf Demon Hunter and create dummy unit.

If you based off your ability off the original Metamorphosis, then find this ability in object editor and find "Data - Normal Form Unit" - here change the unit to Blood Elf Demon Hunter; and then find "Data - Alternate Form Unit" and change the unit there to Demon Hunter (Demon From).

Now also find in object editor your Blood Elf Demon Hunter unit and find "Techtree - Dependency Equivalent" and add Demon Hunter (Demon From) unit there.
--------------

Now for your trigger:
1) pred1980 is correct. If you have 1 unit cast your Metamoprhosis spell and another unit cast the same spell about 1 second later, you will end up with 1 dummy unit permanently in game and the 1st casting unit will remain permanently invisible (= 100% transparency).

2) You leak a lot - Both your regions leak, because you center them at "position of (casting unit)" <- this line leaks. You will need to save "position of (casting unit)" into variable and at the end of the trigger destroy it and null it, however if you save those positions into variable, you will not need regions at all.

3) Your actions "move unitX to location Y" don't make sense. Here's what you did:
You center regionA at the position of your casting unit.
Then you create dummy unit at the position of your casting unit.
Then you move regionB to the position your last created unit (= the dummy unit).
Finally, you move casting unit to regionB and dummy unit to regionA.

What is the point? If you look at it closely, both points are overlapping one another (they're centered around the same point).

4) You should change (casting unit) to (triggering unit). Triggering unit acts the same as Casting unit, however (triggering unit) works with waits, while (casting unit) does not.

Edit:
5) also change your event from "Unit begins casting an ability" to "Unit starts the effect of an ability". The difference between those 2 is that "Begins casting an ability" fires before spell's cooldown starts and before mana from casting unit is taken, while "Starts the effect of an ability" fires after mana has been taken and after cooldown starts.

A more detailed explanation is in hidden tags
An example situation could be a triggered healing spell. If you used "Begins casting an ability" event to fire this spell, a player could abuse this by ordering the unit to cast the ability and quickly stopping that unit. However the spell would still fire and it would take no mana and start no cooldown. This way, instead of spell you could use once per 10 seconds, it could be used infinitely and without any mana cost.

In your case, if I were to start metamorphosis and then quickly stop it, my hero would still fade out, change color and a dummy unit would be created - although I stopped the spell.

"Begins casting an ability" event is usually used to check if specific conditions are true. For example I want my ability to be usable only on peon-type units. You cannot set this anywhere in object editor, so you use trigger for this instead. You will use "A unit begins casting an ability" and then you check if the unit-type is peon. If it's not, you will order the caster to stop casting. That way you have triggered ability usable only on specific unit type

I don't know how to thanks to you :grin:. I thank you a lot. +rep
I will send your name into my credits. Thank you again! The trigger I do like that is correct and work porperly.
My trigger will edit tomorrow. Nichilus will receive my private messages about fixing trigger. ^^
 
Last edited:
Status
Not open for further replies.
Top