1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Unit group -clear

Discussion in 'Triggers & Scripts' started by natass9, Oct 3, 2019.

  1. natass9

    natass9

    Joined:
    Aug 30, 2017
    Messages:
    17
    Resources:
    0
    Resources:
    0
    Trying to make aoe spell that does 200 damage and + 10 for every unit in point. it works as it should the first time, but i cant clear the unit group and the damage keeps increasing.

    • conditions
    • (Unit-type of (Damage source)) Equal to Sorceress (dummy)
    • actions
    • Unit Group - Pick every unit in (Units within 200.00 of tempoddtargdummy matching (((Triggering unit) is alive) Equal to True)) and do (Unit Group - Add (Picked unit) to tempgroupodd)
    • Event Response - Set Damage of Unit Damaged Event to (((Real((Number of units in tempgroupodd))) x 10.00) + 200.00)
    • Custom script: call RemoveLocation( udg_tempoddtargdummy )
    • Countdown Timer - Start cd as a One-shot timer that will expire in 3.00 seconds


    cd timer trigger
    • Time - cd expires
    • Unit Group - Remove all units from tempgroupodd


    thought the problem was dead units not being removed from the group so i used the trigger below, but that doesnt work.

    • Unit - A unit Dies
    • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
    • Unit Group - Remove (Triggering unit) from tempgroupodd


    attached map below the spell is on the lord garithos tower in murloc workers inventory.
     

    Attached Files:

    Last edited: Oct 3, 2019
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,901
    Resources:
    1
    Spells:
    1
    Resources:
    1
    You really need to be more clear with the triggers you are attempting to post. Use the [trigger][/trigger] tags: How To Post Your Trigger. You're leaking a unit group (how-to: Things That Leak). There's no reason the unit group needs to persist at all, so I don't understand what your issue is; the trigger should be very simple. The ability itself should just deal 200 damage if you want to base it on dispel to still do bonus damage to summons, or you can make it deal no damage and do the check for that manually and amp the damage yourself (what I did below).

    I believe the problem you have is checking this condition: matching (((Triggering unit) is alive) Equal to True)) which will always be true because you're erroneously checking Triggering not Matching Unit. Thus it adds dead units to the group.

    • Events
      • Unit - A unit starts the effect of an ability
    • Conditions
      • (Ability being cast) equal to Overwhelming Odds
    • Actions
      • Set TempPoint = (Target point of spell being cast)
      • Set Caster = (Triggering Unit)
      • Set Owner = (Owner of Caster)
      • Set TempUG = (Units within 200.00 of TempPoint matching (((Matching unit) belongs to an enemy of Owner) equal to true) and (((Matching Unit) is alive) equal to true))
      • Set CountBonus = (10.00 x Real(Number of units in TempUG))
      • Set BaseDmg = 200.00
      • Unit Group - Pick every unit in TempUG and do (Actions)
        • Loop - Actions
          • If (All conditions are true) then do (Then actions) else do (Else actions)
            • If - Conditions
              • ((Picked unit) is summoned) equal to true
            • Then - Actions
              • Set SummonBonus = (BaseDmg x 1.00)
            • Else - Actions
              • Set SummonBonus = 0.00
          • Unit - Cause Caster to damage (Picked Unit) for ((BaseDmg + SummonBonus) + CountBonus) damage of attack type Spells and damage type Magic
      • Custom script: call DestroyGroup(udg_TempUG) //change the name to match your variable name but keep the udg_ prefix
      • Custom script: call RemoveLocation(udg_TempPoint)
     
  3. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,304
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    Try to check and see if the timer does expire at all with a debug message. If it does, then something else must be going on. Otherwise, something's preventing the timer from expiring either from a restart of said timer, or a thread crash.

    Given aforesaid info, I'd try to check other triggers to see if the timer is being used elsewhere.

    (Also, this doesn't appear to be MUI.)
     
  4. natass9

    natass9

    Joined:
    Aug 30, 2017
    Messages:
    17
    Resources:
    0
    Resources:
    0
    thanks for the help guys i think pyro was right and it was me using triggering unit instead of matching.