[Trigger] Damage Floating Texts (will +rep for help!)

Status
Not open for further replies.
Level 3
Joined
Feb 3, 2009
Messages
33
Hello, I know this trigger have been asked a lot a times, I searched in requests and in the help for triggers section, but every trigger i found was causing leak, or wasn't working...
My map is a RPG, so a lot of units die, that's why i want a Jass trigger but i dont know how to use it and i would like someone experienced to do a good one for me ..
i dont ask anything impossible, just a floating text that will appear on the unit when it takes damages

thanks in advance for helping!
 
Level 4
Joined
Mar 15, 2009
Messages
70
  • Damagesetup1
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • Trigger - Add to Damage <gen> the event (Unit - (Triggering unit) Takes damage)
  • Damagesetup2
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Damage <gen> the event (Unit - (Picked unit) Takes damage)
  • Damage
    • Events
    • Conditions
    • Actions
      • Set DamageTextPoint = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Damage taken) Greater than or equal to 1.00
        • Then - Actions
          • Floating Text - Create floating text that reads (String((Integer((Damage taken))))) at DamageTextPoint with Z offset 0.00, using font size 8.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
        • Else - Actions
      • Custom script: call RemoveLocation ( udg_DamageTextPoint )
i dont know its leak or not.. but its good in my map
 
  • Damagesetup2
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Temp_Group_1 = (Units in (Playable map area))
      • Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
        • Loop - Actions
          • Trigger - Add to Damage Detection <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup(udg_Temp_Group_1)
Your unit group leaks.
 
Level 3
Joined
Feb 3, 2009
Messages
33
i used this also in my map .. exactly the same .. but after some time the game gets a bit slow.. i read somewhere that a unit dying with this trigger makes some leak but i dont know how to remove it with GUI.. thats why i wanted a jass thing with local variables or something like this
 
Level 3
Joined
Feb 3, 2009
Messages
33
oh okay! thats why... but i use triggers to spawn monsters in very big quantity.. they appear randomly in a zone but they are very numbrous.. so i think it is why the damage text becomes slow after some time..
is there a way to remove the event about dead units to clean the trigger??
 
Status
Not open for further replies.
Top