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.

a Leak issue

Discussion in 'Triggers & Scripts' started by Googlieeyes, Jun 29, 2009.

  1. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
    i'm having a leak issue with this trigger

    • Show Damage Creeps
      • Events
        • Unit - A unit Is attacked
      • Conditions
      • Actions
        • Unit Group - Pick every unit in (Units in (Playable map area) owned by Neutral Hostile) and do (Actions)
          • Loop - Actions
            • Trigger - Add to Show Damage Creeps 2 <gen> the event (Unit - (Picked unit) Takes damage)


    • Show Damage Creeps 2
      • Events
      • Conditions
      • Actions
        • Floating Text - Create floating text that reads (|c00623100- + ((String((Integer((Damage taken))))) + |r)) above (Triggering unit) with Z offset 0.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Floating Text - Set the velocity of (Last created floating text) to 128.00 towards 90.00 degrees
        • Floating Text - Change (Last created floating text): Disable permanence
        • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        • Floating Text - Change the fading age of (Last created floating text) to 0.40 seconds


    and i also have this for each color player like...

    • Show Damage red
      • Events
        • Unit - A unit Is attacked
      • Conditions
      • Actions
        • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Actions)
          • Loop - Actions
            • Trigger - Add to Show Damage red 2 <gen> the event (Unit - (Picked unit) Takes damage)


    • Show Damage red 2
      • Events
      • Conditions
      • Actions
        • Floating Text - Create floating text that reads (|c00D50000- + ((String((Integer((Damage taken))))) + |r)) above (Triggering unit) with Z offset 0.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Floating Text - Set the velocity of (Last created floating text) to 128.00 towards 90.00 degrees
        • Floating Text - Change (Last created floating text): Disable permanence
        • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        • Floating Text - Change the fading age of (Last created floating text) to 0.40 seconds


    and the other colors... blue, teal, etc does anyonek now how to fix this? bcuz it lags
     
  2. Amigurumi

    Amigurumi

    Joined:
    Apr 7, 2008
    Messages:
    1,575
    Resources:
    45
    Models:
    27
    Icons:
    3
    Packs:
    3
    Maps:
    7
    Spells:
    4
    Tutorials:
    1
    Resources:
    45
    you leak at unit groups...
    just create a variable (Unit-Type)
    • Events
    • Conditions
    • Actions
      • set TempGroup = ...
      • Unit Group - Pick every unit in TempGroup and do Actions
        • Loop - Actions
      • call DestroyGroup(udg_TempGroup)
     
  3. Super-Sheep

    Super-Sheep

    Joined:
    Oct 21, 2006
    Messages:
    2,823
    Resources:
    1
    Maps:
    1
    Resources:
    1
    And it adds the event to the trigger EVERY time when its attacked. After 10 attacks it can already start lagging or so...
     
  4. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
    okay i'm trying to do this so.. yeah i'm lost sorta what do i wanna set the tempgroup to?
     
  5. Amigurumi

    Amigurumi

    Joined:
    Apr 7, 2008
    Messages:
    1,575
    Resources:
    45
    Models:
    27
    Icons:
    3
    Packs:
    3
    Maps:
    7
    Spells:
    4
    Tutorials:
    1
    Resources:
    45
    set it to the unit group, which you did before
     
  6. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
    • Show Damage Creeps
      • Events
        • Unit - A unit Is attacked
      • Conditions
      • Actions
        • Set TempGroup = (Units in (Playable map area) owned by Neutral Hostile)
        • Unit Group - Pick every unit in TempGroup and do (Actions)
          • Loop - Actions
            • Trigger - Add to Show Damage Creeps 2 <gen> the event (Unit - (Picked unit) Takes damage)
        • Custom script: DestroyGroup(udg_TempGroup)


    now should i use.. TempGroup for all of the colors.. red? blue? teal? or like TempGroup1,TempGroup2,TempGroup3?
     
  7. Super-Sheep

    Super-Sheep

    Joined:
    Oct 21, 2006
    Messages:
    2,823
    Resources:
    1
    Maps:
    1
    Resources:
    1
    why you cant just use one showdmg trigger?
     
  8. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
    idk i'm a noob to this sutff?

    • Show Damage Creeps
      • Events
        • Unit - A unit Is attacked
      • Conditions
      • Actions
        • Set TempGroup = (Units in (Playable map area) owned by Neutral Hostile)
        • Unit Group - Pick every unit in TempGroup and do (Actions)
          • Loop - Actions
            • Floating Text - Create floating text that reads (|c00623100- + ((String((Integer((Damage taken))))) + |r)) above (Triggering unit) with Z offset 0.00, using font size 9.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
            • Floating Text - Set the velocity of (Last created floating text) to 128.00 towards 90.00 degrees
            • Floating Text - Change (Last created floating text): Disable permanence
            • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
            • Floating Text - Change the fading age of (Last created floating text) to 0.40 seconds
        • Custom script: call DestroyGroup(udg_TempGroup)


    like that?
     
  9. Super-Sheep

    Super-Sheep

    Joined:
    Oct 21, 2006
    Messages:
    2,823
    Resources:
    1
    Maps:
    1
    Resources:
    1
  10. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
    ?? like i posted above?
     
  11. Super-Sheep

    Super-Sheep

    Joined:
    Oct 21, 2006
    Messages:
    2,823
    Resources:
    1
    Maps:
    1
    Resources:
    1
    No .

    Make trigger with Map Init and use "pick all units in playable map area blabla and add event picked unit takes damage to dmgtrigger". And every time you create/buy/sell/train/summon a unit you use "add event, last created unit takes damage to dmgtrigger".

    Then use only one dmgtrigger, just like those others, but you need only one.
     
  12. Jaijaibinx

    Jaijaibinx

    Joined:
    Jun 1, 2008
    Messages:
    336
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    I'll show u an example. It uses custom Colours but you can change the easily if you want.

    Step 1 -
    First your gonna want to add these triggers to your map intalization. (I have used the colours that corresponds to each player but some do not show clearly (yellow/pink) so you may want to change this).


    Add This To Map Intilisation Trigger
    • Init
      • Events
        • Map initialization
      • Conditions
      • Actions
        • -------- //These are your colours from Player 1 Red to Player 12 Brown. --------
        • Set Colour[1] = |cFF0000FF|r
        • Set Colour[2] = |cFFFF0000|r
        • Set Colour[3] = |cFFFFFF00|r
        • Set Colour[4] = |cFF400040|r
        • Set Colour[5] = |cFF00FFFF|r
        • Set Colour[6] = |cFF0080FF|r
        • Set Colour[7] = |cFF00FF00|r
        • Set Colour[8] = |cFFFF80FF|r
        • Set Colour[9] = |cFFC0C0C0|r
        • Set Colour[10] = |cFFFFC0C0|r
        • Set Colour[11] = |cFF004000|r
        • Set Colour[12] = |cFF000040|r
        • -------- //This Basicaly Deals with Neutral Passive, Hostile and Extra. --------
        • For each (Integer A) from 13 to 15, do (Actions)
          • Loop - Actions
            • Set Colour[(Integer A)] = |cFF000000|r
        • -------- //Now we add all units to the damage logging trigger's events. --------
        • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
          • Loop - Actions
            • Trigger - Add to Damage Logger <gen> the event (Unit - (Picked unit) Takes damage)


    Step 2 -
    Following that, this is a leakless and functioning damage counting trigger that will use the colours we just specified when the corresponding player owns an attacked unit.


    Create A New Trigger Like This =>
    • Damage Logger
      • Events
        • Unit - A unit Is attacked
      • Conditions
      • Actions
        • Set TempUnit = (Attacked unit)
        • Set TempUnit2 = (Attacking unit)
        • Floating Text - Create floating text that reads (Colour[(Player number of (Owner of TempUnit2))] + (String((Integer((Damage taken)))))) above TempUnit with Z offset 0.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Floating Text - Set the velocity of (Last created floating text) to 120.00 towards 90.00 degrees
        • Floating Text - Change (Last created floating text): Disable permanence
        • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        • Floating Text - Change the fading age of (Last created floating text) to 0.40 seconds
        • -------- //Removing Values from the Variables. --------
        • Set TempUnit = No unit
        • Set TempUnit2 = No unit


    Have Added this Trigger for Insurance
    • Insurance
      • Events
        • Unit - A unit Finishes construction
        • Unit - A unit Finishes training a unit
        • Unit - A unit Spawns a summoned unit
      • Conditions
      • Actions
        • Set TempUnit = (Triggering unit)
        • Trigger - Add to Damage Logger <gen> the event (Unit - TempUnit Takes damage)
        • Set TempUnit = No unit


    Hope this helps :)

    phew.. I should be a tutorial writter xD
     
    Last edited: Jun 30, 2009
  13. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
    so if i use that as it is it'll work? and what kind of Varible is the colour set too?
     
  14. Super-Sheep

    Super-Sheep

    Joined:
    Oct 21, 2006
    Messages:
    2,823
    Resources:
    1
    Maps:
    1
    Resources:
    1
    jaijabinx go test that urself, it doesnt work

    it starts then unit is BEING attacked... not when taking dmg
     
  15. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
    okay i'm so confused.. what shuld i use?
     
  16. Super-Sheep

    Super-Sheep

    Joined:
    Oct 21, 2006
    Messages:
    2,823
    Resources:
    1
    Maps:
    1
    Resources:
    1
  17. Googlieeyes

    Googlieeyes

    Joined:
    Aug 3, 2008
    Messages:
    256
    Resources:
    1
    Spells:
    1
    Resources:
    1
  18. Jaijaibinx

    Jaijaibinx

    Joined:
    Jun 1, 2008
    Messages:
    336
    Resources:
    2
    Maps:
    1
    Tutorials:
    1
    Resources:
    2
    oh i see i thought he only wanted for when a unit is attacked.. (as thats what his initial triggers were).
    Sorry if I confused you. about the colours, you can still use my method. ( I fixed that problem and added a new one should work fine now xD).
     
  19. Super-Sheep

    Super-Sheep

    Joined:
    Oct 21, 2006
    Messages:
    2,823
    Resources:
    1
    Maps:
    1
    Resources:
    1
    You can set floating text color when you create it...