• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Function needs endif? Something is wrong

Status
Not open for further replies.
Level 14
Joined
Jul 1, 2008
Messages
1,314
Hey Guys,
i wrote a trigger in jass, that isnst working. It always tells me, that it needs an endif in function DestructableFinder. The whole function is marked as wrong multiple times. Sometimes he wants a name.

udg_Spielheld and the other globals are defined at map init.

Here:
JASS:
function DestructableConditions takes destructable Temp nothing returns boolean
    // Baum Vergleich
    if GetDestructableTypeId(Temp) == 'B00F' or GetDestructableTypeId(Temp) == 'B00G' or GetDestructableTypeId(Temp) == 'B00E' then
         return true
    endif
    return false
endfunction

function DestructableFinder takes nothing returns nothing
        local destructable Temp = GetEnumDestructable()
        if DestructableConditions(Temp) then
             // wenn kein baum da ist, dann tu nichts
             set Temp = null
        endif
             if Temp == null then
                   set udg_Kamera_Hw_CurrentCam = 0
                   set udg_Kamera_3rdCam_Display = true
                   set udg_Kamera_Lockon = true
                   set udg_Kamera_Static = false
             else
                   set udg_Kamera_3rdCam_Display = false
                   set udg_Kamera_Lockon = true
                   set udg_Kamera_Static = false
                   set udg_Kamera_Hw_CurrentCam = 23
             endif
        // Debug-Msg
        call DisplayTextToForce(GetPlayersAll(),GetDestructableName(Temp))
        set Temp = null
endfunction

function Trig_Kamera_Wald_System_Actions takes nothing returns nothing
    local location L = GetUnitLoc(udg_Spielheld)
    // //=============================================================================
    // KameraZoom im Wald, radius = 300, Bäume = Waldbaum 1-3
    // //=============================================================================
    call EnumDestructablesInCircleBJ(300.00,L, function DestructableFinder)
    call RemoveLocation(L)
    set L = null
endfunction

//===========================================================================
function InitTrig_Kamera_Wald_System takes nothing returns nothing
    set gg_trg_Kamera_Wald_System = CreateTrigger(  )
    call DisableTrigger( gg_trg_Kamera_Wald_System )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Kamera_Wald_System, Player(0) )
    call TriggerAddAction( gg_trg_Kamera_Wald_System, function Trig_Kamera_Wald_System_Actions )
endfunction

Please help me, would be so great :thumbs_up:

Btw: German Comments, i know :p

Edit: JassCraft sometimes says, there is a syntax Error in Line
JASS:
call EnumDestructablesInCircleBJ(300.00,L, function DestructableFinder)
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
hm i was not sure about that, as its the trigger itsself, thats not working. The Jass is not the problem, its the logic in there, i cant find the wrong systax....

Maybe someone can help? Perhaps insert it in JassCraft? ;)

Greets

Edit: sry, didnt know what to do, when a jass trigger is not working ^^. Can someone please help anyways? :)
 
Status
Not open for further replies.
Top