A way to select a number of trees within range?

NeuroToxin

New Member
Reaction score
46
Is there a way to select a number of trees, in range, without using a rect? I have been looking through the GUI and JASS functions and haven't found one. Any ideas anybody?
 

canons200

New Member
Reaction score
50
what is the meaning of rect?

by the way do you try the action as below?
Code:
Destructible - Pick every destructible within 256.00 of (Center of (Playable map area)) and do (Actions)
    Loop - Actions
 

tommerbob

Minecraft. :D
Reaction score
110
I'm not sure if you can check the number of trees in range, but you can check if the destructible in range is a tree. I made a spell that is based off this.

Select all destructibles in X range, then order a dummy unit to "harvest" the destructible. Then check his current order. If his current order is still "harvest", it means the destructible is a tree. You could probably then check how many of the picked destructibles there are.
 

Jedi

New Member
Reaction score
63
Code:
Actions
    -------- Set count to number of units owned by player 1 --------
    Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Actions)
        Loop - Actions
            Set Count = (Count + 1)
   


     -------- Set count to destructibles in 500 aoe --------
    Destructible - Pick every destructible within 500.00 of (Position of (Triggering unit)) and do (Actions)
        Loop - Actions
            Set Count = (Count + 1)

They were just examples.
 

NeuroToxin

New Member
Reaction score
46
Rect = Region, and I need to pick a SPECIFIC amount of trees. Even random N destructible's would work.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Combine tommerbob and Jedi's posts, then only do actions if the count is less than the number of trees you want to affect.
 

viktorpapa

New Member
Reaction score
2
Its very easy:

Set i = 0
Destructible - Pick every destructible within 256 of (something) and do (Actions)
Loop - Actions

If (i Less than AmountIneed) then do (Destructible - Whatever action) else do (Do nothing)
Set i = (i + 1)
 
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