System Quick Damage Detection

wraithseeker

Tired.
Reaction score
122
You should list the Pros and Cons of the system with many DD system lying everywhere, because people compare them everywhere.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Cool. I'm starting out on a new map and figured I'd use a mod of your system in it.

Had to review it myself first.
JASS:
private function init takes nothing returns nothing
    local group g = CreateGroup()
    local trigger t = CreateTrigger()
    local region r = CreateRegion()
    call RegionAddRect(r, bj_mapInitialPlayableArea)
    call TriggerRegisterEnterRegion(t, r, Condition(function INIT_GROUP))
    call TriggerAddCondition(t, Condition(function INIT_GROUP))
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, Condition(function INIT_GROUP))
    call TriggerAddCondition(QDD_Trigger, Condition(function LoopingThrough))
    set QDD_Event = Event.create()
    call DestroyGroup(g)
    set g = null
endfunction

-->
JASS:
private function init takes nothing returns nothing
    local group g = CreateGroup()
    local region r = CreateRegion()
    call RegionAddRect(r, bj_mapInitialPlayableArea)
    call TriggerRegisterEnterRegion(CreateTrigger(), r, Condition(function INIT_GROUP))
    call GroupEnumUnitsInRect(g, bj_mapInitialPlayableArea, Condition(function INIT_GROUP))
    call TriggerAddCondition(QDD_Trigger, Condition(function LoopingThrough))
    set QDD_Event = Event.create()
    call DestroyGroup(g)
    set g = null
endfunction

Hawt.

Aside from that, love your style. Gosh it's simple. XD
 

RaiJin

New Member
Reaction score
40
lol ty ill prob be making another system to detect AnyUnitInRange because a lot of people want to try to copy slide ninja slide or run kitty run so i think it will be good
 

LurkerAspect

Now officially a Super Lurker
Reaction score
118
This works really well, and it's nice and simple! 5/5 from me.

EDIT: Could you add how to implement/use this function to the system's description? Maybe add an example trigger as well? Thanx :D
 

RaiJin

New Member
Reaction score
40
I hate to say it, but this does leak events. (Not that I've tested it myself, but it should, from what I've heard.) Somewhere on this thread I thought it kinda needed to state so...

I just thought approved resources had to be leakless. <_<

? what do you mean leak events
 

Sevion

The DIY Ninja
Reaction score
413
That is correct. Resetting triggers etc don't remove events ;)

However, I believe you may be able to do something with structs to fix this. I've not looked into Event, Jesus, but this has given me some drive to want to >=D

Edit: Yep, I believe destroying Event instances when a unit is removed (you can probably use Udn) from the game completely, will remove event leaks ;)
 

Nestharus

o-o
Reaction score
84
Uh sevion-

Generally- no leakage
Specific Unit Types- when ur done with them (if you don't want them in anymore), destroy your trigger and it'll fix the leak. Be sure to disable first ><.
Specific Units- Against, destroy your triggers or you'll leak events.

Udn still uses events, it just uses dif events so you don't have to register every unit or w/e if you don't want to. You can register all units of a player, all units, etc : |. So what you said wasn't quite accurate ^^.

Udn wouldn't be the answer unless you wanted to mess with corpses. You should just destroy the triggers to remove the leaks : |. Destroying triggers is safe if you "disable the trigger first".

-nessy out
 

Nestharus

o-o
Reaction score
84
Why do you think handle stack corruption can occur when nubs destroy triggers? It's the same deal with timers... if you don't pause it then u'll end up getting handle stack corruption =/=.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Capital E versus not.

Actually, destroying triggers is safe without disabling. Just don't use trigger actions. And Event doesn't disable or destroy triggers, actually, that is up to the user to do (however they like).

Also, I don't see how Event would solve the issue I was talking about. I wasn't talking about Events leaking, I was talking about events leaking. The "Unit Takes Damage" event for each unit on the map...

I'd solve it with AIDS structs the way I did in Damage. :D

>Why do you think handle stack corruption can occur when nubs destroy triggers?
Because TriggerSleepAction is bugged. If any other reasons are known, feel free to say...

>Destroying triggers is safe if you "disable the trigger first".
I don't believe you. :)
 

Jesus4Lyf

Good Idea™
Reaction score
397
Yeah, that stuff is there to detect trigger destruction, but doesn't do anything else.

For solving the event leaks in this (not Event), I'd do the AIDS struct thing. The only problem then is that this is no different to Damage (just less features).

Still better than leaking, though.

It was done on WC3C by periodically destroying the main trigger, and adding events for all units on the map again, I believe (I think that's a terrible way to do it though :( O(n) complexity stuff).
 
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