Hello, I would like to ask several questions, as the are concernig on theme.
At first I should introduce you the whole problem. I wanted something to happen when a unit is damaged by an attack of another unit. I did something like this:
1) I save via hashtable unit damage point (thats what should be the time between the point when a unit starts attacking and when it actually deals damage) to each unit.
2) When some unit attacks, I save its damage point in hashtable (with the Key being the same unit) and each 0.02 sec decrease it by 0.02. This way i create some kind of pseudo-timer. The action i want to happen when the attacking unit deals damage starts when this trigger reaches zero.
3) If the unit which is attacking is ordered to do anything else than to attack the unit it is already attacking (coz if you order a unit to attack a unit it is already attacking, it will continue rather than start a new attack), the process will be stopped.
My questions:
1) Mabye I got it wrong and the damage point is used for something else. Please tell me if I am right or wrong.
2) My triggers do not work properly. For example if I have a dreadlord (the undead vampire-like hero), I have to set the triggered damage point to be about 0.1 sec shorter than what is set in the Object Editor (I mean: In Object Editor there is 0.55 damage point, but my triggers have to count with about 0.45). The reason for this is, that if I don't make the change, the events when the dreadlord deals damage and when my pseudo-timer countdown ends are not synchronized (the attacked unit is damaged before the trigger triggers). Could you give me some help? I would like to know whats wrong.
3) Another solution would by some other type of timer attached to each unit. I have tried to do so, but could't find a useful event. (I have tried to use timer with array, but i will probably need some more help, coz I failed)
One last word. Please don't tell me to use the Damage detection system. I maybe end with using it, but before I do so, I want to do it on my own.
Edit: New question: Does anyone know the equation how attack speed influences the damage point?
At first I should introduce you the whole problem. I wanted something to happen when a unit is damaged by an attack of another unit. I did something like this:
1) I save via hashtable unit damage point (thats what should be the time between the point when a unit starts attacking and when it actually deals damage) to each unit.
2) When some unit attacks, I save its damage point in hashtable (with the Key being the same unit) and each 0.02 sec decrease it by 0.02. This way i create some kind of pseudo-timer. The action i want to happen when the attacking unit deals damage starts when this trigger reaches zero.
3) If the unit which is attacking is ordered to do anything else than to attack the unit it is already attacking (coz if you order a unit to attack a unit it is already attacking, it will continue rather than start a new attack), the process will be stopped.
My questions:
1) Mabye I got it wrong and the damage point is used for something else. Please tell me if I am right or wrong.
2) My triggers do not work properly. For example if I have a dreadlord (the undead vampire-like hero), I have to set the triggered damage point to be about 0.1 sec shorter than what is set in the Object Editor (I mean: In Object Editor there is 0.55 damage point, but my triggers have to count with about 0.45). The reason for this is, that if I don't make the change, the events when the dreadlord deals damage and when my pseudo-timer countdown ends are not synchronized (the attacked unit is damaged before the trigger triggers). Could you give me some help? I would like to know whats wrong.
3) Another solution would by some other type of timer attached to each unit. I have tried to do so, but could't find a useful event. (I have tried to use timer with array, but i will probably need some more help, coz I failed)
One last word. Please don't tell me to use the Damage detection system. I maybe end with using it, but before I do so, I want to do it on my own.
Edit: New question: Does anyone know the equation how attack speed influences the damage point?
Last edited: