Hello everyone!
As the title states, I'd like to be able to create functions that can be used by other functions without being forced to put them in the same trigger everytime. How is it possible? I've tried to find some info about libraries and scopes, thinking that would help, but I wasn't really successful. I would appreaciate even more if someone could post like a guide or something about libraries and scopes as I wasn't really able to find anything!
Also, I have a little question: Why is jass compiler telling me there is a syntax error here?
I was just trying to create a function that would pick units in a "circular crown" (I see in English you say annulus, lol ). but it says that there is a syntax error in the line "set UinCR = GetUnits ...", one of the last lines. I really don't understand! Probably I'm missing some knowledge about when and where you can give arguments to a condition function..
Thank you in advance for your help!
As the title states, I'd like to be able to create functions that can be used by other functions without being forced to put them in the same trigger everytime. How is it possible? I've tried to find some info about libraries and scopes, thinking that would help, but I wasn't really successful. I would appreaciate even more if someone could post like a guide or something about libraries and scopes as I wasn't really able to find anything!
Also, I have a little question: Why is jass compiler telling me there is a syntax error here?
JASS:
function GUICFilter takes location tloc, real rrmin returns boolean
if (IsUnitInRangeLoc(GetFilterUnit(), tloc, rrmin)) then
return false
endif
return true
endfunction
function GetUnitsInCrown takes location loc, real rmin, real rmax returns group
local group UinCr
set UinCr = GetUnitsInRangeOfLocMatching(rmax, loc, Condition(function GUICFilter(loc,rmin)))
return UinCr
endfunction
I was just trying to create a function that would pick units in a "circular crown" (I see in English you say annulus, lol ). but it says that there is a syntax error in the line "set UinCR = GetUnits ...", one of the last lines. I really don't understand! Probably I'm missing some knowledge about when and where you can give arguments to a condition function..
Thank you in advance for your help!