Help Check Leak

Bankde

Member
Reaction score
20
This is my trigger to create the floating text which tell the damage. It's seem not to leak anywhere but when test (with 30 units attacking at 10 times per seconds), it is very lag and cause game unable to respond. Is this laggy comes from this trigger or it is normally lag with that 30 units ??

Trigger:
  • System Damage Floating Text
    • Events
      • Game - GDD_Damage becomes Equal to 0.00
    • Conditions
    • Actions
      • Set System_GDD_DamagedPoint = ((Position of GDD_DamagedUnit) offset by 50.00 towards 90.00 degrees)
      • Floating Text - Create floating text that reads (|c00 + (System_FloatingColor[(Random integer number between 0 and 15)] + (System_FloatingColor[(Random integer number between 0 and 15)] + (System_FloatingColor[(Random integer number between 0 and 15)] + (System_FloatingColor[(Random integer number between at System_GDD_DamagedPoint with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.60 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 90.00 degrees
      • Custom script: call RemoveLocation (udg_System_GDD_DamagedPoint)

Trigger:
  • System Damage Floating Variable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set System_FloatingColor[0] = 0
      • Set System_FloatingColor[1] = 1
      • Set System_FloatingColor[2] = 2
      • Set System_FloatingColor[3] = 3
      • Set System_FloatingColor[4] = 4
      • Set System_FloatingColor[5] = 5
      • Set System_FloatingColor[6] = 6
      • Set System_FloatingColor[7] = 7
      • Set System_FloatingColor[8] = 8
      • Set System_FloatingColor[9] = 9
      • Set System_FloatingColor[10] = a
      • Set System_FloatingColor[11] = b
      • Set System_FloatingColor[12] = c
      • Set System_FloatingColor[13] = d
      • Set System_FloatingColor[14] = e
      • Set System_FloatingColor[15] = f


I've check everywhere and I didn't find any leak (or does the string leak too ?)
Thank for helping +rep to those helpful reply.
 

eXirrah

New Member
Reaction score
51
(Position of GDD_DamagedUnit) leaks
you should have 2 point variables one for (Position of GDD_DamagedUnit)
and the other for Set System_GDD_DamagedPoint = ((Position of GDD_DamagedUnit) offset by 50.00 towards 90.00 degrees)

and then remove them both.

EDIT: I didn't notice this one System_GDD_DamagedPoint with Z offset 0.00
It leaks too... <-Scratch that ... I forgot that this is parameter of the texttag function.

Functions (Position of unit) and (Point with offset) both create points so every time
you use one of these functions (or any other function that return point) you get a new point.

To prevent leaking you must set the created points to a variables and remove them
later.
Trigger:
  • Actions
    • Set Position_Of_Unit = (Position of GDD_DamagedUnit)
    • Set System_GDD_DamagedPoint = (Position_Of_Unit offset by 50.00 towards 90.00 degrees)
    • Call: RemoveLocation(udg_System_GDD_DamagedPoint)
    • Call: RemoveLocation(udg_Position_Of_Unit)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top