Login
Register
Menu
Home
Forum
JassDoc
Types
Functions
Variables
Help
Chat
Media
Search
Search posts
WC3 JASS.com
"The Jass Vault" plus vJASS and Zinc
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Triggers & Scripting
WC3JASS.com
Jass Tutorials
[Jass 101] - Statements & Structure
Warcraft III:
Maps
Models
Skins
Icons
Spells / Systems
Tools
Tutorials
Snippets
JASS vJASS Spells and Systems
Tutorials
Chat @Discord
vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation
-
Zinc documentation
-
WC3 Optimizer documentation
[Jass 101] - Statements & Structure
Jass Tutorials
Started by
moyack
Views
12490
Replies
2
Users
2
2
1
Pages:
1
Go Down
0 Members and 1 Guest are viewing this topic.
moyack
Site Owner
Administrator
Posts:
971
WC3 Models: 20
WC3 Tutorials: 17
WC3 Tools: 19
WC3 Maps: 12
WC3 Skins: 0
WC3 Icons: 1
WC3 Spells: 16
Reputation:
1153
Site Admin - I love fix things
[Jass 101] - Statements & Structure
on:
February 11, 2013, 09:31:10 PM
Remembering the previous tutorial we were ready to start coding. In fact we revealed what's inside those GUI blocks ans we saw they were just functions. Now it's time to understand the structure and how we should write.
When the code in the map is armed in the *.j file, it will condense the code in this way:
Code: jass
//Global section
globals
//here you'll find all the global variables in the map
endglobals
//End of the Global section
//Function section: here you will find all the functions that will manage the map.
//...
function
bla1
takes
...
returns
...
// here will be a bunch of functions
endfunction
function
bla2
takes
...
returns
...
// and more functions... :D
endfunction
//... and more functions ... :)
function
main
takes
nothing
returns
nothing
// Here's the main initial function
endfunction
In JASS the function's order is very important in the sense that any function required by another function must be over the caller one. Here's an example:
Incorrect
Correct
Code: jass
function
Caller
takes
nothing
returns
nothing
// some code...
call
Called()
// More code...
endfunction
function
Called
takes
nothing
returns
nothing
// Do some stuff...
endfunction
Code: jass
function
Called
takes
nothing
returns
nothing
// Do some stuff...
endfunction
function
Caller
takes
nothing
returns
nothing
// some code...
call
Called()
// More code...
endfunction
to be continued...
«
Last Edit: July 23, 2013, 08:03:03 AM by moyack
»
WC3 Modding Information Center
SonofJay
Your Awesome Site Director
Recognized User
Posts:
381
WC3 Models: 0
WC3 Tutorials: 0
WC3 Tools: 0
WC3 Maps: 0
WC3 Skins: 0
WC3 Icons: 0
WC3 Spells: 0
Reputation:
677
[Jass 101] - Statements & Structure
Reply #1 on:
February 14, 2013, 12:15:20 AM
Awww, please teach us more on the next tutorial. Or maybe me? lol
Chronicles of Darkness
by: SonofJay
A BlizzMod Hosted Project
They can hate, let them hate, make them hate.
moyack
Site Owner
Administrator
Posts:
971
WC3 Models: 20
WC3 Tutorials: 17
WC3 Tools: 19
WC3 Maps: 12
WC3 Skins: 0
WC3 Icons: 1
WC3 Spells: 16
Reputation:
1153
Site Admin - I love fix things
[Jass 101] - Statements & Structure
Reply #2 on:
February 14, 2013, 07:36:47 AM
I'm on it... this weekend I'll continue with this part.
WC3 Modding Information Center
Print
Pages:
1
Go Up
« previous
next »
WC3 Modding Information Center
Forum
Warcraft (WC3) Modding
Triggers & Scripting
WC3JASS.com
Jass Tutorials
[Jass 101] - Statements & Structure
Suggested Topics
How to make a Campaign AI
Started by
moyack
Replies: 1
Views: 29331
Jass Tutorials
Faux HandleVars & CSCache
Started by
Vexorian
Replies: 0
Views: 2124
Codes & Snippets
vJASS Syntax Highlighter for notepad++
Started by
moyack
Replies: 2
Views: 6324
WC3 Editing Tools
Jassdoc introduction
Started by
moyack
Replies: 3
Views: 4325
Jassdoc
The Jass NewGen Pack (JNGP) 2.0
Started by
moyack
Replies: 225
Views: 318184
WC3 Editing Tools
PortaMx-SEF 1.54
|
PortaMx © 2008-2015
,
PortaMx corp.
Search
Username
Password
Always stay logged in
Forgot your password?