[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > Triggers & Scripts


Triggers & Scripts In this forum you may ask for help on fixing a trigger or script. But if you need help getting started with a trigger, this is not the right place — use the World Editor Help Zone.

Closed Thread
 
Thread Tools
Old 04-16-2012, 08:21 PM   #1 (permalink)
Registered User Mr_Bean
Exams are here :(
 
Mr_Bean's Avatar
 
Join Date: Feb 2011
Posts: 1,693
Mr_Bean is just really nice (302)Mr_Bean is just really nice (302)
Techtree Contest #7 - Winner: The Ancients and The Old One: The incarnation of the World Tree as a Super Unit commences the tides of battle. Nature has found its most precious avenger! A race by Lordkoon & Mr_Bean987. 
Best Way to Get Armour?

Hi guys,

I am making spells which depend on how much armour the caster has. What would be the best way to determine this? I read this post (http://www.hiveworkshop.com/forums/w...ion-gui-197760). However, in the UI of the hero it says armour is 8, but when tested with this snippet, it says the armour is 15,something.

Any ideas? Thanks.
__________________


My Spells: Prediction (new!) | Energy Fissure (updated!) | Shattering Frost (updated!) | Polarisation
My Systems: Respawn System (soon to be updated!)
Mr_Bean is offline  
Old 04-17-2012, 12:11 AM   #2 (permalink)
Registered User Arhowk
User
 
Arhowk's Avatar
 
Join Date: Aug 2007
Posts: 2,298
Arhowk is a jewel in the rough (191)Arhowk is a jewel in the rough (191)
first, theres no snippet in that post as far as i can tell.

anyway, idk, this might work
Jass:
function GetUnitArmor takes unit u returns real
local real hp = GetUnitState(u, UNIT_STATE_LIFE)
local real damage
call UnitDamageTarget( u, u, 10.0, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
set damage = hp - GetUnitState(u, UNIT_STATE_LIFE)
call SetUnitState(u, UNIT_STATE_LIFE, hp)
if damage > 10.0 then
set damage = 20.0 - damage
return (damage-10.0)/(damage*0.06)
endif
return (10.0-damage)/(damage*0.06)
endfunction

just remmeber the constants are correct
Arhowk is offline  
Old 04-17-2012, 12:28 AM   #3 (permalink)
Forum Moderator PurgeandFire
ʕ•͡ᴥ•ʔ
 
PurgeandFire's Avatar
Resource & Tutorial Moderator
 
Join Date: Nov 2006
Posts: 3,665
PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)PurgeandFire has much of which to be proud (1144)
You can study this script (or use it) to get accurate armor detection:
http://www.wc3c.net/showthread.php?t=105849

Make sure that your armor reduction multiplier constant isn't changed. (in game constants or whatever)
PurgeandFire is offline  
Old 04-17-2012, 08:25 AM   #4 (permalink)
Registered User Mr_Bean
Exams are here :(
 
Mr_Bean's Avatar
 
Join Date: Feb 2011
Posts: 1,693
Mr_Bean is just really nice (302)Mr_Bean is just really nice (302)
Techtree Contest #7 - Winner: The Ancients and The Old One: The incarnation of the World Tree as a Super Unit commences the tides of battle. Nature has found its most precious avenger! A race by Lordkoon & Mr_Bean987. 
Thanks guys! I will try them when I get back home.

@Arhowk: I was referring to post #3 in that topic that I linked.
__________________


My Spells: Prediction (new!) | Energy Fissure (updated!) | Shattering Frost (updated!) | Polarisation
My Systems: Respawn System (soon to be updated!)
Mr_Bean is offline  
Old 04-17-2012, 11:49 AM   #5 (permalink)
Registered User Arhowk
User
 
Arhowk's Avatar
 
Join Date: Aug 2007
Posts: 2,298
Arhowk is a jewel in the rough (191)Arhowk is a jewel in the rough (191)
Go to 11
Arhowk is offline  
Old 04-17-2012, 02:28 PM   #6 (permalink)
Forum Moderator Magtheridon96
Go away.
 
Magtheridon96's Avatar
Resource Moderator
 
Join Date: Dec 2008
Posts: 5,752
Magtheridon96 has a brilliant future (1891)Magtheridon96 has a brilliant future (1891)Magtheridon96 has a brilliant future (1891)Magtheridon96 has a brilliant future (1891)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. 
http://www.thehelper.net/forums/show...p/168282-Armor

This is the best system for that.
I use it, and I only use high quality systems ;)
__________________
Magtheridon96 is offline  
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


All times are GMT. The time now is 06:11 PM.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle