Ok, I thought I was doing well in learning Jass, until I've reached to the point that i wanted to convert something like this:
Following the lead of a tutorial, I've created this:
Yet, after reading several posts about how FirstOfGroup can be buggy and how ForGroup is faster in most cases, i've tried to find out more about ForGroup. But then again, there is boolexpr as callback which sound promising...After several hours, I've ended up more confused than ever...
According to Vexorian, there are ways to deal with this by Dynamic Arrays(???), without creating groups?!? What?/How?
I've tried to examine Jass spells but that confused me even more with scary codes like "antileak function" which does nothing but returns true.
At the moment and for the last 3 days, I'm totally stuck.
Can someone please direct me to a helpful tutorial or anything that includes examples? If there was an example of each usage, I think I could try and figure out the rest, or at least ask questions that point somewhere specific.
All those posts refer to everything as if the reader has deep knowledge or at least a decent background knowledge. Well, I'm a total newbie and I found myself very close in giving up.
All I want to replicate is codes like the first GUI line I've posted.
Thanks for taking the time to read.-
Code:
Set Temp_Group = (Units within 512.00 of Temp_Point matching (Several conditions))
Following the lead of a tutorial, I've created this:
Code:
set i=0
loop
set i=i+1
exitwhen i==6
set g = GetUnitsInRangeOfLocAll(500.00, o)
loop
set u1 = FirstOfGroup(g)
exitwhen u1==null
if (IsUnitAlly(u1, GetOwningPlayer(u))!=true or GetOwningPlayer(u1) == Player(PLAYER_NEUTRAL_PASSIVE)) and GetUnitState(u1, UNIT_STATE_LIFE) > 0 and IsUnitType(u1, UNIT_TYPE_UNDEAD) != true then
call GroupRemoveUnit(g,u1)
if IsUnitType (u1, UNIT_TYPE_STRUCTURE) == true then
set r=500
else
set r=( 700+(GetUnitStateSwap(UNIT_STATE_MAX_LIFE, u1) * 0.03 ))
endif
call DisplayTextToPlayer( Player(0),0,0, R2S(r) )
call UnitDamageTargetBJ( u, u1, r, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNKNOWN )
else
call GroupRemoveUnit(g,u1)
endif
endloop
Yet, after reading several posts about how FirstOfGroup can be buggy and how ForGroup is faster in most cases, i've tried to find out more about ForGroup. But then again, there is boolexpr as callback which sound promising...After several hours, I've ended up more confused than ever...
According to Vexorian, there are ways to deal with this by Dynamic Arrays(???), without creating groups?!? What?/How?
I've tried to examine Jass spells but that confused me even more with scary codes like "antileak function" which does nothing but returns true.
At the moment and for the last 3 days, I'm totally stuck.
Can someone please direct me to a helpful tutorial or anything that includes examples? If there was an example of each usage, I think I could try and figure out the rest, or at least ask questions that point somewhere specific.
All those posts refer to everything as if the reader has deep knowledge or at least a decent background knowledge. Well, I'm a total newbie and I found myself very close in giving up.
All I want to replicate is codes like the first GUI line I've posted.
Thanks for taking the time to read.-