Syntax Error?

simonake

New Member
Reaction score
72
I try to save my Jass spell but it doesn't work, why?
JASS:
//==========================================================================
function C takes nothing returns boolean
 return GetSpellAbilityId() == 'A000'
endfunction
//==========================================================================
function CG takes nothing returns boolean
 return if ( IsUnitAlly( caster, gowner) == TRUE)
 endif
endfunction
//==========================================================================
function InDaGroup takesnothing returns nothing

if (function CG()) then
else
endif


  
endfunction
//==========================================================================
function A takes nothing returns nothing

local unit caster == GetTriggerUnit()
local location casterloc = GetUnitLoc( caster )
local unit genum
local unit cre
local player = gowner = GetOwningPlayer( caster )

 call ForGroupBJ(GetUnitsInRangeOfLocAll( 500, catserloc, function InDaGroup )

endfunction
//===========================================================================
function InitTrig_Vigority takes nothing returns nothing
    set gg_trg_Vigority = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Vigority, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( gg_trg_Vigority, function C )
endfunction
 

WolfieeifloW

WEHZ Helper
Reaction score
372
JASS:
function InDaGroup takesnothing returns nothing

Look carefully.

Also:
JASS:
function CG takes nothing returns boolean
 return if ( IsUnitAlly( caster, gowner) == TRUE)
 endif
endfunction

Locals can't be carried to other functions.

And actually:
JASS:
function CG takes nothing returns boolean
 return if ( IsUnitAlly( caster, gowner) == TRUE)
 endif
endfunction

Should be:
JASS:
function CG takes nothing returns boolean
 return IsUnitAlly(GetTriggerUnit(), GetOwningPlayer(GetTriggerUnit())
endfunction


And shouldn't:
JASS:
call TriggerAddAction( gg_trg_Vigority, function C )

Be:
JASS:
call TriggerAddAction( gg_trg_Vigority, function A )

?


EDIT:
And
JASS:
call ForGroupBJ(GetUnitsInRangeOfLocAll( 500, catserloc, function InDaGroup )

Should be:
JASS:
call ForGroupBJ(GetUnitsInRangeOfLocAll( 500, casterloc, function InDaGroup )

And then also become:
JASS:
call ForGroupBJ(GetUnitsInRangeOfLocAll( 500, casterloc), function InDaGroup )


Did you even try to fix your code before asking for help :rolleyes: .
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top