- Joined
- Jun 3, 2007
- Messages
- 14
Hello and thanks for the time you need to read and answer my question.
I'll describe first what I want to do in general, because probably you know an easier way to do it. Its a TD, and right now two factors contribute to the max. hp an incoming creep has: level and difficulty. The max. hp of a unit are set in the units propertys to the max. hp needed for the hardest difficulty, and then get reduced via trigger for lower difficuties. Of cause, this way you see creeps starting with e.g. 50% life all the time, but thats "just" something cosmetic and not my real problem. My real problem is: I want to add a third factor. Currently I do some math at first to figure out the creeps max. hp (which gets reduced by difficulty later, you know). But I know beforehand what kind of armor or special ability (both affect the max. hp) the creep will have, because actually those are determined by level. Now I want to change that and let creeps have e.g. random armor. Long story short: I need a way to calculate the max. hp in-game, because I am not really intrested in creating ~20 simliar looking creeps with different max. hp per level, just to pick one afterwards. :/
Of cause, there is a function like this:
Unit - Set life of (Last created unit) to ((Life of (Last created unit)) x Var)
And while it works great on reducing the actual hp, you cant modify the max. hp nor can you increase the actual hp over the max. hp.
For those who are intrested, I want to do it for >this< map. (Sorry if linking to (own) maps isnt allowed here, but I haven't found a rule against this)
Thanks in advance,
Isdariel
I'll describe first what I want to do in general, because probably you know an easier way to do it. Its a TD, and right now two factors contribute to the max. hp an incoming creep has: level and difficulty. The max. hp of a unit are set in the units propertys to the max. hp needed for the hardest difficulty, and then get reduced via trigger for lower difficuties. Of cause, this way you see creeps starting with e.g. 50% life all the time, but thats "just" something cosmetic and not my real problem. My real problem is: I want to add a third factor. Currently I do some math at first to figure out the creeps max. hp (which gets reduced by difficulty later, you know). But I know beforehand what kind of armor or special ability (both affect the max. hp) the creep will have, because actually those are determined by level. Now I want to change that and let creeps have e.g. random armor. Long story short: I need a way to calculate the max. hp in-game, because I am not really intrested in creating ~20 simliar looking creeps with different max. hp per level, just to pick one afterwards. :/
Of cause, there is a function like this:
Unit - Set life of (Last created unit) to ((Life of (Last created unit)) x Var)
And while it works great on reducing the actual hp, you cant modify the max. hp nor can you increase the actual hp over the max. hp.
For those who are intrested, I want to do it for >this< map. (Sorry if linking to (own) maps isnt allowed here, but I haven't found a rule against this)
Thanks in advance,
Isdariel