• 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.

[General] Helping Needed!

Status
Not open for further replies.

Deleted member 219079

D

Deleted member 219079

You need to check if units in question classify as dead and life of each is less than 0.405.
 
Add all units in the battle to a group. Every time one dies then remove it from the group. When the group is empty then all units in the battle have died. Note this does not factor in units that have died but somehow were resurrected.
First, five Felguards will be created and will attack to a group of Night Elves. I want to start a timer until the next group of Felguards will be created. Whether I should use this point of you??
 

Deleted member 219079

D

Deleted member 219079

This is English only site.
Given following globals:
upload_2016-11-30_13-1-20.png
upload_2016-11-30_13-3-54.png
upload_2016-11-30_13-16-16.png

  • Trigger
    • Events
      • (your init event)
    • Conditions
    • Actions
      • (whatever prior to this)
      • Unit - Create N (felhound) for (owner of felhounds) at (position of felhounds) facing (whatever you wish) degrees
      • Custom script: set udg_t = CreateTrigger()
      • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
        • Loop - Actions
          • Set u = (Picked unit)
          • Trigger - Add to t the event (Unit - u Dies)
          • Unit Group - Add u to felguards
      • Custom script: call ExecuteFunc("InitTimerCheck")
      • Custom script: endfunction
      • -------- TimerCheck --------
      • Custom script: function TimerCheck takes nothing returns boolean
      • Unit Group - Remove (Triggering unit) from felguards
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (felguards is empty) Equal to True
        • Then - Actions
          • Custom script: call DestroyTrigger(GetTriggeringTrigger())
          • -------- ALL UNITS HAVE DIED; YOUR CODE GOES HERE --------
        • Else - Actions
      • Custom script: return false
      • Custom script: endfunction
      • -------- InitTimerCheck --------
      • Custom script: function InitTimerCheck takes nothing returns nothing
      • Custom script: call TriggerAddCondition(udg_t, Condition(function TimerCheck))
 
This is English only site.
Given following globals:
View attachment 253708View attachment 253709View attachment 253710
  • Trigger
    • Events
      • (your init event)
    • Conditions
    • Actions
      • (whatever prior to this)
      • Unit - Create N (felhound) for (owner of felhounds) at (position of felhounds) facing (whatever you wish) degrees
      • Custom script: set udg_t = CreateTrigger()
      • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
        • Loop - Actions
          • Set u = (Picked unit)
          • Trigger - Add to t the event (Unit - u Dies)
          • Unit Group - Add u to felguards
      • Custom script: call ExecuteFunc("InitTimerCheck")
      • Custom script: endfunction
      • -------- TimerCheck --------
      • Custom script: function TimerCheck takes nothing returns boolean
      • Unit Group - Remove (Triggering unit) from felguards
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (felguards is empty) Equal to True
        • Then - Actions
          • Custom script: call DestroyTrigger(GetTriggeringTrigger())
          • -------- ALL UNITS HAVE DIED; YOUR CODE GOES HERE --------
        • Else - Actions
      • Custom script: return false
      • Custom script: endfunction
      • -------- InitTimerCheck --------
      • Custom script: function InitTimerCheck takes nothing returns nothing
      • Custom script: call TriggerAddCondition(udg_t, Condition(function TimerCheck))
Did not need, I fixed it before. Anyway thanks!
 

Deleted member 219079

D

Deleted member 219079

I bet you have a generic unit dies event where you check if the unit is in the unit group. Have 100 systems like that and you hope that no units die so you can live to see the next frame.
 

Deleted member 219079

D

Deleted member 219079

Rather have it here. If it's your entry to mini-mapping contest it'd be considered teamwork if I worked on your map, look:
upload_2016-11-30_17-37-51.png

After that, you type [trigger] and press Ctrl+V and then end with [/trigger].
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
I bet you have a generic unit dies event where you check if the unit is in the unit group. Have 100 systems like that and you hope that no units die so you can live to see the next frame.
Only if he keeps it running when not necessary.

If the spawn is recursive your method might be prone to an event object leak. Let us not forget the lack of readability due to the GUI...

Oh my bad! Problem is not fixed. Can I give you the map to fix this problem for me, jondrean??
In what way is it still broken? Post triggers and explain?
 
Last edited:

Deleted member 219079

D

Deleted member 219079

Yes if the spawn is recursive you'd need hashtable into which you'd store the group (felhoundgroups is a hashtable, g is the newly created group for felhounds being created):
call SaveGroupHandle(udg_felhoundgroups, 0, GetHandleId(udg_t), udg_g)
And to retrieve:
set udg_g = LoadGroupHandle(udg_felhoundgroups, 0, GetHandleId(GetTriggeringTrigger()))
 
