Show Damage system - Question

Xenoche

Member
Reaction score
18
I recently found a show damage system for my MLRPG map:

Code:
Detect Unit
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Entering unit) is A Hero) Equal to False
    Actions
        Trigger - Add to Show Damages <gen> the event (Unit - (Triggering unit) Takes damage)
Code:
Show Damages
    Events
    Conditions
    Actions
        Set TEMP_POINT = (Position of (Triggering unit))
        Floating Text - Create floating text that reads (String((Integer((Damage taken))))) at TEMP_POINT with Z offset 80.00, using font size 8.00, color (100.00%, 100.00%, 100.00%), and 40.00% transparency
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Set the velocity of (Last created floating text) to 15.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
        Custom script:   call RemoveLocation (udg_TEMP_POINT)

It works well, BUT...

I question the stablity of this trigger in my map as the number of events added to this trigger could well exceed the thousands after only the 1st part of the campaign :eek:

So my questions are:
1: How many events can be attached to a trigger before it becomes clumbersome?
2: Is it at all possible to remove the un-needed events using custom script or JASS?
3: If not, does anybody know of a system that somehow avoids this problem?

4: Is it safe to have an array of Show damages triggers, and after 100 events added the previous one is destroyed and the next "Show damages" trigger is enabled and so on?

example:

Code:
Detect Unit
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Entering unit) is A Hero) Equal to False
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        showdamagecount equal to 100
    Then - Actions
        Set showdamagetrigs = showdamagetrigs + 1
        Set showdamagecount = 0
    Else - Actions
        Set showdamagecount = showdamagecount + 1
        Trigger - Add to Show Damages[showdamagetrigs] the event (Unit - (Triggering unit) Takes damage)
 

Chocobo

White-Flower
Reaction score
409
100 triggers, are quite useless. I don't know how many events you can put on a single trigger, but 256 same instances will mess up the trigger as far as I know.

See also Damage Shown and Modifications, the tutorial I made 7 months ago and uneditable.

Remember to register pre placed units also.

Code:
Register PrePlaced Units
  Events
    Game - Time Elasped 0.00 seconds of game-time
  Conditions
  [COLOR="Red"] //whatever you want[/COLOR]
  Actions
    Custom Script : set bj_wantDestroyGroup = true
    Unit Group - Pick every units in (Units in (Playable map area)) and do actions
      Loop - Actions
        Trigger - Add to Show Damages <gen> the event (Unit - (Picked unit) takes damage)
 

DuckieKing

Elitist Through and Through
Reaction score
51
Uh... not sure why you want multiple triggers but
Code:
local trigger trg=CreateTrigger()
call TriggerRegisterUnitEvent(trg, <specific unit>, EVENT_UNIT_DAMAGED)
call TriggerAddAction(trg, function ...)
Add into the function "call DestroyTrigger(GetTriggeringTrigger())."
Had to check a lot. ^_^;
...ugh... internet failed right when I tried to post.
 

Xenoche

Member
Reaction score
18
Very good point Chocobo I will do, heh.

Uh... not sure why you want multiple triggers but

The reason for the array of triggers is so one trigger doesnt get 1000 event responses dumped on it, it was just an idea.

I need a smoke anyway so ill look at the link afterwards ,almost 2am here and work tomorrow, cheers for the speedy replies.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top