JASS Beginner

N582114

New Member
Reaction score
2
I've dedicated myself to learning JASS, so here I am.

My first question is the error with JassCraft. This my first JASS code.

JASS:
function Trig_Message_Actions takes nothing returns nothing
      local string a="ROFL"
      call DisplayTextToForce( GetPlayersAll(), a )
endfunction

//===========================================================================
function InitTrig_Message takes nothing returns nothing
    set gg_trg_Message = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Message, function Trig_Message_Actions )
endfunction


In JassCraft, "set gg_trg_Message = CreateTrigger ( )" is an invalid syntax. Is there another way to set the trigger?
 

Sevion

The DIY Ninja
Reaction score
413
It's not invalid. It's just that JASSCraft doesn't know that that variable is valid.
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
Having an extra jass-highlighting window open on the side is not a bad thing, but TESH is decent enough that you might as well use it as your primary window for editing. I sometimes have JSP open on the side because it's a clean window that can help maintain organization when code is being slapchopped about.

However, you do need to learn what understands what as what. That trigger var exists by default because the editor creates a trigger variable titled like that whenever you have a "trigger" window in the trigger editor. So a trigger titled "Thing" will corresponding have a trigger variable titled "gg_trg_Thing" created upon map compilation.

JassCraft does not know that the trigger window "Message" exists, so it doesn't know that gg_trg_Message exists as a valid variable unless you tell it that it exists via a global block such as:
JASS:
globals
trigger gg_trg_Message
endglobals



Anyway, since NewGen reads vJass, and knows everything about the map, you might as well use it primarily for code syntax checking.
 

tooltiperror

Super Moderator
Reaction score
231
On the note of coding in NewGen, note that you need to save to get JassHelper to check the code, it's useless to use syntax checker if you're using vJASS.

On the topic of NewGen, make sure you learn vJASS.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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