• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Detect Physical Damage

Status
Not open for further replies.

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Hi guys. I know this is an old issue but after reading almost all of the old threads, I think the old solution cannot help me.
As u see in the title, I want to know how to detect the Physical Damage. Someone tell me the most easiest way is to make an ability base on orb of corruption and give it to all units. However, since Orb of Corruption is an orb effect and it would override or be overridden by other orb effect abilities (which are very often in my map) so I cant do this way. If anyone know a better way to deal with this, plz help me.
Thks.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
The orb detection works this way that the orb converts the attack and applies the ability's buff just before the unit takes damage event. So the target unit gets checked for the buff --> yes, it is physical and the buff gets immediately removed again. As you have stated, there can always only be one orb effect alternating the attack at a time, only one ability/buff will be applied. You may check for any of the buffs in question. If any exists, remove it and consider it as physical.

Orbs do not work for splash btw and granting them to artillery type attacking units will even crash the game.
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Oh. I understand now. However, there is some abilities that is orb effect but doesnt palce a buff on the target (lifesteal, orb of lighting, ...) so I cant do that way >.<.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
That I have asked for. Cant you change them to realize their effects via trigger?

edit: The orb of lightning (new) and those you can set a customized effect ability for do not work properly btw. They are not triggered when the unit has not an explicit attack/smart order, when the the unit chooses a target to attack itself.
 
Level 19
Joined
Feb 25, 2009
Messages
2,004
You can use the passive poison ability, as it is not count as a orb-effect and again works as one since its buff is applied as WaterKnight stated, upon the hit.

But I'm not sure if you'd be able to use the "Frost Attack" ability, since it does practicually the same, but I think you'll be fine if you use the stacking poison type ability.
 
These 2 abils will detect all attacks

AIob
Afrb

One is frost attack and the other is frozen breath

Issues - can cause perma slow on units (even though the buff is immediately removed)
If both abilities are added, the frost attack will cause the game to crash when artillery units attack via artillery attack
If both abilities are added, missile units will no longer be able to attack

The old Advanced Damage Event used these 2 abilities to differentiate between physical and magical attacks. Using these two abilities is the only way to accomplish this short of going full custom combat.

http://www.hiveworkshop.com/forums/jass-resources-412/snippet-lua_dummy_physical_ability-187239/
http://www.hiveworkshop.com/forums/graveyard-418/extension-advanced-damage-event-187241/
 

sentrywiz

S

sentrywiz

Cannot be done. No wait... it can be done, but its pure torment just to make it work. And yes, you'd need some indicators you need to create for yourself in order to differentiate between damage types.

This is a common problem why can't you detect spell damage. One solution is to give units buffs and then check if dying unit has that buff or not. That way you can "hallucinate" around that a spell killed the unit. But then again, you can't determine which spell was it. You'd need to make indicators of each possible spell, or at worst, a spell with a buff. If you have a couple of heroes/units, it can be done. But if you have 10+, it becomes a nightmare.

Its same for attacks. You need buffs or indicators (variables) that a unit is going to be hit by an attack or has been damaged by an attack. The two differ but the indicators are the same.

Use Orb Effect for any debuff spells like Slow, Curse, Unholy Frenzy etc.
Use Berserk or Channel modified for self-buff.
Use dummy units to cast modified buff spells.

Or use the triggers to set booleans and integers. An example would be Damage[1] is physical, Damage[2] is spell, where Damage[X] is an integer array variable. On attack, set Damage[Player number of attacking/casting unit] to 1. On spell, make it 2. Remove each damage variable every X seconds to avoid getting it stuck.


Or just give up and make a melee map. This is the best solution :3
 
Use Orb Effect for any debuff spells like Slow, Curse, Unholy Frenzy etc.
Using any random buff won't detect all attack types (missile, artillery, instant)

Or use the triggers to set booleans and integers. An example would be Damage[1] is physical, Damage[2] is spell, where Damage[X] is an integer array variable. On attack, set Damage[Player number of attacking/casting unit] to 1. On spell, make it 2. Remove each damage variable every X seconds to avoid getting it stuck.
Yea, that won't work at all.. did you forget evasion and curse?

This is a common problem why can't you detect spell damage. One solution is to give units buffs and then check if dying unit has that buff or not. That way you can "hallucinate" around that a spell killed the unit. But then again, you can't determine which spell was it. You'd need to make indicators of each possible spell, or at worst, a spell with a buff. If you have a couple of heroes/units, it can be done. But if you have 10+, it becomes a nightmare.
Won't work. There are only so many buff types. It's better to just do the spell via code, then you know which spell hit : P.
 

sentrywiz

S

sentrywiz

@Nestharus

Attack types have nothing to do with it? The way the unit shoots projectiles or animates a sword/axe/tree to face, has nothing to do with damage types. You may mean about the timing the projectile has to deal damage. That yes, must be taken into account when coding damage detection for all attack types.

Evasion and Curse yeah, it won't work if you use those. I forgot to add that you must avoid any evasion, hit chance % modifiers like the plague if you do.

You can code the spell and know its that spell - but how will the damage detection? You have to indicate to it, that this was the spell that dealt the damage, not something else. And yes you are correct, there aren't enough buff types to put for all the spells you can come up with and use.
 
Attack types have nothing to do with it? The way the unit shoots projectiles or animates a sword/axe/tree to face, has nothing to do with damage types. You may mean about the timing the projectile has to deal damage. That yes, must be taken into account when coding damage detection for all attack types.

Yes they do... buffs are not applied depending on the attack type. For example, Frozen Breath only works with artillery and Frost Attack only works with attacks that aren't artillery, which is why I recommended those 2 =). Poison I believe didn't work with certain types of missile attacks, which is why that one was avoided.

I already did all of the work on figuring out which buffs were perfect for melee : (. I tested them all out. Don't remember why I didn't pick poison though.
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
Or just give up and make a melee map. This is the best solution :3
Nah. If I cant make the Physic Damage detection, I just need to change the spell. And that is what I'm planning to do now since all of u guy's suggestion wont fit with my map. But thks for all ur help. I cant give rep now, sorry.
 

sentrywiz

S

sentrywiz

Nah. If I cant make the Physic Damage detection, I just need to change the spell. And that is what I'm planning to do now since all of u guy's suggestion wont fit with my map. But thks for all ur help. I cant give rep now, sorry.

Was just kidding.

Continue with your map, but be aware of the limitations. In wc3 editor, there are many. But I still prefer it than the sc2 editor, because it doesn't have the same mojo like starcraft II has.

Nestharus has the logic tied to how to make it, take my texts as problems you might come across.
 
Status
Not open for further replies.
Top