• 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.

Help with this simple problem

Status
Not open for further replies.
Level 6
Joined
Jun 20, 2012
Messages
195
I was trying to figure out an easy way to detect if a physical damage or damage from normal attacks has occurred...Now I know that the simplest way to do this is by using the Slow Poison ability, but I just wanted to find another way, and so I tried using a passive ability based on Critical Strike; first I set the critical chance to 100% then bonus damage and damage multiplier to 0, created a dummy buff based on Stun(Pause) ..Using a damage detection system I checked if the damaged unit has buff equal to the Dummy Buff then removed it immediately..as this triggers, a quest display text appears just for me to know that the damage has occurred ..Is this okay to use this method ??
 
Level 6
Joined
Nov 24, 2012
Messages
218
Well, I don't know why you need this but I see your Golem Wars map already has what is necessary to detect physical damage [Weep's GUI Damage Detection].

There are in fact 2 ways to do this.

1. Your slow poison method (or any other buff placer). The drawback is giving up the use of standard wc3 orb effects...

2. All spell damage dealt by a dummy unit/system. Upon damage detection, you can find that physical is dealt from non-dummy type unit. Everything else is damaged using dummy unit which you interpret as = spell damage. Make sense?

Problem with your methods
The only thing you can use... is a buff placer (orb effect) if you are unwilling to use other method. That will render the units involved incapable of using standard wc3 orb effects (which can be worked around using this system as well though).

Note that Weep's GUI damage detection runs just before the damage itself is actually dealt (not sure about orb placer though!).
Example: Using the system to detect damage dealt on a target with 500/500 hp,
and damage dealt was 50 (450/500) and you set life = life +50 instantly...
it will still stay 450/500 because it processed while life was still full (it tried to set it to 550/500).

To fix that you save the units involved in an mui hashtable or mui variable array and run a 0.00 timer which once expired,
will do life = life + 50, (in your case, it will check if buff/debuff is on target unit after expiring timer...).

I haven't tested btw, so if Weep's system does in fact detect the buff/debuff placement right away without need of a timer, then no timer is needed and it is really simple... you got your fix.

All in all, a dummy buff is your easiest bet... but no matter how I look at it, you will be giving up orb effects.
Also, can you create orb effect with 0 duration or must it be 0.01? If it's 0.01, I can imagine slight possible errors... but it would rarely occur.

To clarify the second method:
What we will do to detect physical vs spell is make it so all physical damage is done by any unit in the map. Spell damage however is ALL done by unit-type : Dummy Caster unit (a unit you will create to deal all your spell damage and cast all your spells!).

Here is a test map. I created Starfall and made dummy cast it. Now system can detect if damage is spell or physical in map. Of course, it will be a lot more work if you have a lot of spells.

Most spells you just have to reconfigure the damager to be the dummy unit instead of the caster.
Certain things like an immolation spell/item will need more work, eg. dummy will have perma immolation and follow caster.
 

Attachments

  • TestPhysicalSpell.w3x
    18.9 KB · Views: 42
Last edited:
Level 6
Joined
Jun 20, 2012
Messages
195
sorry man I haven't been active lately, :D
..you mean using a CRITICAL STRIKE based spell is not allowed or would cause errors ??
why and how ??

can you try this method first ? then tell me what's wrong with it..
btw I can't test your map right now cause I don't have my PC with me ..:D

still, thanks a lot ..
 
Level 6
Joined
Nov 24, 2012
Messages
218
Well, you weren't specific in the thread. If all you are trying to achieve is a floating text for physical damage, then yes critical strike works I think?

If you were trying to detect physical damage then there is no way for the damage engine to tell if a damage dealt was physical or spell even with critical. Unless somehow the critical is capable of placing a buff? o_o Then yeah that works too. Sorry for not personally testing.

Again, ur best bet is your first method, the buff placer.
It does use up orb effect though... There is another method but it needs more work.
You just make every non-physical attack (= spells) in your map casted by dummy unit.
That's if you are trying to detect physical or not in the entire map... if it's only for 1 hero, it would be much quicker. I showed example of 1 hero with 1 spell in test map, the test map hardly helps, it's just to clarify.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
as I mentioned in my post, yes, Critical Strike is capable of placing a buff...does this mean that this method would work ??

no it isnt.

just because it has a buffs field doesnt mean it applies a buff. Critical Strike is unable to apply a buff, so is Forked Lightning for example


e/ well fuck me it is... that was unexpected... bash is still a better approach because it doesnt display crit text
 
Level 6
Joined
Nov 24, 2012
Messages
218
Well, after some quick test runs, I did not manage to successfully work this out... I believe none of these options are viable.
Slow poison came very close though, maybe you could use that.

I was able to determine the following:

1. Crit spell acts just like bash the moment it gets a buff effect. Therefore they are both 1 and the same.
2. Both crit and bash make a mini-stun effect (even if instantly removed), this is very bad.
3. Slow poison worked without causing a mini-stun effect, but some things broke it. Orb related things. Example: Huntress wouldn't work until I changed her missile(bounce) attack to just missile.

This test map has everything I used to test. I left it at slow poison since it seemed like the best one to me.
Crit/bash is inside map somewhere but are not on the heroes/test units.
I gave every unit in my test map slow poison to make them compatible with detection.
The triggered starfall no longer has a purpose in this map but I left it there.
Any spell in this map will register as spell damage triggered or not.
 

Attachments

  • TestPhysicalSpell.w3x
    20.2 KB · Views: 44
Last edited:
Status
Not open for further replies.
Top