View Full Version : Detect Armor/Magic Armor?
Nytemair
12-02-2011, 01: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.
Nytemair
12-02-2011, 01:28 AM
Cod-flabbit Oloko already answered this hahaha, for anyone else with the problem, load your map twice. ><
Nytemair
12-02-2011, 02:43 AM
Oh actually, one more thing :)))
is there any way to calculate if the target has more Magic Armor than Armor?
tried doing
<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 :>
tojooko
12-02-2011, 07: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"/>
<setvar0 a="result"/>
<damage amount="1" effecttype="Magic"/>
<compare a="var0" b="result" op="le">
...
</compare>
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
Nytemair
12-02-2011, 07: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.
Thankkkksss :D
Edit: Just realised what this code does, hahaha nevermind about the 0.1!
Nytemair
12-02-2011, 07:51 AM
Thanks Tojy! Worked like a charm (:
tojooko
12-02-2011, 11:17 AM
Nice :)
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 ;)
Nytemair
12-03-2011, 03:19 AM
what's that? D: hahaha