• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] How to find this in GUI?

Status
Not open for further replies.
Level 18
Joined
Jan 12, 2011
Messages
1,513
Code:
(Number of units in (Units in spawn <gen>)) Less than 20


I want to know how to reach that code above I can only seem to find boolean comparisons for units and not anything resembling amount of units in a region

Also I'm using an array based system for point spawns and then removing them to avoid leaks, does the code above leak?
 
Level 18
Joined
Jan 12, 2011
Messages
1,513
The code above leaks, it uses a a unit group.

btw, the condition you're looking for is Integer Comparison -> Unit - number of units in unit group
Thanks, also how would you make it so it doesn't leak?

Would I have to create an integer variable - > store the amount of units in the integer -> do the integer comparison >> clear the variable?
 
Level 18
Joined
Jan 12, 2011
Messages
1,513
Would this work?
Code:
Check Angmar
    Events
    Conditions
        (Owner of Carn Dûm [Angmar] 0290 <gen>) Equal to (==) (Player((Integer A)))
        (Owner of Eastern Angmar [Angmar] 0292 <gen>) Equal to (==) (Player((Integer A)))
    Actions
        Set Gold_received[(Integer A)] = (Gold_received[(Integer A)] + 4)
        Set SpawnU[0] = (Units in Region 187 <gen> owned by (Player((Integer A))))
        Set SpawnX[0] = (Number of units in SpawnU[0])
        Game - Display to (Player group((Player((Integer A))))) the text: You control Angmar.
         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                EnableSpawners[0] Equal to (==) True
                SpawnX[0] Less than or equal to (<=) 10
            Then - Actions
                Set Angmar[0] = (Center of Region 187 <gen>)
                Unit - Create 1 Uruk-Hai for (Player((Integer A))) at Angmar[0] facing Default building facing (270.0) degrees
                Custom script:   call RemoveLocation(udg_Angmar[0])
            Else - Actions
        Custom script:   call DestroyGroup(udg_SpawnU[0])
        Set SpawnX[0] = 0
 
Status
Not open for further replies.
Top