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

GUI spell not working

Status
Not open for further replies.
Level 10
Joined
Apr 3, 2006
Messages
535
Can anyone look at this, and see why it is causing no damage? the effects etc are working fine.

  • Hammers Wrath
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hammers Wrath
    • Actions
      • Set UnitVarCaster7 = (Triggering unit)
      • Set UnitVarTarget6 = (Target unit of ability being cast)
      • Set TempLoc33 = (Position of UnitVarTarget6)
      • Unit - Create 1 Dummy(Holy_Hammer) for (Owner of UnitVarCaster7) at TempLoc33 facing 0.00 degrees
      • Unit - Add a 0.85 second Generic expiration timer to (Last created unit)
      • Unit - Make (Last created unit) face ((Facing of (Last created unit)) + 180.00) over 0.20 seconds
      • Unit - Change ownership of (Last created unit) to Player 1 (Red) and Change color
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 0.00%) with 70.00% transparency
      • Unit - Make (Last created unit) face ((Facing of (Last created unit)) + 180.00) over 0.20 seconds
      • Animation - Change (Last created unit) flying height to 75.00 at 800.00
      • Unit - Pause UnitVarTarget6
      • Unit - Make (Last created unit) face ((Facing of (Last created unit)) + 180.00) over 0.20 seconds
      • Special Effect - Create a special effect at TempLoc33 using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Make (Last created unit) face ((Facing of (Last created unit)) + 180.00) over 0.20 seconds
      • Wait 0.80 game-time seconds
      • Unit - Unpause UnitVarTarget6
      • Set FloatingTextVar[4] = (Last created floating text)
      • Floating Text - Show (Last created floating text) for (All players)
      • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 80.00 towards 90.00 degrees
      • Set Temp_Group_1 = (Units within 375.00 of (Target point of ability being cast) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of Temp_Unit_1)) Equal to True))))
      • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (0.00 + ((Real((Level of Hammers Wrath for (Triggering unit)))) x (Real((Strength of (Triggering unit) (Include bonuses)))))) damage of attack type Spells and damage type Cold
      • Wait 1.50 game-time seconds
      • Floating Text - Destroy FloatingTextVar[4]
      • Custom script: call RemoveLocation (udg_TempLoc33)
Thanks for any help with this
 
Level 7
Joined
Mar 22, 2010
Messages
228
i guess the mistake their is the matching conditions.
instead of Owner of(Temp_Unit_1), make it Owner of(UnitVarCaster7).

what are you doing with your floating text?
i cant see you created a floating text.
anyways that wont matter.
 
Level 19
Joined
Aug 16, 2007
Messages
881
Well, I'll have a few questions.
Why do you not have arrays to those variables?

  • Set UnitVarCaster7,
  • Set UnitVarTarget6,
  • SetTempLoc33
and more?

Why do you use this action:
  • Unit - Make (Last created unit) face ((Facing of (Last created unit)) + 180.00) over 0.20 seconds
when you just could do:
  • Unit - Create 1 Dummy(Holy_Hammer) for (Owner of UnitVarCaster7) at TempLoc33 facing 180.00 degrees
and why do you change it's facing four more times?

and why do you change the ownership of the created unit later with an action when you could do it when you create it?
  • Unit - Change ownership of (Last created unit) to Player 1 (Red) and Change color
  • Animation - Change (Last created unit) flying height to 75.00 at 800.00
This will take the unit 800 seconds to reach 75.00 height, are you sure you want that?

  • Wait 0.80 game-time seconds
Waits destroys your MUI possibility (more than 1 unit are able to cast the ability at once).

  • Set FloatingTextVar[4] = (Last created floating text)
Why do you set a Floating Text variable to a floating text you never created?

  • Floating Text - Show (Last created floating text) for (All players)
    • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
    • Floating Text - Set the velocity of (Last created floating text) to 80.00 towards 90.00 degrees
Those actions are useless, because after the wait, this trigger cannot more identify any created floating text (the one you did not create anyway) before the wait.

And now, to your problem:

As I said before, after a wait in a trigger, the trigger cannot longer identify things before the wait. They'll disappear.

So the problem is:
  • Set Temp_Group_1 = (Units within 375.00 of (>>>>>Target point of ability being cast<<<<<) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Owner of (Matching unit)) is an enemy of (Owner of Temp_Unit_1)) Equal to True))))
(where do you initialize Temp_Unit_1 btw?)

Yes, Target point of ability being cast. The trigger don't longer remember where this location where set after the wait. So, you'll have to set a variable for this location and then clean it up, after the trigger ends. Also

  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (0.00 + ((Real((Level of Hammers Wrath for (Triggering unit)))) x (Real((Strength of (Triggering unit) (Include bonuses)))))) damage of attack type Spells and damage type Cold
Triggering unit) will neither be remembered, so you'll have to set a variable for this too.

Also, you leak the unit group. Put this line in the end:

  • Custom script: call DestroyGroup(udg_Temp_Group_1)
Well, sorry to say it, but your trigger is a mess... I don't even understand a thing of what it should do.


Well, this was a lot... Hm, I'll put it in hidden tags.
 
Level 7
Joined
Mar 22, 2010
Messages
228
Lol. those wont make any sense though except fot the wait and the groupings.
i guess he just played with the trigger ^^
 
Status
Not open for further replies.
Top