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

Triggered Attack-Type Comparison

Status
Not open for further replies.
Level 35
Joined
Feb 5, 2009
Messages
4,561
Okay, so I wanted to make a system using GUI that checks the attack type of an attacking unit and checks what unit is being attacked in order to customize armor type advantages/disadvantages individually for each unit. However, there seems to be no possibly way to check and compare the attack type of a unit. Does anyone know how to do this?
 
Level 9
Joined
Oct 22, 2006
Messages
599

1)

Hmmm... You could create a system using Stats - Point Value with each armor - attack type combination having different values.
e.g. Attack: Normal, Armor: Hero, Point Value: 40
Attack: Pierce, Armor: Hero, Point Value: 42
e.t.c. (the numbers I used were random)


After that you'll have to check the Point Value of the attacker and the attacked to determine the damage dealt/taken. Complicated but it works....

2)

You could also use Unit Group Variables, again for each combination of attack - armor and add units in the correct variable each time it's created/trained or enters map. Although Unit Groups leak so I wouldn't recommend this way.
 
Level 35
Joined
Feb 5, 2009
Messages
4,561
That raises an interesting point, I could set each unit with a set attack type to a certain integer or variable... that would most certainly work, thx for the tip, Vegil =D

I'm now thinking that if I initialize each units into their suited variables or something of the likes based on what their attack is, I could set each unit to receive certain amounts of damage from the unit themselves and not necessarily their attack type.

The basic idea of the whole thing, btw, was that I wanted to do something like Age of Mythology in terms of each unit is classified with 3 defense types: Hack, Slash and Pierce. Basically, Hacking attacks were your basic Siege attacks, Slash are like normal attacks in Warcraft, and Pierce is like... well, Pierce. So, while 2 units may have the same role, 1 may be slightly better at defending one of their weaknesses than the other unit.

For example:
UNIT 1: Defense: Hack 39%, Slash 24%, Pierce 64%
UNIT 2: Defense: Hack 39%, Slash 30%, Pierce 60%

So, while unit 1 is weaker to the Slash attack type than unit 2, it is also slightly better at defending against Pierce attacks. This system would allow for each unit to be more precise at taking damage against certain attack types.
 
Status
Not open for further replies.
Top