• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Jass Trigger help

Status
Not open for further replies.
Level 7
Joined
Oct 8, 2008
Messages
200
Everything works intil the where the loop is suppose to begin
JASS:
function Trig_C4_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A005' 

endfunction

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

function Trig_C4_Func014002003002001 takes nothing returns boolean
    return ( IsUnitDeadBJ(GetFilterUnit()) == false )
endfunction

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

function Trig_C4_Func014002003002002002 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_FLYING) == false )
endfunction

function Trig_C4_Func014002003002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_C4_Func014002003002002001(), Trig_C4_Func014002003002002002() )
endfunction

function Trig_C4_Func014002003002 takes nothing returns boolean
    return GetBooleanAnd( Trig_C4_Func014002003002001(), Trig_C4_Func014002003002002() )
endfunction

function Trig_C4_Func014002003 takes nothing returns boolean
    return GetBooleanAnd( Trig_C4_Func014002003001(), Trig_C4_Func014002003002() )
endfunction

function Trig_C4_Func015002 takes nothing returns nothing
    call UnitDamageTargetBJ(e, GetEnumUnit(), 15.00, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction

function Trig_C4_Func016002 takes nothing returns nothing
    call PlaySoundBJ( gg_snd_BoatMissileHit )
endfunction

globals
unit e
endglobals

function Trig_C4_Actions takes nothing returns nothing
local location a
local location b
local unit c
local group d
local integer f = 0
    set a = GetUnitLoc(GetTriggerUnit())
    call CreateNUnitsAtLoc( 1, 'h007', GetOwningPlayer(GetTriggerUnit()), a, 266.83 )
    set c = GetLastCreatedUnit()
    set b = GetUnitLoc(GetTriggerUnit())
    call SetUnitTimeScalePercent( c, 80.00 )
    call SetUnitAnimation( c, "spell four" )
    call TriggerSleepAction( 2.00 )
    call RemoveUnit( c )
    call SetUnitInvulnerable( GetTriggerUnit(), false )
    call CreateNUnitsAtLoc( 1, 'h006', GetOwningPlayer(GetTriggerUnit()), b, 266.83 )
    set e = GetLastCreatedUnit()
    call SetUnitInvulnerable( e, true )
    call SetUnitVertexColorBJ( e, 100, 100, 100, 80.00 )
    loop
    exitwhen f == 20
    set d = GetUnitsInRangeOfLocMatching(800.00, b, Condition(function Trig_C4_Func014002003))
    call ForGroupBJ( d, function Trig_C4_Func015002 )
    call ForGroupBJ( d, function Trig_C4_Func016002 )
    call DestroyGroup (d)
    set f =(f +1)
    call TriggerSleepAction(3.00)
    endloop
    call RemoveLocation (a)
    call RemoveLocation (b)
    set d = null
    set a = null
    set b = null
    set c = null
    set e = null
endfunction

//===========================================================================
function InitTrig_C4_Copy_4 takes nothing returns nothing
    local trigger C4 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( C4, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( C4, Condition( function Trig_C4_Conditions ) )
    call TriggerAddAction( C4, function Trig_C4_Actions )
    set C4 = null
endfunction
 
Level 7
Joined
Oct 8, 2008
Messages
200
Ok I think I found the problem its the loop I don't know why but it won't start the loop because I tried it without the loop by repeating the loop part over and over.. and over.. anyways can anyone explain to me why the loop won't loop or start
 
Status
Not open for further replies.
Top