[Trigger] Show damage?

Status
Not open for further replies.
Level 16
Joined
Jul 21, 2008
Messages
1,121
Here you go:

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Entire map))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Trigger - Add to Execute <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup(udg_TempGroup)
  • New Units
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • Trigger - Add to Execute <gen> the event (Unit - (Entering unit) Takes damage)
  • Execute
    • Events
    • Conditions
    • Actions
      • Set DamageString = (String((Integer((Damage taken)))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Greater than 0.00
        • Then - Actions
          • Floating Text - Create floating text that reads DamageString above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Else - Actions
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 256.00 towards 90.00 degrees
      • Floating Text - Change the fading age of (Last created floating text) to 0.80 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 1.20 seconds
Basically, first trigger picks all units placed in map into damage detection. All new units will be added with second one and third shows damage they have taken.
 
Level 9
Joined
May 22, 2009
Messages
491
There is no Conversion - Real to Integer all i have is
Integer to String
Real to String
Real to Formatted String
Order to String
Unit - Type to String
Externalized Sting
String Case

Also, where is the call DestroyGroup thing? (Sorry Im not great with triggers :/)
 
Level 9
Joined
May 22, 2009
Messages
491
One problem xD sorry but the numbers just sit there and the numbers are all weird the first hit is always 315 and then numbers never disappear I'll get a picture.
 

Attachments

  • numb3rs.PNG
    numb3rs.PNG
    604.9 KB · Views: 135
Try putting these within the if:

  • Floating Text - Change (Last created floating text): Disable permanence
  • Floating Text - Set the velocity of (Last created floating text) to 256.00 towards 90.00 degrees
  • Floating Text - Change the fading age of (Last created floating text) to 0.80 seconds
  • Floating Text - Change the lifespan of (Last created floating text) to 1.20 seconds
 
Level 19
Joined
Aug 31, 2008
Messages
1,780
Here you go:

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Entire map))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Trigger - Add to Execute <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup(udg_TempGroup)
  • New Units
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • Trigger - Add to Execute <gen> the event (Unit - (Entering unit) Takes damage)
  • Execute
    • Events
    • Conditions
    • Actions
      • Set DamageString = (String((Integer((Damage taken)))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Life of (Triggering unit)) Greater than 0.00
        • Then - Actions
          • Floating Text - Create floating text that reads DamageString above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Else - Actions
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 256.00 towards 90.00 degrees
      • Floating Text - Change the fading age of (Last created floating text) to 0.80 seconds
      • Floating Text - Change the lifespan of (Last created floating text) to 1.20 seconds
Basically, first trigger picks all units placed in map into damage detection. All new units will be added with second one and third shows damage they have taken.

i might also use this trigger any variables i need to put?
 
Level 4
Joined
Aug 13, 2009
Messages
57
i use

Event - Unit is Attacked

Action - -Set (HealthBefore) = (life of attaked unit)
-wait (0.5)
-Set (HealthAfter) = (life of attacked unit)
-CreateFloatingText..((String(HealthBefore)-(HealthAfter)above - AttackedUnit.
-Set DamageText = last created floatingtext
-Disable Permanence for DamageText
-set floating text life for DamageText
 
Status
Not open for further replies.
Top