Syntax Checker gives me wierd errors

D.V.D

Make a wish
Reaction score
73
Well, I started making some spells from DBZ for some guy and when I was making the Big Bang Attack, the syntax checker keeps giving me weird errors.
Code:
JASS:

function Trig_Untitled_Trigger_001_Func002C takes nothing returns boolean
    if ( not ( DistanceBetweenPoints(GetUnitLoc(GetTriggerUnit()), GetSpellTargetLoc()) == 0.00 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Big_Bang_Attack_Actions takes nothing returns nothing
    local unit Caster = GetTriggerUnit()
    local location array p
    local location TargetPoint = GetSpellTargetLoc()
    local trigger t = CreateTrigger()
        call PauseUnitBJ(true, Caster)
        call SetUnitAnimation( Caster, "attack" )
        call TriggerSleepAction( 0.70 )
        call SetUnitTimeScalePercent( Caster, 0.00 )
        set p[0] = GetUnitLoc(Caster)
        call CreateNUnitsAtLoc( 1, 'h004', GetOwningPlayer(Caster), PolarProjectionBJ(p[0]), 100.00,Angle , Angle )
        set udg_Dummy[0] = GetLastCreatedUnit()
        call PauseUnitBJ( true, udg_Dummy[0] )
        call TriggerSleepAction( 0.50 )
        set p[1] = GetUnitLoc(udg_Dummy[0])
        call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(Caster), p[1]), Angle )
        set udg_Dummy[1] = GetLastCreatedUnit()
        call PauseUnitBJ( true, udg_Dummy[1] )
        call SetUnitPositionLocFacingBJ( udg_Dummy[1], p[1], Angle )
        call TriggerAddAction(t, function Slide)
endfunction

function Slide takes nothing returns nothing
    local unit Caster = GetTriggerUnit()
    local real Angle = GetUnitFacingLoc(Caster)
    local trigger t = CreateTrigger()
    local location array p
    set p[0] = GetUnitLoc(Caster)
    call SetUnitPositionLocFacingBJ( udg_Dummy[0], PolarProjectionBJ(p[0]), 9.00, 0), Angle )
        if ( Trig_Untitled_Trigger_001_Func002C() ) then
             call TriggerAddAction(t, function Explosion)
        else
        endif
endfunction

function Explosion takes nothing returns nothing
    local unit Caster = GetTriggerUnit()
    local real Angle = GetUnitFacingLoc(Caster)
    local integer Damage0 = GetHeroStatBJ(bj_HEROSTAT_INT, Caster, true)
    local real Damage = I2R(Damage0)
    local location array p
    local unit array Dummy
    set p[0] = GetUnitLoc(Caster
    call CreateNUnitsAtLocFacingLocBJ( 1, 'h005', GetOwningPlayer(Caster), p[0]), p[0]) )
    set Dummy[3] = GetLastCreatedUnit()
    call KillUnit( udg_Dummy[0] )
    call KillUnit( udg_Dummy[1] )
    set p[1] = GetUnitLoc(Dummy[3]
    call UnitDamagePointLoc( Caster, 0, 500, p[1]), Damage, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL )
    call SleepTriggerAction( 1.00)
    call KillUnit(Dummy[3])
endfunction

//===========================================================================
function InitTrig_Big_Bang_Attack takes nothing returns nothing
    set gg_trg_Big_Bang_Attack = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Big_Bang_Attack, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Big_Bang_Attack, Condition( function Trig_Big_Bang_Attack_Conditions ) )
    call TriggerAddAction( gg_trg_Big_Bang_Attack, function Trig_Big_Bang_Attack_Actions )
endfunction


For the first create unit, it says invalid number of arguments, the trigger can't read the global variable dummy and it thinks that all the function names I made aren't real(Expects a name). Can someone help? Map is below and if you have the time, look at burning attack in the map, the unit doesn't slide.
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
You can only call functions that are above the function you are callling them from.

Example:

Correct

JASS:
function Slide takes nothing returns nothing
...
endfunction

function Actions takes nothing returns nothing
    call Slide()
endfunction


Incorrect

JASS:
function Actions takes nothing returns nothing
    call Slide()
endfunction

function Slide takes nothing returns nothing
...
endfunction
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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