• 🏆 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!

[JASS] Why is this not correct?

Status
Not open for further replies.
Level 8
Joined
Nov 9, 2008
Messages
502
JASS:
function Trig_bla_Func001C takes nothing returns boolean
    return true
endfunction

function Trig_bla_Actions takes nothing returns nothing
    local handle gg_cam_Camera_001
    if ( GetCurrentCameraSetup() != gg_cam_Camera_001 ) then
        call CameraSetupApplyForPlayer( true, gg_cam_Camera_001, Player(0), 0 )
    endif
endfunction

//===========================================================================
function InitTrig_Untitled_bla takes nothing returns nothing
    set gg_trg_bla = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_bla, 0.02 )
    call TriggerAddAction( gg_trg_bla, function Trig_bla_Actions )
endfunction

So being a Jass newbie I simply ripped a few functions after converting them from GUI. At first I didn't know I had to declare gg_cam_Camera_001 so I did and now I get syntax error 'cannot convert handle to camerasetup' but without handle I can't compare currentcamera to camera_001.

I'm missing something fundamental, what is it?

EDIT: Also, I converted a gui trigger with only the event 'every 0.02 secs of gametime'. What has the first function got to do with anything?

FINAL EDIT: Ok I fixed it. Woot to me. Lol that first function was useless wtf??

JASS:
function Trig_bla_Actions takes nothing returns nothing
    local camerasetup g = gg_cam_Camera_001
    if ( GetCurrentCameraSetup() != g ) then
        call CameraSetupApplyForPlayer( true, g, Player(0), 0 )
    endif
endfunction

//===========================================================================
function InitTrig_bla takes nothing returns nothing
    set gg_trg_bla = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_bla, 0.01 )
    call TriggerAddAction( gg_trg_bla, function Trig_bla_Actions )
endfunction
 
Last edited:
Level 6
Joined
May 7, 2009
Messages
228
Lol that first function was useless wtf??
----------------------------------------


Most of the code created by GUI trigger editor is useless. You could easily cut down the size of the code by 50% just by doing things in JASS.
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,541
Lol that first function was useless wtf??
----------------------------------------


Most of the code created by GUI trigger editor is useless. You could easily cut down the size of the code by 50% just by doing things in JASS.

I'm pushing like 10% of the previous # of lines on my map lol
 
Status
Not open for further replies.
Top