• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Aggro System and Out Of Combat System v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Important: This is only an update where I removed H2I and added GetHandleId to make it work with the new patch. The system code itself is still the old one. In the moment I'm working on a new hashtable version and I'm going to upload it as soon as possible :)
The OOC-System will be completly removed as a standalone (but it will stay in the aggro system for the aggro resett). In addition I added some new functions to get units/groups that are affected by the system.

So, these are two system that you could know if you ever played an ORPG.

Or maybe you played an RPG in Wc3 and got attacked of units just for a single hit, although the others fighted a lot more? This nasty problem can get solved :)

The first one is the "Aggro System":
- Allows the user to add "aggro" to a unit by another one (the amount of both, attackers
and attacked units is nearly unlimited)
- Compares the aggro of all attackers/casters/whatever. The highest one
will get attacked by the target
- Usefull with a damage detection system (and then add extra values to spells)

The second one is the "Out Of Combat System":
- Whenever a unit doesn't attack, doesn't get attacked, doesn't use a spell or is the target
of a spell for 10 seconds it will move back to its position and reset the aggro
- In a case that spells can remove units out of combat for more then 10 seconds
(like a stun) I would recommend to increase the time in the trigger to avoid problems

This systems require the Jass New Gen Package!

If you use it, give credits to (I mentioned it in the triggers, but who reads them?):
- PandaMine for the HSAS idea
- Dr Super Good for great help
- Me :p

Please report all bugs that you can find :)

Greets, Justify


Keywords:
combat system, combat, out of combat, attack, attacked, rpg, justify
Contents

Noch eine WARCRAFT-III-Karte (Map)

Reviews
08:09, 28th Oct 2015 This resource has been Rejected by BPower. Criticism: I can't see a development of the thread since 2009. Please re-submit it, if you wish to work again on the flaws of your system. 16:19, 24th Aug 2009...

Moderator

M

Moderator

08:09, 28th Oct 2015

This resource has been Rejected by BPower.

Criticism:
I can't see a development of the thread since 2009. Please re-submit it, if you
wish to work again on the flaws of your system.

16:19, 24th Aug 2009
hvo-busterkomo: Rejected for the lack of an in-game screenshot.
 
Level 13
Joined
Mar 16, 2008
Messages
941
I hope that the bloodmage doesn't deal to much damage xD Had the damage in the editor on 20 (20 extra damage) and it was very hard to get the aggro back from the king (after thunderclap), so I set it to 40, didn't test it afterwards.
Btw the creep won't attack you for example when the bloodmage had 1000 aggro and you get 1001, it has to reach a value 20% higher then the king, so it is easier for the guy who gets his nose broken in front to tank the boss/creep/whatever, but this can get changed :)
Oh, and I should care which maps I use... 74 kb filesize, I think there are still imports in it that has nothing to do with the systems, will remove it in a new version (if someone finds some bugs :p)
 
Level 13
Joined
Mar 16, 2008
Messages
941
Good job, but I see no point to use this, it is only in the way... sorry ;)
Any map that split the roles into tank/damage dealer/healer could need it :)

What does this system do????
I'll make an example:
Let's say, one damage is one "aggro".
The more damage you deal the more aggro you create. If your aggro reaches a critical point (20% more then the highest one) the attacked unit will start attacking you.
The best thing is, that you can also add aggro to certain spells like the thunderclap in the testmap, what allows you to stick a unit to the tank even if he deals less damage (most times the pathing is more important then the damage for warcraft, but for example ranged skills will often hit the unit dealing the most damage).
 
What does this system do????

lol you even replay to this Justify?

Adiktuz please read description!

Good job, but I see no point to use this, it is only in the way... sorry ;)

Well I don't need it as well but its good as wrote in description RPG... so its made for such a people, we both don't need it but many people do so yeah...


not bad at all and i did not know you are coding in advanced jass Justify! I always get vision about you that you are good GUI coder but seems not :D btw this are nice systems ill rate this 4.5/5 but since round(4.5) is 5 then ill rate this 5/5! o and btw +rep
 
Level 2
Joined
Dec 17, 2008
Messages
17
WE throws an error ("missing end of line", or something like that), if i try to save the map with your trigger imported...

The same, when i try to save your testmap.
 
Level 8
Joined
Dec 22, 2008
Messages
207
HAHahhaha xD

I tried to pull all the sorceresses, warcraft crashed :p hahahahxD

Fix it.



;)

EDIT:
Well I don't need it as well but its good as wrote in description RPG... so its made for such a people, we both don't need it but many people do so yeah...

I DO!!! i need it really reaaallllyyyy bad :S:S:S

So I hope u can fix this problem Justify :D And its still very very hard to get the agro back if thunderclap is cast. I would alter the agro indexing a little more evolutionary...
for example:
Mountainking: casts Thunderclap
Blood Mage: Attacks
Mountainking: Attacks
*1 second since Thunderclap*
Blood Mage: Attacks
Mountainking: Attacks
*2 seconds since Thunderclap*
Blood Mage: Attacks
Mountainking: Attacks
*3 seconds since Thunderclap*
Blood Mage: Attacks
Mountainking: Attacks
*4 seconds since Thunderclap*
Blood Mage: Attacks
Mountainking: Attacks
*5 seconds since Thunderclap*
BLOODMAGE SHOULD NOW HAVE THE HIGHEST AGRO

