[JASS] A Little Help Here

Status
Not open for further replies.
JASS:
function Trig_jass_Actions takes nothing returns nothing
    CreateUnitAtLoc( Player(0) , ABOMINATION , GetRectCenter(GetPlayableMapRect()) , 0.00 )
endfunction

//===========================================================================
function InitTrig_jass takes nothing returns nothing
    set gg_trg_jass = CreateTrigger(  )
    call TriggerRegisterPlayerEvent( gg_trg_jass,Player(0),EndCinematicScene)
    call TriggerAddAction( gg_trg_jass, function Trig_jass_Actions )
endfunction

Every time I save the map I get errors, whats wrong with the codes ?
 
in your function "Trig_jass_Actions" it appears you want to call the CreateUnitAtLoc function, but you forgot to use "call"

change line 2 to:
JASS:
call CreateUnitAtLoc( Player(0) , ABOMINATION , GetRectCenter(GetPlayableMapRect()) , 0.00 )
 
Ok. I changed the script to:

JASS:
function Trig_jass_Actions takes nothing returns nothing
    call CreateUnit( Player(0) , 'uabo' , 0.00 , 0.00 , 0.00 )
endfunction

//===========================================================================
function InitTrig_jass takes nothing returns nothing
    set gg_trg_jass = CreateTrigger(  )
    call TriggerRegisterPlayerEvent( gg_trg_jass , Player(0) , EndCinematicScene())
    call TriggerAddAction( gg_trg_jass, function Trig_jass_Actions() )
endfunction

But I still get error in the line:

JASS:
call TriggerAddAction( gg_trg_jass, function Trig_jass_Actions() )

The error: Invalid argument type (void)
 
Get rid of those parenthesis, when a parameter for a function is code(another function) you don't use parenthesis.. I'm not good at explaining what I'm trying to say i guess, so I'll just show you:

Change
JASS:
call TriggerAddAction( gg_trg_jass, function Trig_jass_Actions() )

to:
JASS:
call TriggerAddAction( gg_trg_jass, function Trig_jass_Actions)
 
Many times the syntax check will say the error is in one line, while it's actually in the next. Your problem is in your Event Registration. EndCinematicScene() is not an event..

change:
JASS:
call TriggerRegisterPlayerEvent( gg_trg_jass , Player(0) , EndCinematicScene())
to:
JASS:
call TriggerRegisterPlayerEvent( gg_trg_jass , Player(0) , EVENT_PLAYER_END_CINEMATIC)
 
Status
Not open for further replies.
Back
Top