TomTTT
New Member
- Reaction score
- 44
Editor thoughts (in other words - why the heck the tutorial is made)
Ok. So i few days ago i helped someone to create a floating text about taking amount of gold from a unit if you have an item... And i noticed the only way was to do this was by using a damage detection system that I found at last, But telling the truth, it has been mostly JASS, but you could refer to whoever needed. And i thought, why not trying to make my own GUI friendly damage detection system? So today, when I sang in the shower as usual D) i came to realisation!
The point (in other words - skip your stories and lemme see!)
Since the event,
Is triggered like half a second before the actual attack happens, you can set the life of the attacked unit in a real variable,
then wait a little while,
And then set the life of the attacked unit again, in another variable,
And with the Arithmetic option, calculate the damage dealt!
So for all those who in need of a damage detection, an easy-but-taking some-time trigger without all the JASS that the only think you know about it is it's name (and for those who don't, it's JASS, clever, right?)
So basically, the trigger is simple:
I'm pretty sure i'll get flamed for this but i just couldn't hold posting this here. I did a research and the only damage detection i found WAS made with JASS.
NOTE
Whenever i say those things about JASS i don't mean to under estimate it's power. I do realise it IS a lot more powerful than GUI, but this tutorial is meant for those (like me) who don't understand JASS.
I don't see this neccesery, since this is a one trigger system (is it called a system?) but added a demo map.
Ok. So i few days ago i helped someone to create a floating text about taking amount of gold from a unit if you have an item... And i noticed the only way was to do this was by using a damage detection system that I found at last, But telling the truth, it has been mostly JASS, but you could refer to whoever needed. And i thought, why not trying to make my own GUI friendly damage detection system? So today, when I sang in the shower as usual D) i came to realisation!
The point (in other words - skip your stories and lemme see!)
Since the event,
Trigger:
- Unit - A unit Is attacked
Is triggered like half a second before the actual attack happens, you can set the life of the attacked unit in a real variable,
Trigger:
- Set realArray[1] = (Life of (Triggering unit))
then wait a little while,
Trigger:
- Wait 0.50 seconds
And then set the life of the attacked unit again, in another variable,
Trigger:
- Set realArray[2] = (Life of (Triggering unit))
And with the Arithmetic option, calculate the damage dealt!
Trigger:
- Set realArray[3] = (realArray[1] - realArray[2])
So for all those who in need of a damage detection, an easy-but-taking some-time trigger without all the JASS that the only think you know about it is it's name (and for those who don't, it's JASS, clever, right?)
So basically, the trigger is simple:
Trigger:
- Detect
- Events
- Unit - A unit Is attacked
- Conditions
- Actions
- Set realArray[1] = (Life of (Triggering unit))
- Wait 0.50 seconds
- Set realArray[2] = (Life of (Triggering unit))
- Set realArray[3] = (realArray[1] - realArray[2])
- Events
I'm pretty sure i'll get flamed for this but i just couldn't hold posting this here. I did a research and the only damage detection i found WAS made with JASS.
NOTE
Whenever i say those things about JASS i don't mean to under estimate it's power. I do realise it IS a lot more powerful than GUI, but this tutorial is meant for those (like me) who don't understand JASS.
I don't see this neccesery, since this is a one trigger system (is it called a system?) but added a demo map.