• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Unit - Damage Target with percentage

Status
Not open for further replies.
Level 4
Joined
Nov 7, 2010
Messages
68
Is it possible to somehow put percentage in this instead of only raw damage?


image post

So instead of 1x1, I'd like to put something like 10%

The reason I am not using thorns aura is because it only affects melee units.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
From the image you posted:

Click the 1.00 at the left side, right under the variable category there should be a function category, find "unit - percentage life",
Click the 1.00 at the right side, change it to 0.10,

at final state it should look like this.

(Percentage life of (attacking unit)) x 0.10
 
Level 12
Joined
May 20, 2009
Messages
822
Really simply you just need to multiply the damage done by the equivalent multiplier for percentage. Like if you want to REDUCE to 10%, you do x*0.10. If you want to ADD 10%, you do x*1.10.

No need for a DDS.

If you need a more dynamic percentage, like say you want to plug in the percentage whenever you want, you'll need a small function that will determine which of two formulas to use. One will be for reducing and one will be for multiplying. So say you want to plug in 50% where it's adding 50% extra damage, you just need to do 50/100+1. If you want to reduce by 50%, you have another one where you DON'T have the +1. This way, you can have a variable set the percentage you want to use whenever you want dynamically.
 
Level 4
Joined
Nov 7, 2010
Messages
68
From the image you posted:

Click the 1.00 at the left side, right under the variable category there should be a function category, find "unit - percentage life",
Click the 1.00 at the right side, change it to 0.10,

at final state it should look like this.

(Percentage life of (attacking unit)) x 0.10

This is the simplest and most useful solution to my problem. Thank you.

And, sorry if I didn't make myself clear enough, I wanted units to lose X% of their life points when they attack a certain unit. Not to be reduced to X%.

Sorry for double post but I have another question:
Is it possible to make it so that you can not cancel your attack when you attack unit? The problem is that this trigger triggers as soon as you right click the unit (to attack it) and attacking unit takes that damage even before it fired the missile (depends on unit's animation) which lets you cancel it, if you want.
This is a minor and basically non-existent problem concerning my case, but in some other case it might cause some problems.
The question is: Is it possible to fix that without making DDS? ( Probably not but I'm asking anyways :D )
 
Last edited by a moderator:
Level 24
Joined
Aug 1, 2013
Messages
4,657
Use a DDS or Basic Attack Simulator.

If you want to be unable to cancel your attacks (for example to be used by a taunt), you can only do that using a proper Basic Attack Simulator.
However in this case, it is not that recommended to make you unable to cancel it.

So yes it is possible without DDS (something that I dont use in maps that I make), but you require something even more powerfull than that and my Basic Attack Simulator requires a proper stat system.
 
Status
Not open for further replies.
Top