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

problem with removing dummy units

Status
Not open for further replies.
Level 4
Joined
Oct 15, 2008
Messages
77
alright so here's what i got. i have a ward ability. like serpent wards. i made them have a lighting attack gfx like on the lighting orb. but i also have an ability like the tinker's engineering upgrade. that ability effects the serpent ward ability. every level of the "engineering upgrade" increases the amount of "extra" serpent wards that attack to get the "effect" of a barrage. (reason being, so i can have the units attack with purge to fight against summoned units. basically the ward is a barrage type anti summoned unit ward)......anyways.... so yea.... i need help with custom values. I am able to give a custom value to the REAL serpent ward being put down through triggers. but when the real serpent ward dies i cant get rid of all 1-9 extra dummy serpent wards.

so i guess what im saying is this, if i loop a integer+1 for my REAL serpent ward. then have a for each integer a from 1-level of ability and spawn extra dummy units for that corresponding serpent ward. how do i remove them all.

this is what my trigger looks like.

FIRST TRY
  • lightining ward
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to (==) lightining Ward (lvl 1)
        • Then - Actions
          • Set point = (Target point of ability being cast)
          • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
          • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_point)
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to (==) lightining Ward (lvl 2)
            • Then - Actions
              • Set point = (Target point of ability being cast)
                • Do Multiple ActionsFor each (Integer A) from 1 to 2, do (Actions)
                  • Loop - Actions
                    • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                    • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
              • Custom script: call RemoveLocation (udg_point)
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to (==) lightining Ward (lvl 3)
                • Then - Actions
                  • Set point = (Target point of ability being cast)
                    • Do Multiple ActionsFor each (Integer A) from 1 to 3, do (Actions)
                      • Loop - Actions
                        • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                        • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation (udg_point)
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Ability being cast) Equal to (==) lightining Ward (lvl 4)
                    • Then - Actions
                      • Set point = (Target point of ability being cast)
                        • Do Multiple ActionsFor each (Integer A) from 1 to 4, do (Actions)
                          • Loop - Actions
                            • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                            • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                      • Custom script: call RemoveLocation (udg_point)
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Ability being cast) Equal to (==) lightining Ward (lvl 5)
                        • Then - Actions
                          • Set point = (Target point of ability being cast)
                            • Do Multiple ActionsFor each (Integer A) from 1 to 5, do (Actions)
                              • Loop - Actions
                                • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                          • Custom script: call RemoveLocation (udg_point)
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Ability being cast) Equal to (==) lightining Ward (lvl 6)
                            • Then - Actions
                              • Set point = (Target point of ability being cast)
                                • Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
                                  • Loop - Actions
                                    • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                    • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                              • Custom script: call RemoveLocation (udg_point)
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Ability being cast) Equal to (==) lightining Ward (lvl 7)
                                • Then - Actions
                                  • Set point = (Target point of ability being cast)
                                    • Do Multiple ActionsFor each (Integer A) from 1 to 7, do (Actions)
                                      • Loop - Actions
                                        • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                        • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                                  • Custom script: call RemoveLocation (udg_point)
                                • Else - Actions
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Ability being cast) Equal to (==) lightining Ward (lvl 8)
                                    • Then - Actions
                                      • Set point = (Target point of ability being cast)
                                        • Do Multiple ActionsFor each (Integer A) from 1 to 8, do (Actions)
                                          • Loop - Actions
                                            • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                            • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                                      • Custom script: call RemoveLocation (udg_point)
                                    • Else - Actions
                                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Ability being cast) Equal to (==) lightining Ward (lvl 9)
                                        • Then - Actions
                                          • Set Lighting_ward_integer = 0
                                          • Set Lighting_ward_integer = (Lighting_ward_integer + 1)
                                          • Set point = (Target point of ability being cast)
                                          • Unit - Create 1 lightning Ward for (Owner of (Triggering unit)) at point facing Default building facing (270.0) degrees
                                          • Unit - Set the custom value of (Last created unit) to Lighting_ward_integer
                                          • Set ward_array[Lighting_ward_integer] = (Last created unit)
                                            • Do Multiple ActionsFor each (Integer A) from 1 to 9, do (Actions)
                                              • Loop - Actions
                                                • Set Lighting_dummy_integer = (Lighting_dummy_integer + 1)
                                                • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                                • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                                                • Unit - Set the custom value of (Last created unit) to Lighting_dummy_integer
                                                • Set ward_dummy_array[Lighting_dummy_integer] = (Last created unit)
                                          • Custom script: call RemoveLocation (udg_point)
                                        • Else - Actions
  • lightining ward death Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Triggering unit) Equal to (==) ward_array[(Custom value of (Triggering unit))]
    • Actions
      • Do Multiple ActionsFor each (Integer Lighting_dummy_integer) from 1 to 10, do (Actions)
        • Loop - Actions
          • Unit - Remove pylon_caster_array[(Custom value of (Triggering unit))] from the game
 
