• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Can we create system like this? Aggro system.

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,155
Here is the system that i need

When enemy heroes cast spells on you or attacks you, your friendly units around you starts to attack the enemy who attacks or cast spells on you for few seconds. After few seconds they will order to attack and move to their next targets (next target, current target and previous target already set)

Explanation with the video:

Update: Here is the system that i have created but it has huge flaw.

  • AggroTest1
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is A Hero) Equal to True
      • (DamageEventSource is A Hero) Equal to True
    • Actions
      • Set DamagePoint = (Position of DamageEventTarget)
      • Set DamageGroup = (Units within 1000.00 of DamagePoint)
      • Unit Group - Pick every unit in DamageGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in CreepsGroup) Equal to True
              • ((Picked unit) belongs to an enemy of (Owner of DamageEventSource)) Equal to True
            • Then - Actions
              • Unit - Order (Picked unit) to Attack DamageEventSource
              • Game - Display to (All players) for 1.00 seconds the text: (Name of (Picked unit))
              • Trigger - Run AggroEnds <gen> (ignoring conditions)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_DamagePoint)
Here is the trouble begins.

  • AggroEnds
    • Events
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • Unit Group - Pick every unit in DamageGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in CreepsGroup) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 1 (Red)
                • Then - Actions
                  • Unit - Order (Picked unit) to Attack-Move To (Center of Region 000 <gen>)
                  • Game - Display to (All players) for 1.00 seconds the text: Red aggro ends
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Equal to Player 7 (Green)
                    • Then - Actions
                      • Unit - Order (Picked unit) to Attack-Move To (Center of Region 001 <gen>)
                      • Game - Display to (All players) for 1.00 seconds the text: Green aggro ends
                    • Else - Actions
            • Else - Actions
      • Custom script: call DestroyGroup(udg_DamageGroup)
This looks good but i think i made a mistake at AggroEnds section. The important part is now i have to implement it into my map.
Old system was in Jass and i don't have any idea what is happening in there. Here is the link Is there a way to convert this into GUI? Because it has problems and i cannot read Jass.

Question 1: How can i order them to their CurrentTargets when the aggro ends? I don't know because code is Jass. This is why i am trying to create it as GUI

Question 2: Is this Jass code only for the Aggro? I am asking because i will remove this Jass code from my map and i will use my GUI system. Is this Jass affects any other things in my map?

