• 🏆 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!

Why i cannot find pick every item within region?

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,123
Hello everyone. I want to create ability that picks every item within x range of the caster and give it to the unit.
I cannot find the "region WITHOUT offset"

Short question: How can i detect every item within x range, then pick the items?
 
Level 19
Joined
Feb 27, 2019
Messages
580
Item - Pick every item in Playable map area and do (Actions)
Then you click on "Playable map area" and select your region.
If you want to pick every item within 150 range then the region has to be at least 300, 300, twice the range.
This method can be used to pick units aswell and its more accurate than just using a region since regions are rectangular.
For example:
  • Pick every item within range
    • Events
    • Conditions
    • Actions
      • Set VariableSet TempPoint = (Position of (Triggering unit))
      • Set VariableSet TempRegion = (Region centered at TempPoint with size (400.00, 400.00))
      • Item - Pick every item in TempRegion and do (Actions)
        • Loop - Actions
          • Set VariableSet TempPoint2 = (Position of (Picked item))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TempPoint and TempPoint2) Less than 150.00
            • Then - Actions
              • Hero - Give (Picked item) to (Triggering unit)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveRect(udg_TempRegion)
 
Level 17
Joined
Jun 2, 2009
Messages
1,123
Item - Pick every item in Playable map area and do (Actions)
Then you click on "Playable map area" and select your region.
If you want to pick every item within 150 range then the region has to be at least 300, 300, twice the range.
This method can be used to pick units aswell and its more accurate than just using a region since regions are rectangular.
For example:
  • Pick every item within range
    • Events
    • Conditions
    • Actions
      • Set VariableSet TempPoint = (Position of (Triggering unit))
      • Set VariableSet TempRegion = (Region centered at TempPoint with size (400.00, 400.00))
      • Item - Pick every item in TempRegion and do (Actions)
        • Loop - Actions
          • Set VariableSet TempPoint2 = (Position of (Picked item))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TempPoint and TempPoint2) Less than 150.00
            • Then - Actions
              • Hero - Give (Picked item) to (Triggering unit)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveRect(udg_TempRegion)
WoW it's you again. You helped me on this topic Detect more than 1 type weapon
Thank you my friend today i will try this one
 
Status
Not open for further replies.
Top