• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Question about item detection?

Status
Not open for further replies.
Level 15
Joined
Nov 26, 2005
Messages
1,151
A rather wierd question this is :

Let's say I want to pickevery item of type 'X' in 300 AoE from point 'A'. How can I do that ? I didn't find any option "pick items in range", only "pick items in region".

Help appreciated with rep!
 
Last edited:
Level 13
Joined
Mar 24, 2010
Messages
950
here this will work for you :)

  • items
    • Events
    • Conditions
    • Actions
      • Set Temp_Point = (Center of (Playable map area))
      • Item - Pick every item in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Picked item)) Equal to Crown of Kings +5
              • ((Picked item) is in (Region centered at Temp_Point with size (256.00, 256.00))) Equal to True
            • Then - Actions
              • -------- do what u want here --------
            • Else - Actions
      • Custom script: call RemoveLocation (udg_Temp_Point)
eh forgot u could just do it this way..

  • items
    • Events
    • Conditions
    • Actions
      • Set Temp_Point = (Center of (Playable map area))
      • Item - Pick every item in (Region centered at Temp_Point with size (256.00, 256.00)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Picked item)) Equal to Crown of Kings +5
            • Then - Actions
              • -------- do what u want here --------
            • Else - Actions
      • Custom script: call RemoveLocation (udg_Temp_Point)
 
Level 15
Joined
Nov 26, 2005
Messages
1,151
Yes, that's what I did, but doesnt this make a rectangular region around the point with height and width and NOT a circle with a radius ?

What I meant is that I need a circle with a radius, also known as "range".

Is there a way to do that ?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
This picks items withinn 600 range.

  • Untitled Trigger 008
    • Events
    • Conditions
    • Actions
      • Set p = (Center of (Playable map area))
      • Set r = (Region centered at p with size (600.00, 600.00))
      • Item - Pick every item in r and do (Actions)
        • Loop - Actions
          • Set p2 = (Position of (Picked item))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between p and p2) Less than or equal to 600.00
            • Then - Actions
              • -------- Is withing 600 range --------
            • Else - Actions
          • Custom script: call RemoveLocation(udg_p2)
      • Custom script: call RemoveLocation(udg_p2)
      • Custom script: call RemoveRect(udg_r)
 
Status
Not open for further replies.
Top