Some begining Jass Help?

C-Death

I love you
Reaction score
45
Hello, i am learning basic jass, i was wondering whats wrong with this code?


function Trig_Hero_Info_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), R2S(GetUnitFacing(gg_unit_Hpal_0000)) )
endfunction

//===========================================================================
function InitTrig_Hero_Info takes nothing returns nothing
set gg_trg_Hero_Info = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Hero_Info, Player(0), "-Hero Info", true )
call TriggerAddAction( gg_trg_Hero_Info, function Trig_Hero_Info_Actions )
endfunction


Whats wrong with that? it gives me a Fatal error?
 

emjlr3

Change can be a good thing
Reaction score
395
not real sure, however GetPlayersAll() can be simplified as

bj_FORCE_ALL_PLAYERS

my noly guess would be if thatunit does not exist it may bug
 
D

dArKzEr0

Guest
kc102: That is the trigger it works with.

Deathboy: It seems fine to me, the only thing I saw is what emjlr (the posibility of that unit not existing). Anyway, as a tip: since you're starting with JASS, try making the trigger first in GUI, make sure it works, then convert it to JASS and play with it once you're sure it worked in GUI. That'll help you learn JASS without the frustration of a messed up trigger that has nothing to do with syntax, but merely flawed logic.

Oh and it seems you would want to call "DisplayTextToPlayer" not DisplayTextToForce.

-darkz
 
General chit-chat
Help Users

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top