Is there a way to set the damage of a unit or a spell into a variable? because I would like to know how to do this for my GUI Critical strike spell Attempt. Thank you for any information given on this Variable.
you cannot get the damage a unit is dealing with an attack. at least not easy and effective, there is one way but i wouldnt recommend it especially not to a newbie.
What exactly do you mean in your post canons200? What i want exactly is that when a unit learns the ability it stores them in a variable then every 0.01 seconds of game time after when they attack it will check what the attack damage of that unit stored in that variable is and then cause the attacking unit to damage the attacked unit for the the attacking units Base damage+Bonuses x the multiplier set for that level of the spell and also play an attack animation.
P.S I can post an example of my current trigger if i need to
So basically i just need to know how to store the attack damage of a unit or unit variable into a real or integer or some kind of variable.
P.S.S Thank you for any help on this complicated subject:thup::thup:
You need a damage dection system. And you would have to distinguish between regular attack damage and your spell damage. Your trigger would look something like this:
Event
- GDD_Damage Equal to 0
Conditions
- GDD_DamageSource Equal to [your unit]
- [any other conditions you want]
Actions
- Set Temp_Damage = GDD_Damage
Now your Temp_Damage Real variable will track the current damage dealt to a unit.
/@ Kalder : well, I used a very complicated variable setting on a map ^_^
You will need 4 Variables with array.
1 Unit - Type variable
5 Integer Variable (Damage Base, Number of Dice, Sides per die, Minimum Damage, Maximum Damage)
You will set this on the map init.
Trigger:
Set Unit-Type [1] = Peasant
Set Damage_Base [1] = (Damage base of the unit)
Set Number_of_Dice [1] = (Number of Dice of the unit)
Set Sides_Per_Die [1] = (Sides per die of the unit)
You will need to set this for every unit type you will do.
Then do the rest. You'll need common sense <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue :p" loading="lazy" data-shortname=":p" />
Set DMG = ((Max life of (Attacked unit)) - (Life of (Attacked unit)))
EDITMG is a real!
Then just
event - unit is attacked
condition - the unit who has critical
action - set DMG
"Create floating text at attacked unit showing "Value Of DMG""
@Gwafu: Yes there is an event like that. That's why he needs a damage detection system. His work will be 20 times easier once he gets it. Your system is WAY more complicated than it needs to be.
@Kalder: Go here, download the system, and follow the instructions to implement it into your map. The damage detection system is meant for the exact thing you need.
Once you have implemented the system in your map, make a new trigger that will look like this:
Trigger:
Events
GDD_Event Equal to 0.00
Conditions
GDD_DamageSource Equal to [your unit]
Actions
Set Temp_Damage [a Real variable] = GDD_Damage
Game - Display to (all players) the text: ((integer)Temp_Damage)
I did that freehand, so it may not be exact, but its close.
The trigger will display the damage you dealt to the unit, and you can store that damage in variables to manipulate as you want.
@CAPLOCKSFTW, Gwafu, tommerbob:Thx! but i like tommerbob's idea the most (sorry other's ) . And i have heard about GDD before and it seems like it works so tommerbob thx! and thx others and +rep ( tommerbob )
Ghan has said he has fixed this. Monovertex please confirm this fix. This was only a problem with people that had signatures in the upper levels like not the special members but the respected members.