Hello guys!
Here is the death of first felguard:
  • Felguard01Dies
    • Events
      • Unit - A unit owned by Player 4 (Purple) Dies
    • Conditions
      • (Triggering unit) Equal to Felguard01
    • Actions
      • Unit Group - Remove Felguard01 from LegionAttack01
Second felguard's death:
  • Felguard02Dies
    • Events
      • Unit - A unit owned by Player 4 (Purple) Dies
    • Conditions
      • (Triggering unit) Equal to Felguard02
    • Actions
      • Unit Group - Remove Felguard02 from LegionAttack01
And etc deaths.
All felguards have died and removed from LegionAttack01 group. Now, what should I do??
 

Deleted member 219079

D

Deleted member 219079

Look there's generic death event like I told all y'all.

Use my method: [General] - Helping Needed!

If you wanna really use that generic event, set event: unit dies, condition: triggering unit is in the group, action: remove from group, if group is empty, disable triggering trigger and insert continuation code.
 

Deleted member 219079

D

Deleted member 219079

  • MyInitiallyOffTrigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in felguards) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from felguards
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (felguards is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • -------- ALL UNITS HAVE DIED; YOUR CODE GOES HERE --------
        • Else - Actions
You turn it on when you initialize the group. Note that if waves overlap, this won't work so ask about that if that's the case.
 
  • MyInitiallyOffTrigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in felguards) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from felguards
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (felguards is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • -------- ALL UNITS HAVE DIED; YOUR CODE GOES HERE --------
        • Else - Actions
You turn it on when you initialize the group. Note that if waves overlap, this won't work so ask about that if that's the case.
I'm going to try it.
 
  • MyInitiallyOffTrigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in felguards) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from felguards
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (felguards is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • -------- ALL UNITS HAVE DIED; YOUR CODE GOES HERE --------
        • Else - Actions
You turn it on when you initialize the group. Note that if waves overlap, this won't work so ask about that if that's the case.
Yeah, I tried it and now it is fixed. Thank you, jondrean!
+rep
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
I'm talking about this:
No you are not..

Event objects only get destroyed when their associated trigger is destroyed. The trigger posted earlier dynamically attached specific unit death event objects to a trigger. If this was to occur repeatedly, eg for repeating waves, it would leak event objects as the trigger is never destroyed to remove the event objects.

Each event binding created also creates an event type object, which is even given its own handle ID.
 

Deleted member 219079

D

Deleted member 219079

I wonder how you associated this trigger with overlapping waves;
  • MyInitiallyOffTrigger
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in felguards) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from felguards
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (felguards is empty) Equal to True
      • Then - Actions
        • Trigger - Turn off (This trigger)
        • -------- ALL UNITS HAVE DIED; YOUR CODE GOES HERE --------
        • Else - Actions
Here:
upload_2016-12-1_18-43-17.png
upload_2016-12-1_18-57-12.png

  • Trigger
    • Events
      • ...
    • Conditions
    • Actions
      • Unit - Create ...
      • Custom script: set udg_t = CreateTrigger()
      • Custom script: call SaveGroupHandle(udg_felguardgroups, 0, GetHandleId(udg_t), udg_g)
      • Unit Group - Pick every unit in (Last created unit group) and do (Actions)
        • Loop - Actions
          • Set u = (Picked unit)
          • Trigger - Add to t the event (Unit - u Dies)
          • Unit Group - Add u to g
      • Custom script: set udg_g = CreateGroup()
      • Custom script: call ExecuteFunc("InitTimerCheck")
      • Custom script: endfunction
      • -------- TimerCheck --------
      • Custom script: function TimerCheck takes nothing returns boolean
      • Custom script: local group bu = udg_g
      • Custom script: set udg_g = LoadGroupHandle(udg_felguardgroups, 0, GetHandleId(GetTriggeringTrigger()))
      • Unit Group - Remove (Triggering unit) from g
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (g is empty) Equal to True
        • Then - Actions
          • Custom script: call DestroyTrigger(GetTriggeringTrigger())
          • -------- ALL UNITS HAVE DIED; YOUR CODE GOES HERE --------
        • Else - Actions
      • Custom script: call DestroyGroup(udg_g)
      • Custom script: set udg_g = bu
      • Custom script: set bu = null
      • Custom script: return false
      • Custom script: endfunction
      • -------- InitTimerCheck --------
      • Custom script: function InitTimerCheck takes nothing returns nothing
      • Custom script: call TriggerAddCondition(udg_t, Condition(function TimerCheck))
Edit: ..grammar
 
Last edited by a moderator:

Deleted member 219079

D

Deleted member 219079

But the trigger in question is destroyed? There are no leaks on that regard, only group leak which I can't fix atm cuz I'm not on my computer.
 
Status
Not open for further replies.
Top