• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Damage system

Status
Not open for further replies.
Level 16
Joined
Jul 21, 2008
Messages
1,121
Try this:

  • Damage Detection 1
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Trigger - Add to Damage Detection Execute <gen> the event (Unit - (Picked unit) Takes damage)
      • Custom script: call DestroyGroup (udg_TempGroup)
  • Damage Detection 2
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • Trigger - Add to Damage Detection Execute <gen> the event (Unit - (Entering unit) Takes damage)
  • Damage Detection Execute
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer((Damage taken))) Greater than 0
        • Then - Actions
          • -------- You can change color of text if damage source is spell, melee, ranged... etc. --------
          • Set TempString = (String((Integer((Damage taken)))))
          • Floating Text - Create floating text that reads TempString above (Triggering unit) with Z offset 45.00, using font size 10.00, color (50.00%, 50.00%, 100.00%), and 25.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 256.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 0.75 seconds
        • Else - Actions
 
what r the leaks?

The event will become more and more, even if the unit is dead, the event block will contain that unit and check for it being damaged, even when the effect will NEVER happen again, you can't remove it from the event list, its like killing someone, you will not able to make him alive again.

So after 50 minutes, while every minute 2 units are spawned, you have 100 events which wait for the units being damaged,... What if you have killed 60 of them? Nothing changed, the map still waits for the units being damaged, even if the unit is removed.
 
I've made a damage system myself yesterday which works pretty well.

Heres a screenshot:
WC3ScrnShot_012709_220639_02.jpg

If I have finished it, I will give it to the public.
 
Status
Not open for further replies.
Top