• 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] Dummy is removed before reach it's destination point

Status
Not open for further replies.

Rheiko

Spell Reviewer
Level 25
Joined
Aug 27, 2013
Messages
4,121
Hey guys, i wanna put this at the spell section but i got a problem
explanation:The User throw a spinning blade towards the target point, for set amount of time the blade will destroyed and the user's illusion will appeared at blade's location. Then he throw a spinning blade again to the user's current location.

when i cast the spell with one unit, the spell go smoothly
but when i cast with two units (at the same time), the first blade is go smoothly but the 2nd blade is removed before reach it's destination point

here's the trigger:
  • Double Spinning Blade
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to DSB_Ability_ID
    • Actions
      • Set DSB_Max_Index = (DSB_Max_Index + 1)
      • Set DSB_Owner[DSB_Max_Index] = (Triggering player)
      • Set DSB_Caster[DSB_Max_Index] = (Triggering unit)
      • Animation - Play DSB_Caster[DSB_Max_Index]'s DSB_Animation animation
      • Set TempPoint = (Position of DSB_Caster[DSB_Max_Index])
      • Set TempPoint2 = (Target point of ability being cast)
      • Set DSB_Angle[DSB_Max_Index] = (Angle from TempPoint to TempPoint2)
      • Set TempPoint3 = (TempPoint offset by DSB_Start_Range towards DSB_Angle[DSB_Max_Index] degrees)
      • Unit - Create 1 DSB_Dummy_Type for DSB_Owner[DSB_Max_Index] at TempPoint3 facing DSB_Angle[DSB_Max_Index] degrees
      • Set DSB_Dummy[DSB_Max_Index] = (Last created unit)
      • Unit - Add a ((DSB_Distance x 0.03) x 0.03) second Generic expiration timer to DSB_Dummy[DSB_Max_Index]
      • Set DSB_Stage[DSB_Max_Index] = 1
      • Custom script: set udg_DSB_UnDamage_Group[udg_DSB_Max_Index] = CreateGroup()
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DSB_Max_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on DSB Loop <gen>
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempPoint3)
  • DSB Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DSB_Current_Index) from 1 to DSB_Max_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DSB_Stage[DSB_Current_Index] Equal to 1
            • Then - Actions
              • Set TempPoint = (Position of DSB_Dummy[DSB_Current_Index])
              • Set TempPoint2 = (TempPoint offset by (DSB_Distance x 0.03) towards DSB_Angle[DSB_Current_Index] degrees)
              • Unit - Move DSB_Dummy[DSB_Current_Index] instantly to TempPoint2
              • Set DSB_Damage_Group[DSB_Current_Index] = (Units within DSB_AoE of TempPoint)
              • Unit Group - Pick every unit in DSB_Damage_Group[DSB_Current_Index] and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) belongs to an enemy of DSB_Owner[DSB_Current_Index]) Equal to DSB_Conditions[1]
                      • ((Picked unit) is alive) Equal to DSB_Conditions[2]
                      • ((Picked unit) is Magic Immune) Equal to DSB_Conditions[3]
                      • ((Picked unit) is A structure) Equal to DSB_Conditions[4]
                    • Then - Actions
                      • Set TempUnit = (Picked unit)
                      • Unit - Cause DSB_Caster[DSB_Current_Index] to damage TempUnit, dealing DSB_Damage[DSB_Ability_Level[DSB_Current_Index]] damage of attack type Spells and damage type Normal
                      • Special Effect - Create a special effect attached to the DSB_Special_Effect_Location of TempUnit using DSB_Special_Effect
                      • Special Effect - Destroy (Last created special effect)
                      • Unit Group - Add TempUnit to DSB_UnDamage_Group[DSB_Current_Index]
                    • Else - Actions
              • Custom script: call DestroyGroup(udg_DSB_Damage_Group[udg_DSB_Current_Index])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DSB_Destroy_Tree Equal to True
                • Then - Actions
                  • Destructible - Pick every destructible within DSB_AoE of TempPoint and do (Actions)
                    • Loop - Actions
                      • Unit - Order DSB_Destroyer to Harvest (Picked destructible)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Current order of DSB_Destroyer) Equal to (Order(harvest))
                        • Then - Actions
                          • Destructible - Kill (Picked destructible)
                        • Else - Actions
                      • Unit - Order DSB_Destroyer to Stop
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (DSB_Dummy[DSB_Current_Index] is dead) Equal to True
                  • DSB_Stage[DSB_Current_Index] Equal to 1
                • Then - Actions
                  • Set DSB_Stage[DSB_Current_Index] = 2
                  • Set TempPoint2 = (Position of DSB_Caster[DSB_Current_Index])
                  • Unit - Create 1 DSB_Dummy_Type2 for DSB_Owner[DSB_Current_Index] at TempPoint facing TempPoint2
                  • Set DSB_Dummy2[DSB_Current_Index] = (Last created unit)
                  • Unit - Add a DSB_Dummy2_Lifetime second Generic expiration timer to DSB_Dummy2[DSB_Current_Index]
                  • Animation - Change DSB_Dummy2[DSB_Current_Index]'s vertex coloring to (DSB_Dummy2_RED%, DSB_Dummy2_GREEN%, DSB_Dummy2_BLUE%) with DSB_Dummy2_Transparency% transparency
                  • Animation - Play DSB_Dummy2[DSB_Current_Index]'s DSB_Dummy2_Animation animation
                  • Set TempPoint = (Position of DSB_Dummy2[DSB_Current_Index])
                  • Set DSB_Angle[DSB_Current_Index] = (Angle from TempPoint to TempPoint2)
                  • Set TempPoint3 = (TempPoint offset by DSB_Start_Range towards DSB_Angle[DSB_Current_Index] degrees)
                  • Unit - Remove DSB_Dummy[DSB_Current_Index] from the game
                  • Unit - Create 1 DSB_Dummy_Type for DSB_Owner[DSB_Current_Index] at TempPoint3 facing DSB_Angle[DSB_Current_Index] degrees
                  • Set DSB_Dummy[DSB_Current_Index] = (Last created unit)
                  • Unit - Add a ((DSB_Distance x 0.03) x 0.03) second Generic expiration timer to DSB_Dummy[DSB_Current_Index]
                  • Custom script: call RemoveLocation(udg_TempPoint3)
                • Else - Actions
              • Custom script: call RemoveLocation(udg_TempPoint)
              • Custom script: call RemoveLocation(udg_TempPoint2)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DSB_Stage[DSB_Current_Index] Equal to 2
                • Then - Actions
                  • Set TempPoint = (Position of DSB_Dummy[DSB_Current_Index])
                  • Set TempPoint2 = (TempPoint offset by (DSB_Distance x 0.03) towards DSB_Angle[DSB_Current_Index] degrees)
                  • Unit - Move DSB_Dummy[DSB_Current_Index] instantly to TempPoint2
                  • Set DSB_Damage_Group[DSB_Current_Index] = (Units within DSB_AoE of TempPoint)
                  • Unit Group - Pick every unit in DSB_Damage_Group[DSB_Current_Index] and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Picked unit) belongs to an enemy of DSB_Owner[DSB_Current_Index]) Equal to DSB_Conditions[1]
                          • ((Picked unit) is alive) Equal to DSB_Conditions[2]
                          • ((Picked unit) is Magic Immune) Equal to DSB_Conditions[3]
                          • ((Picked unit) is A structure) Equal to DSB_Conditions[4]
                        • Then - Actions
                          • Set TempUnit = (Picked unit)
                          • Unit - Cause DSB_Caster[DSB_Current_Index] to damage TempUnit, dealing DSB_Damage[DSB_Ability_Level[DSB_Current_Index]] damage of attack type Spells and damage type Normal
                          • Special Effect - Create a special effect attached to the DSB_Special_Effect_Location of TempUnit using DSB_Special_Effect
                          • Special Effect - Destroy (Last created special effect)
                          • Unit Group - Add TempUnit to DSB_UnDamage_Group[DSB_Current_Index]
                        • Else - Actions
                  • Custom script: call DestroyGroup(udg_DSB_Damage_Group[udg_DSB_Current_Index])
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DSB_Destroy_Tree Equal to True
                    • Then - Actions
                      • Destructible - Pick every destructible within DSB_AoE of TempPoint and do (Actions)
                        • Loop - Actions
                          • Unit - Order DSB_Destroyer to Harvest (Picked destructible)
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Current order of DSB_Destroyer) Equal to (Order(harvest))
                            • Then - Actions
                              • Destructible - Kill (Picked destructible)
                            • Else - Actions
                          • Unit - Order DSB_Destroyer to Stop
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (DSB_Dummy[DSB_Current_Index] is dead) Equal to True
                      • DSB_Stage[DSB_Current_Index] Equal to 2
                    • Then - Actions
                      • Custom script: call DestroyGroup(udg_DSB_UnDamage_Group[udg_DSB_Current_Index])
                      • Unit - Remove DSB_Dummy[DSB_Current_Index] from the game
                      • Set DSB_Stage[DSB_Current_Index] = 0
                      • Set DSB_Dummy[DSB_Current_Index] = DSB_Dummy[DSB_Max_Index]
                      • Set DSB_Dummy[DSB_Max_Index] = No unit
                      • Set DSB_Caster[DSB_Current_Index] = DSB_Caster[DSB_Max_Index]
                      • Set DSB_Caster[DSB_Max_Index] = No unit
                      • Set DSB_Angle[DSB_Current_Index] = DSB_Angle[DSB_Max_Index]
                      • Set DSB_Angle[DSB_Max_Index] = 0.00
                      • Set DSB_Current_Index = (DSB_Current_Index - 1)
                      • Set DSB_Max_Index = (DSB_Max_Index - 1)
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Custom script: call RemoveLocation(udg_TempPoint2)
                • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DSB_Max_Index Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • DSB Dummy Removal
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempUnit = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to DSB_Dummy_Type2
        • Then - Actions
          • Unit - Remove TempUnit from the game
        • Else - Actions
also, here the test map
View attachment Double Spinning Blade.w3x

if someone could help me

+REP
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
1. You do not need null the GLOBAL variables because there is nothing happen when you null them like set udg_Prefix_Name = No unit

2. In your cast trigger "Double Spinning Blade" you do not need to create group because they're ALREADY CREATED at the variable editor.

3. You do not need a Dummy Removal Trigger. Just set the unit in the OE "can't raise and does not decay"
 
Status
Not open for further replies.
Top