Question 3: Is If we do not need to convert this Jass into GUI, how can i send them to their CurrentTargets?

  • Creep Yollari
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- S P A W N P O I N T S --------
      • Set DevilSpawnNoktasi[1] = (Center of DevilSpawn1 <gen>)
      • Set DevilSpawnNoktasi[2] = (Center of DevilSpawn2 <gen>)
      • Set DevilSpawnNoktasi[3] = (Center of DevilSpawn3 <gen>)
      • Set ReaperSpawnNoktasi[1] = (Center of ReaperSpawn1 <gen>)
      • Set ReaperSpawnNoktasi[2] = (Center of ReaperSpawn2 <gen>)
      • Set ReaperSpawnNoktasi[3] = (Center of ReaperSpawn3 <gen>)
      • -------- ___________________________ --------
      • Set CreepHedeflerRegion[1] = DevilSpawn1 <gen>
      • Set CreepHedeflerRegion[2] = DevilSol <gen>
      • Set CreepHedeflerRegion[3] = AltMid <gen>
      • Set CreepHedeflerRegion[4] = Reapersol <gen>
      • Set CreepHedeflerRegion[5] = ReaperSpawn1 <gen>
      • Set CreepHedeflerRegion[6] = DevilSpawn2 <gen>
      • Set CreepHedeflerRegion[7] = ReaperSpawn2 <gen>
      • Set CreepHedeflerRegion[8] = DevilSpawn3 <gen>
      • Set CreepHedeflerRegion[9] = DevilSag <gen>
      • Set CreepHedeflerRegion[10] = UstMid <gen>
      • Set CreepHedeflerRegion[11] = ReaperSag <gen>
      • Set CreepHedeflerRegion[12] = ReaperSpawn3 <gen>
      • Set CreepHedefSayisi = 12
      • For each (Integer A) from 1 to CreepHedefSayisi, do (Actions)
        • Loop - Actions
          • Set CreepHedefler[(Integer A)] = (Center of CreepHedeflerRegion[(Integer A)])
          • Trigger - Add to Creep Yonlendirme <gen> the event (Unit - A unit enters CreepHedeflerRegion[(Integer A)])
      • Set DevilNextHedef[1] = (Center of DevilSol <gen>)
      • Set DevilNextHedef[2] = (Center of AltMid <gen>)
      • Set DevilNextHedef[3] = (Center of Reapersol <gen>)
      • Set DevilNextHedef[4] = (Center of ReaperSpawn1 <gen>)
      • Set DevilNextHedef[5] = (Center of ValueReaper <gen>)
      • Set DevilNextHedef[6] = (Center of ReaperSpawn2 <gen>)
      • Set DevilNextHedef[7] = (Center of ValueReaper <gen>)
      • Set DevilNextHedef[8] = (Center of DevilSag <gen>)
      • Set DevilNextHedef[9] = (Center of UstMid <gen>)
      • Set DevilNextHedef[10] = (Center of ReaperSag <gen>)
      • Set DevilNextHedef[11] = (Center of ReaperSpawn3 <gen>)
      • Set DevilNextHedef[12] = (Center of ValueReaper <gen>)
      • Set ReaperNextHedef[1] = (Center of DevilSlayer <gen>)
      • Set ReaperNextHedef[2] = (Center of DevilSpawn1 <gen>)
      • Set ReaperNextHedef[3] = (Center of DevilSol <gen>)
      • Set ReaperNextHedef[4] = (Center of AltMid <gen>)
      • Set ReaperNextHedef[5] = (Center of Reapersol <gen>)
      • Set ReaperNextHedef[6] = (Center of DevilSlayer <gen>)
      • Set ReaperNextHedef[7] = (Center of DevilSpawn2 <gen>)
      • Set ReaperNextHedef[8] = (Center of DevilSlayer <gen>)
      • Set ReaperNextHedef[9] = (Center of DevilSpawn3 <gen>)
      • Set ReaperNextHedef[10] = (Center of DevilSag <gen>)
      • Set ReaperNextHedef[11] = (Center of UstMid <gen>)
      • Set ReaperNextHedef[12] = (Center of ReaperSag <gen>)
      • -------- ___________________________ --------
      • Set DevilSpawnHedef[1] = (Center of DevilSol <gen>)
      • Set DevilSpawnHedef[2] = (Center of ReaperSpawn2 <gen>)
      • Set DevilSpawnHedef[3] = (Center of DevilSag <gen>)
      • Set ReaperSpawnHedef[1] = (Center of Reapersol <gen>)
      • Set ReaperSpawnHedef[2] = (Center of DevilSpawn2 <gen>)
      • Set ReaperSpawnHedef[3] = (Center of ReaperSag <gen>)
      • Set DevilSpawnCreepAbilityLevel[1] = 1
      • Set DevilSpawnCreepAbilityLevel[2] = 6
      • Set DevilSpawnCreepAbilityLevel[3] = 8
      • Set ReaperSpawnCreepAbilityLevel[1] = 5
      • Set ReaperSpawnCreepAbilityLevel[2] = 7
      • Set ReaperSpawnCreepAbilityLevel[3] = 12
  • Creep Yonlendirme
    • Events
    • Conditions
      • ((Owner of (Triggering unit)) Equal to ClanDevilPlayer) or ((Owner of (Triggering unit)) Equal to ClanReaperPlayer)
    • Actions
      • Wait 0.01 seconds
      • For each (Integer A) from 1 to CreepHedefSayisi, do (Actions)
        • Loop - Actions
          • Custom script: if IsLocationInRegion(GetTriggeringRegion(), udg_CreepHedefler[bj_forLoopAIndex]) then
          • -------- Integer A girilen region --------
          • Unit - Set level of BEN CREEBIM for (Triggering unit) to (Integer A)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to ClanDevilPlayer
            • Then - Actions
              • Unit - Order (Triggering unit) to Attack-Move To DevilNextHedef[(Integer A)]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Equal to ClanReaperPlayer
                • Then - Actions
                  • Unit - Order (Triggering unit) to Attack-Move To ReaperNextHedef[(Integer A)]
                • Else - Actions
          • Custom script: endif

I want to order them to DevilNextHedef (for picked player 1 unit) and ReaperNextHedef (for picked player 7 unit) but i don't know how to combine these.
 
Last edited:
My aggro system is Jass and i cannot read it. I have lost my friend who send this system to me. And i have created 2 topics for the solution. People tried to help me but still it is not workingg properly.
I need this system as GUI, so i can understand and edit. Is someone can help me about that?
I've got an idea. Bit out of the box and complex, but shouldnt be too rambunctious to actually implement, I think.

What if each unit gets like a custom value attached to them that represents a threat bar as seen in WoW.
Lets say this custom value goes up by 1 point for every point of damage the unit deals, whether it's an attack, spell, splash damage, ect.
And the value decays by like 10% of its total value every second.

Then a trigger that says whenever an unit notices an enemy in range, itll scan in a radius equal to its vision radius and apply some kind of formula to pick the unit with the most threat value in comparison to its proximity from the unit (so units dont spend 90% of their time running around changing targets) and instead go for the most logical, enticing target without changing targets often.

Lets say the formula is something like (Threat value of the enemy x ((movement speed of searching unit / 270) + 100 / Range between enemy and searching unit)

Example: Blood Mage just flamestruck you and got 900 threat points, but he is 500 range away and your unit has 320 movement speed.
900 x ((320/270) + 100/500) = 1246 prioity (having faster movement speed and how far the units are apart impact the outcome)
 
Last edited:
Status
Not open for further replies.
Top