Compile Error

Shaggi

New Member
Reaction score
1
I did a skill in wich flames fall at random position at regular interval. The trigger is supposed to work since the editor doesn't disable it. But since I did it, I got compile error even with triggers I don't know where the hell they come from. I wan't to know if you can find something that would explain that problem.

function Trig_Flame_Rain_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A03C'
endfunction

function Range_Cond_1 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false )
endfunction

function Range_Cond_2 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction

function Range_Cond takes nothing returns boolean
return GetBooleanAnd( Range_Cond_1(), Range_Cond_2() )
endfunction

function Flame_Rain_Damage takes nothing returns nothing
call UnitDamageTargetBJ( GetTriggerUnit(), GetEnumUnit(), 15.00 * I2R(GetUnitAbilityLevelSwapped('A03C', GetTriggerUnit())), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE)
endfunction

function Flame_Rain_Range takes nothing returns nothing
set udg_FlameRain_Random = GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(GetTriggerUnit()), 500.00, 500.00))
call AddSpecialEffectLocBJ( udg_FlameRain_Random, "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
call ForGroupBJ( GetUnitsInRangeOfLocMatching( 150.00, udg_FlameRain_Random, Condition(function Range_Cond)), function Flame_Rain_Damage )
call RemoveLocation (udg_FlameRain_Random)
endfunction

function Trig_Flame_Rain_Actions takes nothing returns nothing
local real lrDuration = (5.00 + (2.00 * I2R(GetUnitAbilityLevelSwapped('A03C', GetTriggerUnit()))))
local timer ltTimer = CreateTimer()
set udg_FlameRain_Location = GetUnitLoc(GetTriggerUnit())
call TimerStart( ltTimer, 0.25, true, function Flame_Rain_Range )
call PolledWait( lrDuration )
call DestroyTimer( ltTimer )
call RemoveLocation( udg_FlameRain_Location )
endfunction

//===========================================================================
function InitTrig_Flame_Rain takes nothing returns nothing
set gg_trg_Flame_Rain = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Flame_Rain, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Flame_Rain, Condition( function Trig_Flame_Rain_Conditions ) )
call TriggerAddAction( gg_trg_Flame_Rain, function Trig_Flame_Rain_Actions )
endfunction

when I delete it all works perfectly so I think that's the problem.
 

Exide

I am amazingly focused right now!
Reaction score
448
I can't see anything wrong with it..
Maybe if you optimized it, so it was easier to read, we would find out why it's not working properly?

Only thing I can think of is that you created a trigger, named it something, converted it to JASS and then copied this code into that trigger - so that your trigger has a different name..
-That sounds farfetched, though. :p
 
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