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

is this possible? - attack command...

Status
Not open for further replies.
Level 29
Joined
Mar 10, 2009
Messages
5,016
re-phrase question

Yes, just change the unit stats: Combats - Enabled - None

sorry man, I didnt explain very well, coz I have an attack ability using triggers and I want the attack damage in the object editor to be the same attack damage of that ability, and every time the hero levels up the attack ability damage will increase like in the object editor...sorry again :)
 
sorry man, I didnt explain very well, coz I have an attack ability using triggers and I want the attack damage in the object editor to be the same attack damage of that ability, and every time the hero levels up the attack ability damage will increase like in the object editor...sorry again :)

so you mean a custom attack skill so you want to disable the normal attack but still have the same damage? disable the normal attack and then just use a formula for your custom attack...

Hero damage =
[(Base Damage+PrimaryAttribute*MultiplierPerPrimaryAttributePoint) + NumberOfDie](this is the minimum damage if I'm not mistaken)

->

[(Base Damage+PrimaryAttribute*MultiplierPerPrimaryAttributePoint) + NumberOfDie*NumberOfSidesPerDie](this is the max damage)
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
so you mean a custom attack skill so you want to disable the normal attack but still have the same damage? disable the normal attack and then just use a formula for your custom attack...

Hero damage =
[(Base Damage+PrimaryAttribute*MultiplierPerPrimaryAttributePoint) + NumberOfDie](this is the minimum damage if I'm not mistaken)

->

[(Base Damage+PrimaryAttribute*MultiplierPerPrimaryAttributePoint) + NumberOfDie*NumberOfSidesPerDie](this is the max damage)

that's correct but how can i do that? or is it possible to just disable the 'auto attack' when enemy is near?
 
that's correct but how can i do that? or is it possible to just disable the 'auto attack' when enemy is near?

thru triggers... disable the normal attack and then use that formula to get the damage you need to deal in the trigger that your custom attack spell uses...

ex...

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • Ability being cast is equal to CustomAttack
  • Actions
    • set Damage = THE FORMULA
    • Unit - Make TriggeringUnit damage blahblahblah
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
thru triggers... disable the normal attack and then use that formula to get the damage you need to deal in the trigger that your custom attack spell uses...

ex...

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • Ability being cast is equal to CustomAttack
  • Actions
    • set Damage = THE FORMULA
    • Unit - Make TriggeringUnit damage blahblahblah

thanks man, but i cant figure it out what is the formula you mean, is it an integer variable? if I follow the numbers in the object editor (base damage & per die & multiplier, etc...), then it can never change because the numbers in triggers are constant and what if the hero levels up?
anyway i have set this trigger, but maybe there is a better formula. +rep for you though...

  • Actions
    • set Damage = ((Agility of (Casting Unit) (exclude bonuses)) + random integer between 3 and ((Agility of (Casting Unit) (exclude bonuses))
 
formula is the formula you use to calculate damage... it is not a variable... ^^

Number of die and sides per die are constant so you can set them into a variable or into a hashtable to make it MUI, then you can also set the damage per primary attribute into a variable... this could be easier if you make a function which calculates the damage for you...

and ofc, base damage is always the same, as well as NumberofDie and sides per die... the only thing that can affect the damage over game period would be the primary attribute...

  • Set Damage = Random real between [(Base Damage+PrimaryAttribute*MultiplierPerPrimaryAttributePoint) + NumberOfDie] and [(Base Damage+PrimaryAttribute*MultiplierPerPrimaryAttributePoint) + NumberOfDie*NumberOfSidesPerDie]
If you want I can make a test map for you with the example triggers. You can choose whether you want it in GUI or JASS/vJASS... I will make it with hashtables either way, but the JASS/vJASS is easier to make, and will take only one trigger/library...
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
@Adiktuz

I think we misunderstand each other, I mean is it Integer/real, etc... variable? because you are using the "SET" trigger...

Anyway, if you have time please do post a test map coz this will be very helpful not only to me but to all those who need it, I dont know JASS and hashtables, so if possible make it in GUI or whatever easy for you.

Thank you in advance. I'll see to it that you wil be credited :)
 
@Adiktuz

I think we misunderstand each other, I mean is it Integer/real, etc... variable? because you are using the "SET" trigger...

Anyway, if you have time please do post a test map coz this will be very helpful not only to me but to all those who need it, I dont know JASS and hashtables, so if possible make it in GUI or whatever easy for you.

Thank you in advance. I'll see to it that you wil be credited :)

Damage is the real variable, formula is the formula...

anyway, I must use hashtables for it, GUI or JASS... unless there is only one unit that will use this system per player...
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
Damage is the real variable, formula is the formula...

Yes, that's what I mean, I know what is a formula, I just dont know how to do what you gave.

anyway, I must use hashtables for it, GUI or JASS... unless there is only one unit that will use this system per player...

Please do, and as for me, I'll try to learn hashtables, LOL!
 
Last edited:
well, the problem with that is your formula will not work if other units have different Number of die and Sides per die and also if there are units that has primary attribute not equal to strength... well that would not be a problem if you only have one hero or two heroes with the same damage factors...

anyway, I made the sample support almost all heroes/units as possible so that if you suddenly think that you'd like to implement it on many units then it would be easy for you...

it will also be better if you always do it that way, because you'll never know when you might think to use a certain system for more units...
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
well, the problem with that is your formula will not work if other units have different Number of die and Sides per die and also if there are units that has primary attribute not equal to strength... well that would not be a problem if you only have one hero or two heroes with the same damage factors...

anyway, I made the sample support almost all heroes/units as possible so that if you suddenly think that you'd like to implement it on many units then it would be easy for you...

it will also be better if you always do it that way, because you'll never know when you might think to use a certain system for more units...

like i said, your example is very useful, im gonna use it in my maps, thanks!
 
Status
Not open for further replies.
Top