HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Getting unit stats with trigger

07-16-2004, 02:18 PM#1
desty
Is there a way to get for example the dammage and defense of a unit with triggers?

I can't find a way, but it would be very useful for my battle system.

thanks,

DeSty
07-16-2004, 02:59 PM#2
johnfn
No direct way. Theoretically you could have the unit attack X amount of times and take the average amount of damage, but that would take some time.

At least, thats what I think. Feel free to correct me if I'm wrong.
07-16-2004, 09:25 PM#3
Vexorian
no way at all, you need to use point values for that
07-17-2004, 11:54 PM#4
BuRnInSpartan
if you mean to increase the damage and armor you need to use WEU
07-18-2004, 01:16 AM#5
username2f
Quote:
Originally Posted by BuRnInSpartan
if you mean to increase the damage and armor you need to use WEU
he wants to access the armor value, damage, attack speed etc of the unit

theres no way to do this really

if you wanted to be cool you could do this via unitnumbers (think thats what they are called, each unit can have a number attached to it, an int value) youd need to first find out all the values that you wanted to store, develop a system for storing them and then make it work ^^

so in short no, not worth it
if you _must_ have this tho its doable i guess :D
07-18-2004, 01:40 AM#6
R3N3G4D3
The easiest way is point values (Lord Vexorian already mentioned it), it can be up to 1,000,000,000. That's 9 digits for you, you could use the first 6 to store damage, and the last 3 to store defense or some other way, 9 digits should be more than enough. There are other, more complicated ways, like setting up minimum dmg same as maximum, and taking the damage done to attacked unit, but then damage reduction stuff from armor type and defense amount kicks in. You could also set unit's initial damage and defense to a fixed value for all units that you know, and then modify it through upgrades or abilities, then figure out the damage from amount of abilities/upgrades used. But the easiest way is by storing it in point value, 3 digits for defense is enough for 99% damage reduction, and 6 digits for attack is up to 999,999 damage.
07-18-2004, 03:02 PM#7
desty
thanks for these replies! I like the idea of storing the dammage in the custom value. Only downside is I have to set the dammages for the units via triggers, but this should do.

thanks

DeSty
07-19-2004, 12:44 AM#8
R3N3G4D3
if you store in custom value you will have to put it through triggers for each unit individually, if you store it in point value you just put it there once in object editor and use triggers to access it.