Level 11
Joined
Dec 31, 2007
Messages
780
DEAR GOODNESS gimme a lil time and ill make this shorter


FIRST TRY
  • lightining ward
    • Events
      • Unit - A unit Starts the effect of an ability //(dont use begins casting coz that can be bugged... use starts the effect//
    • Conditions
    • Actions
      • Set point = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • level of (lightining Ward) for (triggering unit) = to 1
        • Then - Actions
          • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
          • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • level of lightining Ward grater than or equal to 2
              • Then - Actions
                • Set point = (Target point of ability being cast)
                • For each (Integer A) from 1 to level of (serpent ward) for (triggering unit), do (Actions)
                  • Loop - Actions
                    • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                    • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                    • //** you can set the custom value here//
                • Else - Actions
      • Custom script: call RemoveLocation (udg_point)
  • lightining ward death Copy
    • Events
      • Unit - A unit Dies
    • Conditions
      • Unit type of (Dying unit) Equal to (==) Serpent war dummy
    • Actions
      • Unit - Remove pylon_caster_array[(Custom value of (Triggering unit))] from the game
Ok... ive just finished editing it :p
 
Last edited:
Level 4
Joined
Oct 15, 2008
Messages
77
ok i understand u want it shorter but the way it works with the other ability it gotta stay te same i tried this too

  • lightining ward death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to (==) lightning Ward
    • Actions
      • Game - Display to (All players) the text: wurk 1
      • Set point = (Position of (Triggering unit))
      • Set unit_group = (Units within 20.00 of point matching (((Unit-type of (Triggering unit)) Equal to (==) lightning Ward) and (((Triggering unit) is Summoned) Equal to (==) True)))
      • Unit Group - Pick every unit in unit_group and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
          • Game - Display to (All players) the text: wurk
      • Custom script: call DestroyGroup (udg_unit_group)
      • Custom script: call RemoveLocation (udg_point)
 
