should be easy...at least i thought it is -.-

Happy

Well-Known Member
Reaction score
71
hey all...

in my map i ran into a problem that i cant solve....although i thought it is easy to solve :mad:

the problem is this :

i need a trigger checking whether in region A & B & C are no living units owned by neutral hostile anymore and open a door than...


sounds really easy, or? i thought its easy too but somehow i cant get it to work so i ask you to help me out...



thanks in advance

greetz happy

P.S. my trigger is just a periodic check with if/then/else and a count living units in region XY....but it doesnt work....
 

Dirac

22710180
Reaction score
147
Event - Unit Dies
Condition - Unit belongs to Neutral Hostile
Actions -

set count=0

Pick every unit inside region A
set count+1
Pick every unit inside region B
set count+1
Pick every unit inside region C
set count+1

if count equal to 0 then
Open door

A faster method would be actually knowing how many units are inside the region

Event - Unit Dies
Condition - Unit belongs to Neutral Hostile and (Unit is in region A or Unit is in region B or Unit is in region C)
Actions -
set count=count-1
if count=0
open door
 

educator

New Member
Reaction score
9
events
unit dies
conditions
dying unit belongs to nuetral hostile
actions
set temp_group = units in region A owned by neutral hostile
add units in region B to temp_group
add units in region C to temp_group
pick units in temp group
-loop: if picked unit is dead then remove picked unit from temp_group
if: number of units in temp_group = 0
then: open door
else: do nuthin
custom script: call DestroyGroup( udg_temp_group ) -- (this function must be seperate from the if:then:else and at the very end)
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
How's this?
Trigger:
  • Neutral Check
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set TempUnitGroup = (Units in Spawn <gen> owned by Neutral Hostile)
      • Set TempUnitGroup2 = (Units in Spawn <gen> owned by Neutral Hostile)
      • Set TempUnitGroup3 = (Units in Spawn <gen> owned by Neutral Hostile)
      • Unit Group - Add all units of TempUnitGroup2 to TempUnitGroup
      • Unit Group - Add all units of TempUnitGroup3 to TempUnitGroup
      • Unit Group - Pick every unit in TempUnitGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is dead) Equal to True
            • Then - Actions
              • Unit Group - Remove (Picked unit) from TempUnitGroup
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempUnitGroup) Equal to 0
        • Then - Actions
          • Open the door, or whatever else you want to do.
        • Else - Actions
      • Custom script: call DestroyGroup(udg_TempUnitGroup)
      • Custom script: call DestroyGroup(udg_TempUnitGroup2)
      • Custom script: call DestroyGroup(udg_TempUnitGroup3)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top