How to check numbers of trees?

Hot

New Member
Reaction score
9
So how can i check numbers of tress in playable maparea and then store the number into an Intger?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Just a simple trigger like this should work:
Trigger:
  • Check Trees
    • Events
    • Conditions
    • Actions
      • Set TempInt = 0
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Last created destructible)) Equal to Summer Tree Wall
            • Then - Actions
              • Set TempInt = (TempInt + 1)
            • Else - Actions


Then "TempInt" will be the number you want ;)
 

Hatebreeder

So many apples
Reaction score
381
Pick all destructables in the playable map areana, and do this:

JASS:

function Count takes nothing returns nothing
set GLOBALINTEGER = GLOBALSINTEGER + 1
endfunction

function Enumerate takes nothing returns nothing
call EnumDestructables.... w/e
call ForGroup(YOURGLOBALGROUP,function Count)
endfunction
 

Hot

New Member
Reaction score
9
Thx Komaqation, But wont this leak? or is it only when u pick units u have to set them into Varibles?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Yeah, only unit-groups leak... (Or it's at least only they we do do anything about :p)
 

HydraRancher

Truth begins in lies
Reaction score
197
Just a simple trigger like this should work:
Trigger:
  • Check Trees
    • Events
    • Conditions
    • Actions
      • Set TempInt = 0
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Last created destructible)) Equal to Summer Tree Wall
            • Then - Actions
              • Set TempInt = (TempInt + 1)
            • Else - Actions


Then "TempInt" will be the number you want ;)

Pick every destructible only selects the first 64.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Nah, it's the event "Destructible - A destructible within (Playable map area) dies
" that does that ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top