JASS

From WarCraft3

< wc3
Jump to: navigation, search

JASS is an API scripting syntax that can be used by those with the Warcraft III World Editor to manipulate almost every part of the game. The most commonly accepted phrase that the acronym stands for is Just Another Scripting Syntax. Almost all aspects of the game are written in JASS, including units, locations, rects, destructables, items, weather effects, special effects, and sounds. Users can also access JASS directly, by creating a trigger and using the 'Covert to Custom Text' feature in the editor. You can also place scripts in the map header.

GUI triggers are converted into JASS when the map containing them is saved in World Editor.

Basic JASS

JASS follows a simple, unique, and Turing-like syntax for functions within the script. A "Hello, World!" example function is below.

function HelloWorld takes nothing returns nothing
    call BJDebugMsg("Hello, World!")
endfunction

JASS Users can also declare variables to store memory and data, and then use them.

 function IntegerDecleration takes nothing returns nothing
     local integer index = 0
 endfunction

In JASS, users can create loops to repeat actions until a condition is met.

 function Loop takes nothing returns nothing
    local integer i = 100
    loop
        set i = i - 1
        exitwhen i == 0
    endloop
 endfunction

A comment is written using double slashes (//). Everything after a comment declaration on the same line will be ignored by the Jass compiler.

function CommentDemonstration takes nothing returns nothing
    call BJDebugMsg("Hello, World!") // Now that I have used double slashes, the rest of this line will be ignored.
// You can also start a line with a comment.
endfunction

JASS Portal

Personal tools