• 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.

[JASS] A Little Help Here

Status
Not open for further replies.
Level 16
Joined
Mar 3, 2006
Messages
1,564
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 ?
 
Level 7
Joined
Oct 14, 2008
Messages
340
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 )
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
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)
 
Level 7
Joined
Oct 14, 2008
Messages
340
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)
 
Level 7
Joined
Oct 14, 2008
Messages
340
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.
Top