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

a Leak issue

Status
Not open for further replies.
Level 8
Joined
Aug 3, 2008
Messages
257
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
 
Level 8
Joined
Aug 3, 2008
Messages
257
  • 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?
 
Level 8
Joined
Aug 3, 2008
Messages
257
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?
 
Level 20
Joined
Oct 21, 2006
Messages
3,231
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.
 
Level 8
Joined
Jun 1, 2008
Messages
341
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).
  • 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.
  • 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
  • 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:
Status
Not open for further replies.
Top