• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Real/Integer for armor

Status
Not open for further replies.

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Armor are not accessible via trigger editor without using a complicated script or memory hack, as far as I remember of.
Would it be possible to damage the unit with physical damage, using a DDS, calculating the reduction and reverting the units health. I tried it once using Bribe's damage engine and it worked really nice, but there are obviously some downsides to it. A damage event will be fired, which usually would not happen, so you have to make sure, that it does no conflict with other triggers.
Some abilities (mana shield, spirit link, spiked carrapace, ...) do not work with this method, but I think you could design your map, so that it still works.
The problem though is, that it's not reliable, because it won't work with etheral units for example.

I guess calculating armor from upgrades/buffs/items/abilities/base armor could work, but it requires a lot of work to store all this data.
 

EdgeOfChaos

E

EdgeOfChaos

It is possible with a damage detection system and using armor formula. It's just a lot more involved than a simple getArmor

Algorithm:
1) Remember unit's HP
2) Set unit to full HP
3) Deal 1 damage with chaos type damage
4) Measure unit's hp difference
5) Set to old HP
6) Calculate armor based on armor formula and damage taken based on percent of 1
 
Level 4
Joined
Jun 29, 2014
Messages
27
I was already trying to create a system, but no success. I tried your idea but I got stuck in the "4) Measure unit's hp difference" then I don't know what I did that crashed the game. Would be asking a lot if you could send a print or something showing of how this trigger should be?
 
Status
Not open for further replies.
Top