Lots of compile errors but I don't seem to see them

Nina

New Member
Reaction score
8
Hello all, I'm making a system that allows normal units to gain experience and get ranks however I'm getting quite some compile errors and I don't see 'em:S
I think it might be because 1 missplaced ) but I looked at it 100's of times and I can't seem to find it. So I'm hoping any of you can help me^.^

Here's my trigger:

JASS:

function Trig_UES_Conditions takes nothing returns boolean
    return(( GetUnitAbilityLevel(GetKillingUnit(), 'A008') > 0 )And(GetUnitAbilityLevel(GetKillingUnit(), 'A008') < 95)And(IsPlayerEnemy(GetOwningPlayer(GetKillingUnit()),GetOwningPlayer(GetDyingUnit())))) 
endfunction

function Trig_UES_Actions takes nothing returns nothing
    set udg_KillingUnit = GetKillingUnit()
    set udg_DyingUnit = GetTriggerUnit()
    set udg_KillingUnitLife = R2I(GetUnitState(udg_KillingUnit, UNIT_STATE_MAX_LIFE ))
    set udg_DyingUnitLife = R2I(GetUnitState(udg_DyingUnit, UNIT_STATE_MAX_LIFE ))     
    if(udg_DyingUnitLife >= udg_KillingUnitLife)then
        if((udg_DyingUnitLife / udg_KillingUnitLife) > 5) then
            set udg_UnitExperience = (GetUnitAbilityLevel(udg_KillingUnit, 'A008') + 8)
        else
            set udg_UnitExperience = ((udg_DyingUnitLife / udg_KillingUnitLife) + (GetUnitAbilityLevel(udg_KillingUnit, 'A008') + 2))
        endif
    else
        if((udg_KillingUnitLife / udg_DyingUnitLife) > 3)then
            set udg_UnitExperience = (GetUnitAbilityLevel(udg_KillingUnit, 'A008') + 3)
        else
            set udg_UnitExperience = (GetUnitAbilityLevel(udg_KillingUnit, 'A008') + 4)
        endif
    endif
    call SetUnitAbilityLevel(udg_KillingUnit, 'A008', udg_UnitExperience)
    if((udg_UnitExperience >= 9)And(udg_UnitExperience <= 23))then
        if(GetUnitAbilityLevel(udg_KillingUnit, 'A009') > 0)   then
        else
            call UnitAddAbility(udg_KillingUnit, 'A009')
        endif
    else
        if((udg_UnitExperience >= 24)And(udg_UnitExperience <= 44))then
            if(GetUnitAbilityLevel(udg_KillingUnit, 'A00A') > 0)    then
            else
                call UnitRemoveAbility(udg_KillingUnit, 'A009')
                call UnitAddAbility(udg_KillingUnit, 'A00A')
            endif
        else
            if(UnitExperience >= 45)  then
                if(GetUnitAbilityLevel(udg_KillingUnit, 'A00B') > 0)  then
                else
                    call UnitRemoveAbility(udg_KillingUnit, 'A00A')
                    call UnitAddAbility(udg_KillingUnit, 'A00B')
                endif
            endif
        endif
    endif
endfunction

//===========================================================================
function InitTrig_UES takes nothing returns nothing
    set gg_trg_UES = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_UES, EVENT_PLAYER_UNIT_DEATH )
    call TriggerAddCondition( gg_trg_UES, Condition( function Trig_UES_Conditions ) )
    call TriggerAddAction( gg_trg_UES, function Trig_UES_Actions )
endfunction


The errors are alot of expected ) and expected endif
 

Nina

New Member
Reaction score
8
oh ok I'll try the and whenever I typed and JassCraft made it And automatic

EDIT: Thanks for the help seems the And was causing all the trouble and at one spot I also put UnitExperience instead of udg_UnitExperience
 
Reaction score
456
That's because And is a function name too. You can probably get rid of that by removing "And" and "Or" functions from the.. common.j or blizzard.j in the Jass Craft folder.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top