|
|
|
|
 |
|
This resource is not available
|
08-18-2012, 10:22 AM
|
#2 (permalink)
|
|
I don't care.
Join Date: Jun 2008
Posts: 2,769
|
If a user modifies the gameplay constant the system will break tho.
You should mention that.
Jass:
constant real INV = Pow(2,32)
Why not use a calculator and just put the direct value in here? Pow is really a heavy function call.
Edit:
2^32 = 4294967296
__________________
Apheraz Lucent and -Grendel will forever live in my memory, two extraordinary persons taken away from our world before their time.
And so i dedicate my signature to them, a small sign of memory that will forever remain on my profile, for as long as it exists.
I am sad it's all i can do for them now and i hope i never did something to bring them anything but joy in their life.
World is a cruel place, but it was a better place with both of you in it. Miss you both.
|
|
|
08-18-2012, 03:28 PM
|
#3 (permalink)
|
|
JESUS MAN
Resource Moderator
Join Date: Dec 2008
Posts: 5,702
|
I forgot to mention the following points in my review:
- Pow(2, 32) is both inefficient, and overflows. Pow(2, 31) - 1 is the greatest integer you can have in Wc3 since it's a 32-bit application.
If you want higher numbers, use reals, but I doubt that's what you want.
- Don't use BJs. (The red-colored functions)
- Don't use GUI systems for vJASS systems.
- Don't put systems inside scopes.
- Use only libraries for systems.
- You should add configurable constants to the system because currently, this system will only work for the default ones.
|
|
|
08-18-2012, 04:01 PM
|
#4 (permalink)
|
|
User
Join Date: Apr 2012
Posts: 986
|
you could set hp of the unit we are going to inspect to max, dmg it and set it back that way you wont kill it unless it has very low health as base
__________________
[22-00-51] Geries: edo494, no
[22-00-57] Geries: edo494, but I'm gay
|
|
|
08-18-2012, 04:15 PM
|
#5 (permalink)
|
|
bot
Join Date: Jul 2011
Posts: 958
|
updated everything except the damage engine and indexer i cant find a better system so that's why i kept it, it should not be problematic as it is coded mostly in jass.
Last edited by gorillabull; 08-19-2012 at 07:07 AM.
|
|
|
08-19-2012, 12:19 PM
|
#6 (permalink)
|
|
User
Join Date: Apr 2012
Posts: 986
|
In function GetReduction you have to null the unit before returning value or you will leak.
Also your typing is quite odd, why do you tab on every set in the second function, you should tab only after if, loop or function/method/library/scope/module header, also all calls should be in one line(same spaces), it should look like
Jass:
function GetType takes nothing returns integer
local unit u = null
local real r = 0.
set r = GetUnitX(u)
call BJDebugMsg("Hello")
call SetUnitY(u, r+r*r)
if r < 500. then
set r = 500+r
endif
set u = null
endfunction
- this is example, also the free lines are not needed but its nothing bad
This is optional but also instead of armor_amount you could name it armorAmount(camelCase), its standard here on the hive
__________________
[22-00-51] Geries: edo494, no
[22-00-57] Geries: edo494, but I'm gay
|
|
|
08-19-2012, 12:47 PM
|
#7 (permalink)
|
|
bot
Join Date: Jul 2011
Posts: 958
|
Quote:
Originally Posted by edo494
In function GetReduction you have to null the unit before returning value or you will leak.
|
hmmm i didnt know that included user defined globals too, if its a local it will leak but the global carries the value until it is re assigned
also camel case is great and so are one word variables i must have skipped that one
|
|
|
08-19-2012, 02:37 PM
|
#8 (permalink)
|
|
User
Join Date: Apr 2012
Posts: 986
|
well, you have local unit u in GetReduction and you dont even use it so its useless :D
but about the globals you are right you dont need null globals
__________________
[22-00-51] Geries: edo494, no
[22-00-57] Geries: edo494, but I'm gay
|
|
|
08-19-2012, 06:52 PM
|
#9 (permalink)
|
|
TimeToRapeYou
Join Date: Apr 2011
Posts: 33
|
why do you need this when you already can click on the armor of the hero and tell you everything you need to know...?
|
|
|
08-19-2012, 11:32 PM
|
#10 (permalink)
|
|
bot
Join Date: Jul 2011
Posts: 958
|
i will give a few examples.
this system is meant to be used with a damage detection system or dds, with a dds you have great control over every damage amount dealt on your map, dds allows you to trigger spells, say you want your hero to do a fraction of his intelligence , create new damage types even detect what damage is dealt. With this system you can now get the armor stats, even though you can see them on the armor tooltip, it is not possible to utilize them efficiently. for example you want to code a spell which bypasses all armor damage resistances and multiplyers, it is not very practical when the spell is cast to have to look at the target's armor and have to enter those values manually the armor type can be used to set dynamic resistances of any armors
|
|
|
08-20-2012, 03:55 AM
|
#11 (permalink)
|
|
JESUS MAN
Resource Moderator
Join Date: Dec 2008
Posts: 5,702
|
UnitIndexer and DamageEvent by Nestharus are the better alternatives.
They can be found in the JASS section of this site.
(Not the Spells section, the Spells section's standards are relatively low)
|
|
|
08-20-2012, 04:43 AM
|
#12 (permalink)
|
|
bot
Join Date: Jul 2011
Posts: 958
|
updated uses Nestharus' systems
Last edited by gorillabull; 08-21-2012 at 09:26 AM.
|
|
|
08-21-2012, 06:45 PM
|
#13 (permalink)
|
|
Heavy drinker.
Join Date: Dec 2005
Posts: 524
|
Tag.
|
|
|
08-31-2012, 04:22 AM
|
#14 (permalink)
|
|
bot
Join Date: Jul 2011
Posts: 958
|
damn haha ok i guess i have to learn a few more things
Last edited by gorillabull; 09-18-2012 at 06:26 PM.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 05:59 AM.
|