Why does this give me Compile Errors?

Battle[StFh]

New Member
Reaction score
6
Hey guys,

I wanted to start learning JASS, so I used Vexorian's "Introduction to JASS" tutorial.

I followed every step and made every trigger up myself to learn.
Everything went fine till this trigger:
Code:
function Msg takes string s returns nothing
    call DisplayTextToPlayer(Player(0),0,0, s )
endfunction

function Trig_Statements_in_Jass_Actions takes nothing returns nothing
 local integer a=GetRandomInt(1,10)
 local integer b=GetRandomInt(1,10)
    call Msg("a="+I2S(a))
    call Msg("b="+I2S(b))
    if (a>b) then
        call Msg(I2S(a)+" is the greater number")
    endif
    if b>a then
        call Msg(I2S(b)+" is the greater number")
    endif
    if (a==b) then
        call Msg("they are the same number")
    endif
endfunction

//===========================================================================
function InitTrig_Statements_in_Jass takes nothing returns nothing
    set gg_trg_Statements_in_Jass = CreateTrigger(  )
    call TriggerRegisterPlayerChatEvent( gg_trg_Statements_in_Jass, Player(0), "Statements", true )
    call TriggerAddAction( gg_trg_Statements_in_Jass, function Trig_Statements_in_Jass_Actions )
endfunction

I made it up myself, then it gave me 42 compile errors, so I copied the one made by Vexorian, and it also gave me 42 compile errors...

Anyone knows what's wrong in this trigger?

Thanks in advance,

Battle[StFh]
 
C

Capt Griffen

Guest
WHAT compile errors? Generally only the first one matters.

Are there any other functions called 'Msg'?
 

Battle[StFh]

New Member
Reaction score
6
Ehm... yes there are :p

Edit: I changed the name of the function, and now it works :)

THanks! +rep to Capt_Griffen :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top