• 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] Trigger problem!!

Status
Not open for further replies.
Level 12
Joined
Apr 26, 2008
Messages
830
Alright guys i made this spell but the first part works, but the second, when picking units around an area of 1300 and removing them doesn't work.

here is the trigger:
  • Sunny
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • (Ability being cast) Gleich Sunny Day
    • Aktionen
      • Set SD_CasterPoint = (Position of (Triggering unit))
      • Einheit - Create 1 SunnyDay for (Owner of (Triggering unit)) at SD_CasterPoint facing Vorgabe für Gebäude-Ausrichtung degrees
      • Einheit - Add a 30.00 second Standard expiration timer to (Last created unit)
      • -------- Debug --------
      • Einheit - Order (Triggering unit) to Stoppen
      • -------- Remove Other Present Dummies --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Or - Any (Conditions) are true
            • Bedingungen
              • ((Triggering unit) has buff Sunny Day ) Gleich True
              • ((Triggering unit) has buff Rain Dance ) Gleich True
        • 'THEN'-Aktionen
          • Einheitengruppe - Pick every unit in (Units within 1300.00 of SD_CasterPoint matching (((Unit-type of (Matching unit)) Gleich SunnyDay) or ((Unit-type of (Matching unit)) Gleich RainDance))) and do (Actions)
            • Schleifen - Aktionen
              • Einheit - Remove (Picked unit) from the game
          • Custom script: call DestroyGroup(bj_lastCreatedGroup)
          • Custom script: call RemoveLocation (udg_SD_CasterPoint)
        • 'ELSE'-Aktionen
          • Custom script: call RemoveLocation (udg_SD_CasterPoint)
EDIT: I tried it like this to but doesn't work...

  • Sunny
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • (Ability being cast) Gleich Sunny Day
    • Aktionen
      • Set SD_CasterPoint = (Position of (Triggering unit))
      • Einheit - Create 1 SunnyDay for (Owner of (Triggering unit)) at SD_CasterPoint facing Vorgabe für Gebäude-Ausrichtung degrees
      • Einheit - Add a 30.00 second Standard expiration timer to (Last created unit)
      • -------- Debug --------
      • Einheit - Order (Triggering unit) to Stoppen
      • -------- Remove Other Present Dummies --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Or - Any (Conditions) are true
            • Bedingungen
              • ((Triggering unit) has buff Sunny Day ) Gleich True
              • ((Triggering unit) has buff Rain Dance ) Gleich True
        • 'THEN'-Aktionen
          • Einheitengruppe - Pick every unit in (Units within 1300.00 of SD_CasterPoint) and do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • Or - Any (Conditions) are true
                    • Bedingungen
                      • (Unit-type of (Picked unit)) Gleich SunnyDay
                      • (Unit-type of (Picked unit)) Gleich RainDance
                • 'THEN'-Aktionen
                  • Einheit - Remove (Picked unit) from the game
                • 'ELSE'-Aktionen
          • Custom script: call DestroyGroup(bj_lastCreatedGroup)
          • Custom script: call RemoveLocation (udg_SD_CasterPoint)
        • 'ELSE'-Aktionen
          • Custom script: call RemoveLocation (udg_SD_CasterPoint)
 
Last edited:
Level 12
Joined
Apr 26, 2008
Messages
830
Get rid of the custom script "call DestroyGroup(bj_lastCreatedGroup)" as there is no reason that group should ever be destroyed. I think you don't understand what needs to be done to clear your memory leaks. Use the custom script "set bj_wantDestroyGroup = true" before picking all units, this will destroy the group properly.

Alright thanks for the tipp, but you did not say how to make the trigger functioning...

have you tried disabling the conditions?

Gonna try now.. but the caster has the buff.. 100% ..

EDIT: ok there is a small mistake =D.. i have to check if there is another dummy already BEFORE creating one or the created one will dissapear also or?
 
Level 7
Joined
Apr 1, 2010
Messages
289
Alright thanks for the tipp, but you did not say how to make the trigger functioning...



Gonna try now.. but the caster has the buff.. 100% ..

EDIT: ok there is a small mistake =D.. i have to check if there is another dummy already BEFORE creating one or the created one will dissapear also or?
the created unit will disappear because it is one of the unit types you remove.
(i really can't see whats wrong, it should function, you could add a unit var and set it to last created unit, and then in the loop check to see if picked unit = (Unitvar which = LastCreatedUnit))
 
Level 12
Joined
Apr 26, 2008
Messages
830
the created unit will disappear because it is one of the unit types you remove.
(i really can't see whats wrong, it should function, you could add a unit var and set it to last created unit, and then in the loop check to see if picked unit = (Unitvar which = LastCreatedUnit))

Hmmm i will try some things out..
... i can't understand it...

EDIT: Somehow, when i add the locust abillity to the unit it isn't removed, but when having no locus abillity it's removed...
 
Last edited:
Level 12
Joined
Apr 26, 2008
Messages
830
Locust units can't be enumerated over with "pick all units in rect" or "pick all units in range". You should add your dummy units to a group when you create them, then pick the units in that group when you want to remove the dummies.

Oh that's it .. thanks +rep

EDIT: But why doesn't it still work?!

  • Sunny
    • Ereignisse
      • Einheit - A unit Startet den Effekt einer Fähigkeit
    • Bedingungen
      • (Ability being cast) Gleich Sunny Day
    • Aktionen
      • Set SD_CasterPoint = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • Or - Any (Conditions) are true
            • Bedingungen
              • ((Triggering unit) has buff Sunny Day ) Gleich True
              • ((Triggering unit) has buff Rain Dance ) Gleich True
        • 'THEN'-Aktionen
          • Einheitengruppe - Pick every unit in (Units within 1300.00 of SD_CasterPoint) and do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • Or - Any (Conditions) are true
                    • Bedingungen
                      • ((Picked unit) is in DummyGroup) Gleich True
                • 'THEN'-Aktionen
                  • Einheitengruppe - Pick every unit in DummyGroup and do (Actions)
                    • Schleifen - Aktionen
                      • Einheit - Remove (Picked unit) from the game
                • 'ELSE'-Aktionen
                  • -------- Do nothing --------
        • 'ELSE'-Aktionen
          • -------- Do nothing --------
      • Einheit - Create 1 Sunny Day for (Owner of (Triggering unit)) at SD_CasterPoint facing Vorgabe für Gebäude-Ausrichtung degrees
      • Einheit - Add a 30.00 second Standard expiration timer to (Last created unit)
      • Einheitengruppe - Add (Last created unit) to DummyGroup
      • -------- Debug --------
      • Einheit - Order (Triggering unit) to Stoppen
      • -------- Clean Leaks --------
      • Custom script: call RemoveLocation (udg_SD_CasterPoint)
 
Last edited:
Status
Not open for further replies.
Top