[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
I'm back :D
 
Mr_Bean's Avatar
 
Join Date: Feb 2011
Posts: 1,802
Mr_Bean is just really nice (339)Mr_Bean is just really nice (339)Mr_Bean is just really nice (339)
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.
__________________
Familiar With: C, C++, C#, Java, HTML, JavaScript, CSS, PHP, SQL

My Spells: Prediction | Energy Fissure | Shattering Frost | Polarisation
My Systems: Respawn System
Mr_Bean is offline  
Old 04-17-2012, 12:11 AM   #2 (permalink)
Registered User Arhowk
Pleased to Meet You
 
Arhowk's Avatar
 
Join Date: Aug 2007
Posts: 2,641
Arhowk is a jewel in the rough (258)Arhowk is a jewel in the rough (258)Arhowk is a jewel in the rough (258)Arhowk is a jewel in the rough (258)
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
__________________
Looking for something to do? Signup for dropbox with this link to help me get space!
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: 5,632
PurgeandFire has a reputation beyond repute (2022)PurgeandFire has a reputation beyond repute (2022)PurgeandFire has a reputation beyond repute (2022)PurgeandFire has a reputation beyond repute (2022)
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 online now  
Old 04-17-2012, 08:25 AM   #4 (permalink)
Registered User Mr_Bean
I'm back :D
 
Mr_Bean's Avatar
 
Join Date: Feb 2011
Posts: 1,802
Mr_Bean is just really nice (339)Mr_Bean is just really nice (339)Mr_Bean is just really nice (339)
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.
__________________
Familiar With: C, C++, C#, Java, HTML, JavaScript, CSS, PHP, SQL

My Spells: Prediction | Energy Fissure | Shattering Frost | Polarisation
My Systems: Respawn System
Mr_Bean is offline  
Old 04-17-2012, 11:49 AM   #5 (permalink)
Registered User Arhowk
Pleased to Meet You
 
Arhowk's Avatar
 
Join Date: Aug 2007
Posts: 2,641
Arhowk is a jewel in the rough (258)Arhowk is a jewel in the rough (258)Arhowk is a jewel in the rough (258)Arhowk is a jewel in the rough (258)
Go to 11
__________________
Looking for something to do? Signup for dropbox with this link to help me get space!
Arhowk is offline  
Old 04-17-2012, 02:28 PM   #6 (permalink)
Registered User Magtheridon96
~ Join The Daily Peon ~
 
Magtheridon96's Avatar
 
Join Date: Dec 2008
Posts: 6,298
Magtheridon96 has a reputation beyond repute (2193)Magtheridon96 has a reputation beyond repute (2193)Magtheridon96 has a reputation beyond repute (2193)Magtheridon96 has a reputation beyond repute (2193)Magtheridon96 has a reputation beyond repute (2193)Magtheridon96 has a reputation beyond repute (2193)
Former Staff Member: This user used to be on the Hive Workshop staff. Merit Badge - Level 1: Great Assistant: Offers the best solution to other users, when all hope fades. Under the shell of assistance, lies a powerful knowledge in the fields. 
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 ;)
__________________
Are you good at 2D animation? You wanna make $ good money $?
PM me.
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 07:20 AM.




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