Level 4
Joined
Oct 15, 2008
Messages
77
THIS IS FINE!!!!!!!! DONT WORRY ABOUT THIS TRIGGER
  • lightining ward
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to (==) lightining Ward (lvl 1)
        • Then - Actions
          • Set point = (Target point of ability being cast)
          • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
          • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation (udg_point)
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Ability being cast) Equal to (==) lightining Ward (lvl 2)
            • Then - Actions
              • Set point = (Target point of ability being cast)
                • Do Multiple ActionsFor each (Integer A) from 1 to 2, do (Actions)
                  • Loop - Actions
                    • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                    • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
              • Custom script: call RemoveLocation (udg_point)
            • Else - Actions
              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Ability being cast) Equal to (==) lightining Ward (lvl 3)
                • Then - Actions
                  • Set point = (Target point of ability being cast)
                    • Do Multiple ActionsFor each (Integer A) from 1 to 3, do (Actions)
                      • Loop - Actions
                        • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                        • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                  • Custom script: call RemoveLocation (udg_point)
                • Else - Actions
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Ability being cast) Equal to (==) lightining Ward (lvl 4)
                    • Then - Actions
                      • Set point = (Target point of ability being cast)
                        • Do Multiple ActionsFor each (Integer A) from 1 to 4, do (Actions)
                          • Loop - Actions
                            • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                            • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                      • Custom script: call RemoveLocation (udg_point)
                    • Else - Actions
                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Ability being cast) Equal to (==) lightining Ward (lvl 5)
                        • Then - Actions
                          • Set point = (Target point of ability being cast)
                            • Do Multiple ActionsFor each (Integer A) from 1 to 5, do (Actions)
                              • Loop - Actions
                                • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                          • Custom script: call RemoveLocation (udg_point)
                        • Else - Actions
                          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Ability being cast) Equal to (==) lightining Ward (lvl 6)
                            • Then - Actions
                              • Set point = (Target point of ability being cast)
                                • Do Multiple ActionsFor each (Integer A) from 1 to 6, do (Actions)
                                  • Loop - Actions
                                    • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                    • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                              • Custom script: call RemoveLocation (udg_point)
                            • Else - Actions
                              • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Ability being cast) Equal to (==) lightining Ward (lvl 7)
                                • Then - Actions
                                  • Set point = (Target point of ability being cast)
                                    • Do Multiple ActionsFor each (Integer A) from 1 to 7, do (Actions)
                                      • Loop - Actions
                                        • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                        • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                                  • Custom script: call RemoveLocation (udg_point)
                                • Else - Actions
                                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Ability being cast) Equal to (==) lightining Ward (lvl 8)
                                    • Then - Actions
                                      • Set point = (Target point of ability being cast)
                                        • Do Multiple ActionsFor each (Integer A) from 1 to 8, do (Actions)
                                          • Loop - Actions
                                            • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                            • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                                      • Custom script: call RemoveLocation (udg_point)
                                    • Else - Actions
                                      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Ability being cast) Equal to (==) lightining Ward (lvl 9)
                                        • Then - Actions
                                          • Set point = (Target point of ability being cast)
                                            • Do Multiple ActionsFor each (Integer A) from 1 to 9, do (Actions)
                                              • Loop - Actions
                                                • Unit - Create 1 lightning Ward (Dummy) for (Owner of (Triggering unit)) at point facing (Random angle) degrees
                                                • Unit - Add a 40.00 second Generic expiration timer to (Last created unit)
                                          • Custom script: call RemoveLocation (udg_point)
                                        • Else - Actions
that trigger is fine because each level is a DIFFERENT ABILITY. they just spawn extra dummy units depending on the level of another modifying ability i have on the hero.

my problem is THIS TRIGGER !

  • lightining ward death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to (==) lightning Ward
    • Actions
      • Game - Display to (All players) the text: wurk 1
      • Set point = (Position of (Dying unit))
      • Set unit_group = (Units within 20.00 of point matching (((Unit-type of (Triggering unit)) Equal to (==) lightning Ward) and (((Triggering unit) is Summoned) Equal to (==) True)))
      • Unit Group - Pick every unit in unit_group and do (Actions)
        • Loop - Actions
          • Unit - Remove (Picked unit) from the game
          • Game - Display to (All players) the text: wurk
      • Custom script: call DestroyGroup (udg_unit_group)
      • Custom script: call RemoveLocation (udg_point)
when the lighting totem dies. its not removing all of the correspnding dummy units.
 
Level 4
Joined
Oct 15, 2008
Messages
77
i dont mean to disrepsect you in anyway what so ever. im just meant i posted that trigger to show the generation of the dummy units. its just hard to explain to people what is going on in that trigger. and im just getting really frustrated over this ability.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
You should consider to listen to his advise. Not only is it shorter, but much more efficient. Although, yes I know... its not what you're after. You've made that perfectly clear.

Since you in your last post showed a different trigger, the only issue with that would be the radius. Do you realise how small a radius of 20 is? No unit is enumerated by that. Try to set it to like, 200. If your dummy unit haves the locust ability, it will not be picked whatsoever. Then, you would have to either, pick units of player matching blabla... or add the dummies into a group when they are created, and then remove all units in the unit group when the real serpent dies. That is probably the only reasonable help I can give you.
~Eccho~

Edit: Another thing
  • Set unit_group = (Units within 20.00 of point matching (((Unit-type of (Triggering unit)) Equal to (==) lightning Ward) and (((Triggering unit) is Summoned) Equal to (==) True)))
will not pick any unit. Triggering unit is not the right response here. Try Matching unit before you edit anything else.
 
Level 4
Joined
Oct 15, 2008
Messages
77
alright thanks that makes sense. but now onto problem number 2. why wont they purge on their attack?
 
Status
Not open for further replies.
Top