• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] How to detect-trigger a group inside another group

Status
Not open for further replies.
Level 1
Joined
Jun 13, 2008
Messages
132
Hi again, I am having a trouble making my trigger to do this:
Every one second my trigger sets a "TempGroup" of units: the trapped unit, then I pick all the units in TempGroup (in the same trigger), and set the second group, "TempGroup2" the units not trapped and if they are in range (300), then I check if number of units in "TempGroup2" is greater than 0 I replace picked unit with not traped unit, but this does not work, any idea on how to do this?
In other words my trigger has to check if an unit not traped is in 300 aoe of a trapped unit, if this is true then the trapped unit is replaced with a one that is not trapped.
 
Something like this pseudo code?

Events - Every 1 second of game time
Conditions -
Actions -
Pick every unit in Temp_Group_1 and do actions
Loop -
set Point_1 = position of picked unit
set Temp_Group_2 = units within 300 of Point_1 matching conditions - Matching unit not in Temp_Group_1
set Temp_Unit_1 = random unit from Temp_Group_2
set Point_2 = position of Temp_Unit_1
Hide Temp_Unit_1
Move picked unit instantly to Point_2
Remove Trap_Buff from picked unit
Move Temp_Unit_1 instantly to Point_1
Unhide Temp_Unit_1
Create 1 Trapper Dummy for owner of picked unit at Point_1
Order last created unit to Storm Bolt Temp_Unit_1
Add a 2 second expiration timer to last created unit
Clean up Point_1
Clean up Point_2
Clean up Temp_Group_2

Temp_Group_1 is the currently trapped units.
 
Level 1
Joined
Jun 13, 2008
Messages
132
LoLz, my trigger was correct, my problem was that I have mistaken "ELAPSED GAME TIME", and I should have used "PERIODIC TIME EVENT". Thanks anyways xd.

  • Time - Elapsed game time is 1.00 seconds
  • Set TempGroup = (Units in (Playable map area) matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Peón orco Atrapado ( Mareado ))))
  • Unit Group - Pick every unit in TempGroup and do (Actions)
    • Loop - Actions
      • Set TempPoint = (Position of (Picked unit))
      • Set TempGroup2 = (Units within 300.00 of TempPoint matching ((((Matching unit) is alive) Equal to True) and ((Unit-type of (Matching unit)) Equal to Peón orco)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup2) Greater than 0
        • Then - Actions
          • Unit - Remove (Picked unit) from the game
          • Unit - Create 1 Peón orco for (Owner of (Picked unit)) at TempPoint facing Default building facing degrees
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Jugador Experto for (Picked unit)) Equal to 1
                • Then - Actions
                  • Unit - Add Jugador Experto to (Last created unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Jugador Novato for (Picked unit)) Equal to 1
                • Then - Actions
                  • Unit - Add Jugador Novato to (Last created unit)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Jugador Profesional for (Picked unit)) Equal to 1
                • Then - Actions
                  • Unit - Add Jugador Profesional to (Last created unit)
                • Else - Actions
            • Else - Actions
        • Else - Actions
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Custom script: call DestroyGroup (udg_TempGroup2)
 
Status
Not open for further replies.
Top