1/5 right now, because it crashes W3
3/5 if you fix that but not the sensitivity at which agro is retrieved from another unit.

5/5
If
- it recognizes the total spell damage and automatically adds the agro points to the indexing.
- it recognizes when a melee attacker attacks and has STR as primary atribute and counts extra agro for that unit
- it doesn't somehow lag (it doesn't ATM, but if u add all the above, it may... idk)
 
Level 13
Joined
Mar 16, 2008
Messages
941
Okay, a crash.... WHAT?
I never had any crashes with this system and I'm quite shocked o_O
I'm going to rescript this system after the patch with the new hashtable.
That you didn't got back the aggro is just because I set the thunderclap aggro value that high in a trigger.
Ok, what to add?
*Option for extra aggro from str-heros (meele detection? have to google xD)

Anything else? It already adds the total (spell-) damage :O
And could you explain your thunderclap example a bit better?
Maybe you want abilities to loose their aggro value after 5 seconds?
Or something? Dunno :/
 
Level 8
Joined
Dec 22, 2008
Messages
207
Okay, a crash.... WHAT?
I never had any crashes with this system and I'm quite shocked o_O
I'm going to rescript this system after the patch with the new hashtable.
That you didn't got back the aggro is just because I set the thunderclap aggro value that high in a trigger.
Ok, what to add?
*Option for extra aggro from str-heros (meele detection? have to google xD)

Anything else? It already adds the total (spell-) damage :O
And could you explain your thunderclap example a bit better?
Maybe you want abilities to loose their aggro value after 5 seconds?
Or something? Dunno :/

*Option for extra aggro from str-heros (meele detection? have to google xD)
What i mean with this, is that who ever is tanking would get higher agro quicker by hitting then casting spells. But then if you'd have like a ranger who would use allot of spells, then he'd go higher ofc...

*Maybe you want abilities to loose their aggro value after 5 seconds?

No forget that... what's better to do is to set the agro values for the spells higher for the tank than the ranging heroes


waiting for the new script.... ;)
 
Level 13
Joined
Mar 16, 2008
Messages
941
So, I'm finished with rescripting, at least in JassCraft.
I've totally abused the hashtable, let's see if it will works, testing in the next time.
Just a question here:
Anyone with extra wishes? Don't think that many people will
read this, but the ones who do: ask :D
At the moment there are functions to add aggro, gain the aggro value as a real, gain a group with all attackers of a chosen target, get the leading unit.
The out of combat system got implemented directly in the aggro system code and should be much exacter.
While waiting for attacks and spells before, it gets refreshed now whenever a point of aggro is added, I think that should do it. 10 seconds without extra aggro values lead to a aggro and position reset :)
 
Level 4
Joined
Dec 11, 2007
Messages
74
mhm you could add a lifereg bonus if a unit is out of combat... or a code that set's the lifereg of a unit to 0 if infight




(mhm i use the old version before 1.24 and somehow the aggro dosent reset's X.x even the attacking unit died. can you help me ? or tell me the reason)
 
Level 4
Joined
Dec 11, 2007
Messages
74
yeah holiday's =)

the problem is my map works only with 1.21 - 1.23 (i hope blizzard will bring a solution for H2I with 1.24b) so atm i cant test the new version with hastables X.x
 
Level 6
Joined
Jun 4, 2009
Messages
91
wtf ??? (OOCSystem)
JASS:
        //This method check if the given player is a) not a computer and b) playing
        static method IsPlayer takes player p returns boolean
            local boolean b = false
            local integer i = 0
        
            loop
                exitwhen i >= bj_MAX_PLAYER_SLOTS
                if p == Player(i) and GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING then
                    set b = true
                endif
                set i = i+1
            endloop
        
            return b
        endmethod
Wouldn't this be more efficient ?
JASS:
        //This method check if the given player is a) not a computer and b) playing
        static method IsPlayer takes player p returns boolean
            return GetPlayerSlotState(p) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(p) == MAP_CONTROL_USER
        endmethod

Good system anyway.

I think it can be used with my event system (watch the link in my signature), so you can trigger a custom event when a unit takes the aggro or when a unit becomes out of combat and give the library users a way to react to theses events and maybe cast special abilities or anything else.
 
Level 13
Joined
Mar 16, 2008
Messages
941
This system is very old and got written in the very early times when I learned vJass^^ didn't know MAP_CONTROL_USER. I didn't know it till now either, but it doesn't matter for the new version, this method doesn't exist anymore^^ The new version doesn't use structs at all, I tried a full hashtable version :) I bet structs would be faster, but this can be changed easily in the future :) btw, thanks :D
 
Level 1
Joined
Jan 20, 2010
Messages
3
Greetings, I just implented this system in my map and I like the concept.

There is just one major issue, just wondering if that is possible to fix by changing something in the trigger perhaps?

When you (for example) Thunder Clap, as in your test map you can, with nearby allies. The friendly units will start attacking you.
I have a co-op RPG map and when your allies are attacking you when you try to hold aggro of the enemy, it's a damage/bad case. :)

So is that fixable or a big no? Thanks.
 
Top