niceeeeeeeeeeee
someone is reading my code
unfortunately, you also copyed a mistake I made
you won't need to set the tree checker unit's position to that of the tree for some reason
my bad, sorry ^^
very nice code, only some tiny things for next time
non-array-variables are like twice as fast as array-variables
and I just ran
JASS:
set udg_r = GetWidgetX(udg_u)
set udg_r = GetUnitX(udg_u)
5 million times (r is a real variable, u is a unit)
GetWidgetX took 23 seconds while
GetUnitX took 18 seconds
(stopped with my stop watch cause wc3 got frozen)
GetUnitX might be even faster since I ran it together with a function to count them
I think this is caused by typecasting from widget to unit
to check if a distance is bigger than some value it will be faster to use pythagoras directly (x,y,x2,y2,r are variables of type real)
JASS:
if (x-x2)*(x-x2)+(y-y2)*(y-y2) > r * r then
pow and sqrt are slow
you may also try to merge more arrays together (e.g. you can save booleans as reals (if x = 1 then...)) but if you paste all spell data when the map is ready it does not really matter
5/5 + rep from me
edit:
took 6 seconds while
JASS:
set udg_array[0] = udg_array[0]
took 9 seconds
and before somebody starts to complain about these data being damn inaccurate I'll do it first
THESE THINGS WERE MEASURED WITH MY PC AND COULD BE DIFFERENT FOR OTHER PEOPLE
edit2:
SetWidgetLife took 40 sec
SetUnitState(udg_u, UNIT_STATE_LIFE, 100) took the same
the BJ first broke the operation limit and after I adjusted it it broke the game after 40 seconds
(of cause I always handled the operation limit with running the trigger again after 25000 function calls (+ 5000 exitwhen, 5000 udg_i = udg_i + 1)
edit3:
local variables are as "slow" (compared to normal ones) as arrays (fuck! gonna recode some spells X)
and it appears like the game can't handle 5k trigger executions in a row
and booleans are as fast as reals