View Full Version : Detect Armor/Magic Armor?
12-02-2011, 02:16 AM
Howdy y'all, basically whenever I try to make a new hero, at some point down the line he trips out and loses his attack (right click does move to, instead of attack).
Anyone else getting this problem? Seems quite random so I'm guessing it's to do with the hero.entity or his projectile, even though I've scanned through them both thoroughly I can't seem to iron it out.
12-02-2011, 02:28 AM
Cod-flabbit Oloko already answered this hahaha, for anyone else with the problem, load your map twice. ><
12-02-2011, 03:43 AM
Oh actually, one more thing :)))
is there any way to calculate if the target has more Magic Armor than Armor?
<compare a="target_armor" b="target_magic_armor" (also tried target_magicarmor) op="lt">
but no dice, would there be a way to do it with setting variables first? or is there no current way to find the target's armor and magic armor in the engine?
Basically trying to make a passive that detects which armor the target has most of, and swapping his attack type to the opposite, so having high armor the passive would use magic damage :>
12-02-2011, 08:04 AM
or is there no current way to find the target's armor and magic armor in the engine?
I'm afraid this is true, at least direct values :(
But you may try to fake it with:
<damage amount="1" effecttype="Physical"/>
<damage amount="1" effecttype="Magic"/>
<compare a="var0" b="result" op="le">
Later just just deal 2 less damage, there shouldn't be much damage oscillation (around 1 in very extreme event)
TBH I feel quite rusted in scripting here so test it (at least) twice :P
12-02-2011, 08:35 AM
Tojooko I believe you're a genius!
Couldn't I just use 0.1 damage however? Torturor's Impalement deals damage that's not a whole number, so I suppose it would work fine.
Edit: Just realised what this code does, hahaha nevermind about the 0.1!
12-02-2011, 08:51 AM
Thanks Tojy! Worked like a charm (:
12-02-2011, 12:17 PM
And about 0.1, it should work too and in theory better :P (But every autoattack generates more random damage than this code with damage 1)
You can join #honscience at IRC if you have any more problems ;)
12-03-2011, 04:19 AM
what's that? D: hahaha