Checking allies in a region

Freespace03

New Member
Reaction score
0
Can I make a condition check if a region only contains units of the same team? Something along the lines of:

"Region <Forest> only contains allied units"

No specified team and no specific player to be allied with. Just "The units in this region are all allied with each other".
Is this possible ?

Thanks in advance
 

Komaqtion

You can change this now in User CP.
Reaction score
469
This should work....
Trigger:
  • Only Allies in Region
    • Events
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area))
      • Set TempBool = True
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempGroup2 = (Units in (Playable map area))
          • Set TempUnit = (Picked unit)
          • Unit Group - Remove TempUnit from TempGroup2
          • Unit Group - Pick every unit in TempGroup2 and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an enemy of (Owner of TempUnit)) Equal to True
                • Then - Actions
                  • Set TempBool = False
                • Else - Actions
          • Custom script: call DestroyGroup(udg_TempGroup2)
      • Custom script: call DestroyGroup(udg_TempGroup)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempBool Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: All allies !
        • Else - Actions
          • Game - Display to (All players) the text: Not all allies !
 

Nherwyziant

Be better than you were yesterday :D
Reaction score
96
Trigger:
  • Test
    • Events
      • Unit - A unit enters &lt;Your Region?
    • Conditions
      • ((Owner of (Triggering unit)) is an ally of &lt;Player&gt;) Equal to True
    • Actions
      • Game - Display to (All players) the text: Entering unit is an ally! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" />
 
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