Pick Trees then Count?

treblig_auhc

New Member
Reaction score
2
Is there a GUI way to pick destructibles around a unit then get the number of destructibles and save it as a variable?
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Trigger:
  • Destructible - Pick every destructible within radius of (Position of (your unit)) and do (Actions)
    • Loop - Actions
      • Set treeCount = (treeCount + 1)


The position leaks.

"treeCount" is an integer variable.
 

UndeadDragon

Super Moderator
Reaction score
447
The non-leak version would be:

Trigger:
  • Actions
    • Set tmpPoint = (Position of (Your Unit))
    • Destructible - Pick every destructible within 256.00 of tmpPoint and do (Actions)
      • Loop - Actions
        • Set int = (int + 1)
    • Custom script: call RemoveLocation( udg_tmpPoint )
 

treblig_auhc

New Member
Reaction score
2
i mean it picks every destructible then counts the number of destructibles then puts it in a variable. e.g. hero casts spell and he has 10 trees around him. the trigger counts the ten trees and saves it in an integer variable. thanks for the help
 

Romek

Super Moderator
Reaction score
964
i mean it picks every destructible then counts the number of destructibles then puts it in a variable. e.g. hero casts spell and he has 10 trees around him. the trigger counts the ten trees and saves it in an integer variable. thanks for the help
How exactly are you going to store 10 trees into an integer variable?

I think you want a destructible array, and then store 10 trees to slots 0-9.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top