I am trying to give a player a bonus for amount of damage delt but can not seem to get Triggering damage amount to work at all
so I have two variables
damage <real>
and
converteddamage <int>
Variable - Set damage = (Triggering damage absorbed)
Variable - converteddamage = (Round(Untitled Variable 001))
Player - Modify player (Damaging player) Minerals: Add {converteddamage}
the problem here is that damage absorbed only pumps out the amount of damage taken total IE if i do 10 damage and you have 1 life, I have only done 1 damage, I have searched countless threads and forms that seem to indicate i can just use Triggering damage amount, any advice on how to get the actual damage I am dealing rather then the damage taken would be appreciated.
You could use "damaging unit" or "unit type of unit (damaging unit)" to detect who attacked then look up how much damage their attack does. It would take a fair bit of code and you will probably need variables to keep track of how much damage a unit does based on it's upgrades.
The function you want is Weapon Damage. If you use the Unit Is Attacked or Unit Is Attacking events, you can return a weapon on the attacking unit. Note that if the attacking unit has multiple weapons active at the same time it will be difficult to tell which weapon actually caused the damage using one of those events.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I am trying to give a player a bonus for amount of damage delt but can not seem to get Triggering damage amount to work at all
so I have two variables damage <real> and converteddamage <int> Variable - Set damage = (Triggering damage absorbed) Variable - converteddamage = (Round(Untitled Variable 001)) Player - Modify player (Damaging player) Minerals: Add {converteddamage}
the problem here is that damage absorbed only pumps out the amount of damage taken total IE if i do 10 damage and you have 1 life, I have only done 1 damage, I have searched countless threads and forms that seem to indicate i can just use Triggering damage amount, any advice on how to get the actual damage I am dealing rather then the damage taken would be appreciated.
You could use "damaging unit" or "unit type of unit (damaging unit)" to detect who attacked then look up how much damage their attack does. It would take a fair bit of code and you will probably need variables to keep track of how much damage a unit does based on it's upgrades.
@dakenho: Go
The function you want is Weapon Damage. If you use the Unit Is Attacked or Unit Is Attacking events, you can return a weapon on the attacking unit. Note that if the attacking unit has multiple weapons active at the same time it will be difficult to tell which weapon actually caused the damage using one of those events.