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

I need a system like this. Detect the unit group according to their locations.

Level 17
Joined
Jun 2, 2009
Messages
1,139
Hello. Let me try to give you an example. Let's say there are 7 different regions.
When units enters one of them, they will be added to unitgroup. This group changes in every new region and regions have their own proirities.
You can check my AI System actually if you want to see details
My main objective is detect closest unit to AI_HERO owned by specific player and right click on them
Second part is detect this AI_HERO met with the unit

English is not my native language and i hope i have explained the situation.
Tricky part is, units are spawning in every 30 seconds. That means there can be another unit wave enters and follows the route.
I just want to pick AI_HERO make it go to the closest player 1 unit then detect this AI_HERO met with the units.

Maybe this one is super easy for the someone like me who created ai system for moba but currently i am tired and cannot think properly. You know that feel..
I spent my last energy for my paint and English skills..

  • DevilKuledenKac Copy
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Owner of (Attacked unit)) Equal to ClanDevilPlayer
      • ((Attacked unit) is in zUG_CreepsDevil) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Attacking unit) Equal to Soul Tower Level 1 0037 <gen>
          • (Attacking unit) Equal to Soul Tower Level 2 0036 <gen>
          • (Attacking unit) Equal to Soul Tower Level 3 0027 <gen>
          • (Attacking unit) Equal to Soul Tower Level 2 0035 <gen>
          • (Attacking unit) Equal to Soul Tower Level 3 0028 <gen>
          • (Attacking unit) Equal to Soul Tower Level 1 0038 <gen>
          • (Attacking unit) Equal to Soul Tower Level 2 0034 <gen>
          • (Attacking unit) Equal to Soul Tower Level 3 0029 <gen>
          • (Attacking unit) Equal to Slayer Reaper 0054 <gen>
    • Actions
      • -------- creeps devil grubu --------
      • Set TempPoint = (Position of (Attacked unit))
      • Set TempGroup = (Units within 500.00 of TempPoint matching (((Matching unit) is in zUG_CreepsDevil) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TempGroup) Less than or equal to 2
        • Then - Actions
          • Custom script: call DestroyGroup (udg_TempGroup)
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Set TempPoint = (Position of (Attacked unit))
          • Set TempGroup = (Units within 500.00 of TempPoint matching ((((Matching unit) is in HerolarYapayZekaDevil) Equal to True) and (((Matching unit) is in zUG_TankOFF_DEVIL) Equal to False)))
          • -------- timer yarat 2 saniye sonra gruptan cikart --------
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • Set zBool_AIFallBackTOWER[(Player number of (Owner of (Picked unit)))] = True
              • Set z_Bool_KuleyeVuruyor[(Player number of (Owner of (Picked unit)))] = False
              • Set TempUnit = (Random unit from I WANT TO DETECT CLOSEST PLAYER 1 UNIT WITHIN SPECIFIC GROUP IN HERE
              • Unit - Order (Picked unit) to Right-Click TempUnit
              • Game - Display to DebugBotSkills for 1.00 seconds the text: ((Name of (Picked unit)) + (Name of the current trigger))
              • Cinematic - Ping minimap for DebugBotSkills at (Position of TempUnit) for 1.00 seconds
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup)
        • Else - Actions
          • Custom script: call RemoveLocation (udg_TempPoint)
          • Custom script: call DestroyGroup (udg_TempGroup)
 

Attachments

  • aaa.png
    aaa.png
    23.4 KB · Views: 8
Top