• 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] starting jass

Status
Not open for further replies.
Level 7
Joined
Mar 22, 2010
Messages
228
yo! i got this problem when im starting my jass...
my point is when a unit enters a region and if that unit is owned by player 1, an action will occur but...just look

JASS:
function Trig_Test2_Conditions takes nothing returns boolean
    if ( not ( GetOwningPlayer(GetTriggerUnit()) == Player(0) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Test2_Actions takes nothing returns nothing
    call DisplayTextToForce( GetPlayersAll(), "A footman!" )
endfunction

function InitTrig_Test2 takes nothing returns nothing
    set gg_trg_Test2 = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Test2, gg_rct_Region_000 )
    call TriggerAddCondition( gg_trg_Test2, Condition( function Trig_Test2_Conditions ) )
    call TriggerAddActions ( gg_trg_Test2, function Trig_Test2_Actions )
endfunction

when i test map, scirpt error pops up and says "expected a function name"...and i havent misspelled any of them..
please help...

EDIT: oh LOL! my mistake:
JASS:
call TriggerAddActions ( gg_trg_Test2, function Trig_Test2_Actions )
should be...
JASS:
call TriggerAddAction ( gg_trg_Test2, function Trig_Test2_Actions )
so dumb ^^
 
Level 6
Joined
Mar 22, 2009
Messages
276
You can optimize the condition you used into:
JASS:
function Trig_Test2_Conditions takes nothing returns boolean
    return GetOwningPlayer(GetTriggerUnit()) == Player(0)
endfunction
It will do the same thing.
 
Level 7
Joined
Mar 22, 2010
Messages
228
sorry but i just dont understand whats the meaning of that
JASS:
return
...

@Cokemonkey11
what is their difference?
iguess this is possible?
JASS:
call DisplayTextToForce( bj_FORCE_PLAYER(0), "cokemonkey11" )
 
Status
Not open for further replies.
Top