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

[Spell] Help with dummy detection

Status
Not open for further replies.
Level 3
Joined
Feb 1, 2012
Messages
19
I'm not very good doing skills at trigger editor, and i'm with problem in my skill. The skill will create 4 Rock dummies around the Hero, then the enemy and the dummies will levitate, and the dummies will be released at him.
The problem: after the dummies be released, i can't detect when the dummies arrive at the enemy, remove then, and do the damage. Here is the trigger:

  • Rock Storm
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rock Storm
    • Actions
      • Set RockS_Caster = (Casting unit)
      • Set RockS_Target = (Target unit of ability being cast)
      • Set RockS_DummyIN[1] = True
      • Set RockS_DummyIN[2] = True
      • Set RockS_DummyIN[3] = True
      • Set RockS_DummyIN[4] = True
      • Unit - Create 1 Rock dummy for (Owner of RockS_Caster) at ((Position of RockS_Caster) offset by (Random real number between 180.00 and 260.00) towards (Random real number between 0.00 and 179.00) degrees) facing Default building facing degrees
      • Set RockS_Dummies[1] = (Last created unit)
      • Unit - Create 1 Rock dummy for (Owner of RockS_Caster) at ((Position of RockS_Caster) offset by (Random real number between 180.00 and 260.00) towards (Random real number between 0.00 and 179.00) degrees) facing Default building facing degrees
      • Set RockS_Dummies[2] = (Last created unit)
      • Unit - Create 1 Rock dummy for (Owner of RockS_Caster) at ((Position of RockS_Caster) offset by (Random real number between 180.00 and 260.00) towards (Random real number between 0.00 and 179.00) degrees) facing Default building facing degrees
      • Set RockS_Dummies[3] = (Last created unit)
      • Unit - Create 1 Rock dummy for (Owner of RockS_Caster) at ((Position of RockS_Caster) offset by (Random real number between 180.00 and 260.00) towards (Random real number between 0.00 and 179.00) degrees) facing Default building facing degrees
      • Set RockS_Dummies[4] = (Last created unit)
      • Unit - Pause RockS_Caster
      • Unit - Pause RockS_Target
      • Unit - Add Crow Form to RockS_Target
      • Unit - Remove Crow Form from RockS_Target
      • Animation - Change RockS_Target flying height to 200.00 at 200.00
      • Unit - Add Crow Form to RockS_Dummies[1]
      • Unit - Add Crow Form to RockS_Dummies[2]
      • Unit - Add Crow Form to RockS_Dummies[3]
      • Unit - Add Crow Form to RockS_Dummies[4]
      • Unit - Remove Crow Form from RockS_Dummies[1]
      • Unit - Remove Crow Form from RockS_Dummies[2]
      • Unit - Remove Crow Form from RockS_Dummies[3]
      • Unit - Remove Crow Form from RockS_Dummies[4]
      • Wait 1.00 seconds
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Animation - Change RockS_Dummies[(Integer A)] flying height to 200.00 at 200.00
      • Wait 1.50 seconds
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Order RockS_Dummies[(Integer A)] to Move To ((Position of RockS_Target) offset by 0.00 towards 0.00 degrees)
      • Trigger - Turn on Rock Storm 2 <gen>
And second trigger

  • Rock Storm 2
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: First text
      • Unit Group - Pick every unit in (Units within 120.00 of (Position of RockS_Target)) and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: Second text
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Equal to RockS_Dummies[1]
            • Then - Actions
              • Game - Display to (All players) the text: Third text
              • Unit - Remove RockS_Dummies[1] from the game
              • Unit - Cause RockS_Caster to damage RockS_Target, dealing 50.00 damage of attack type Hero and damage type Normal
              • Set RockS_DummyIN[1] = False
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Equal to RockS_Dummies[2]
            • Then - Actions
              • Unit - Remove RockS_Dummies[2] from the game
              • Unit - Cause RockS_Caster to damage RockS_Target, dealing 50.00 damage of attack type Hero and damage type Normal
              • Set RockS_DummyIN[2] = False
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Equal to RockS_Dummies[3]
            • Then - Actions
              • Unit - Remove RockS_Dummies[3] from the game
              • Unit - Cause RockS_Caster to damage RockS_Target, dealing 50.00 damage of attack type Hero and damage type Normal
              • Set RockS_DummyIN[3] = False
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Equal to RockS_Dummies[4]
            • Then - Actions
              • Unit - Remove RockS_Dummies[4] from the game
              • Unit - Cause RockS_Caster to damage RockS_Target, dealing 50.00 damage of attack type Hero and damage type Normal
              • Set RockS_DummyIN[4] = False
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RockS_DummyIN[1] Equal to False
          • RockS_DummyIN[2] Equal to False
          • RockS_DummyIN[3] Equal to False
          • RockS_DummyIN[4] Equal to False
        • Then - Actions
          • Animation - Change RockS_Target flying height to 0.00 at 200.00
          • Unit - Unpause RockS_Target
          • Unit - Unpause RockS_Caster
          • Trigger - Turn off (This trigger)
        • Else - Actions
I'm using text to find where is the problem, i can see the first message, and the second one, but not the third.
Thank you and sorry for bad english :grin:
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
First off you're leaking and I would strongly recommend you take a look at this, http://www.hiveworkshop.com/forums/...rials-279/things-gui-user-should-know-233242/

To your question
every .03 move the dummy to the position of the dummy offset by some number toward the angle from the dummy to the target, then check when the dummy is within 100 or so range from the target, when it is, kill the dummy, make your effects and deal the damage
 
Level 3
Joined
Feb 1, 2012
Messages
19
I give them the ability 'Explode' and order them to cast it, then deal damage upon the 'Unit dies'-Event which is a new trigger referring to the dying dummy.

The problem isn't removing them, is detecting when they are near the target.

I will try it pOke

@Edit

I did like pOke said, and worked. Thanks and +rep!
 
Last edited:
Status
Not open for further replies.
Top