Warcraft III: MapsModelsSkinsIconsSpellsToolsTutorials
WC3 JASS: Code SnippetsJASS and vJASS Spells and SystemsJass Tutorials
Chat @Discord

Author Topic: JASS 101 Main Index  (Read 18303 times)

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 977
  • WC3 Models: 59
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 12
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 6
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
JASS 101 Main Index
« on: May 19, 2012, 03:07:42 PM »
JASS 101 Tutorial
A well organized tutorial with a lot of working examples and source code.



Hello WC3 Modders and Jassers:

Here I'll start a new big tutorial about jass. The idea is to develop an as big as possible and comprehensive documentation about jass, its main features and a lot of test code to make as vivid as possible the learning of this language.

This tutorial will be conformed by several threads, this is done in such way so people can place comments per chapter which will centralize and organize the questions properly.

All the test code will be found in the Tips & Tricks section so you can browse and comment it.

If you want to contribute to this tutorial, just start a thread with the name of any of this chapters and I'll include it in the list.

From now on this thread is open and stickied for easy access.

Index

JASS Basics
« Last Edit: February 11, 2013, 08:24:26 PM by moyack »

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 977
  • WC3 Models: 59
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 12
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 6
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
Re: JASS 101 Main Index
« Reply #1 on: October 17, 2012, 07:23:31 AM »
Thread renamed and updated. Comments and suggestions are welcome

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

  • Rookie - level 1
  • *
  • Posts: 48
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 8
  • cool != useful
    • View Profile
Re: JASS 101 Main Index
« Reply #2 on: October 17, 2012, 11:44:31 AM »
Sounds like just an other liar publicity :p

I could be wrong but all these things didn't be explained many times on other sites ?
Just copy/paste and give credits if you don't want to rely on external url links.

Because frankly i don't expect anyone is willing to do any part of this boring work.
Basic stuff is too much boring to be explained, personnaly i couldn't even know where to start to explain stuff that you can understand by yourself simply by browsing blizzard.j or whatever.
vJass is already a jass preprocessor, no need to (ab)use vJass features in order to make some inferior vJass preprocessor coded "by hand".

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 977
  • WC3 Models: 59
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 12
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 6
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
Re: JASS 101 Main Index
« Reply #3 on: October 18, 2012, 05:05:24 AM »
Sounds like just an other liar publicity :p

I could be wrong but all these things didn't be explained many times on other sites ?
Just copy/paste and give credits if you don't want to rely on external url links.

Because frankly i don't expect anyone is willing to do any part of this boring work.
Basic stuff is too much boring to be explained, personnaly i couldn't even know where to start to explain stuff that you can understand by yourself simply by browsing blizzard.j or whatever.

Well...
* this is a jass / vjass promoting site.
* We aim to get people and make it change the usage of GUI to jass.
Therefore, we must have HERE a base tutorial for reference.

No worries I'll quote articles when needed and I'll try to make it as easy as possible. You're free to contribute with this, meanwhile I'll start with the introduction this weekend.
« Last Edit: October 18, 2012, 07:39:22 AM by moyack »

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

  • Rookie - level 1
  • *
  • Posts: 48
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 8
  • cool != useful
    • View Profile
Re: JASS 101 Main Index
« Reply #4 on: October 18, 2012, 12:40:23 PM »
I just meant that you don't have to reinvent the wheel, you can use something which is already created.
Now indeed, if it's not just a bunch of copy/paste but something created for here, then i suppose it will make this site looks more "professional" from a certain point of view (i'm not saying that it doesn't look already professional).

I didn't want to offense, nor trolling, maybe you've edited your post, or i've read it too quickly, because i've read like there was already a bunch of complete tutorials, hence my first sentence in the previous post, i was just kidding.

Anyway good luck, if you reach your goal i will give you some mod points, since you've only 89 of them:p
Seriously what's the point of these ones, i'm curious.

Btw i think it's time to create a section for general questions about this site, i would ask some things like this point, and one my thread belongs to a such section.

EDIT : Obviously you can delete my posts in this thread once you will reach your goal, i won't be offensed or anything, they are useless after all.
« Last Edit: October 18, 2012, 01:50:36 PM by Troll-Brain »
vJass is already a jass preprocessor, no need to (ab)use vJass features in order to make some inferior vJass preprocessor coded "by hand".

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 977
  • WC3 Models: 59
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 12
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 6
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
Re: JASS 101 Main Index
« Reply #5 on: October 21, 2012, 11:57:34 AM »

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

  • Newbie - level 3
  • ***
  • Posts: 28
  • WC3 Models: 0
  • WC3 Tutorials: 0
  • WC3 Tools: 0
  • WC3 Maps: 0
  • WC3 Skins: 0
  • WC3 Icons: 0
  • WC3 Spells: 0
  • Reputation: 100
  • User
    • View Profile
JASS 101 Main Index
« Reply #6 on: January 02, 2013, 11:45:57 PM »
Well, i have a question?
Normally when i make a spell that dash a unit or make a shield with some dummy unit rotate around the caster:
- I must use a extra trigger with Event: Time-Preiodic Event---> Every 0.02 second of game time
                                              Action: moved unit to.....
- Then i must Initially off it, so i can Initially on it if used.
But in Jass, you only using one trigger file for spell. Then how can i make the same spell with that kind of Time-Preiodic time? How did Jass code work with that kind of action?

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 977
  • WC3 Models: 59
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 12
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 6
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
JASS 101 Main Index
« Reply #7 on: January 02, 2013, 11:52:57 PM »
Well, i have a question?
Normally when i make a spell that dash a unit or make a shield with some dummy unit rotate around the caster:
- I must use a extra trigger with Event: Time-Preiodic Event---> Every 0.02 second of game time
                                              Action: moved unit to.....
- Then i must Initially off it, so i can Initially on it if used.
But in Jass, you only using one trigger file for spell. Then how can i make the same spell with that kind of Time-Preiodic time? How did Jass code work with that kind of action?
That's right, in GUI you can only have one trigger per event/contidion/action, with jass you can combine several trigger in one event and make a mixed behavior in one code. Right now I'm working in an extended explanation of this but you can check this tutorial tries to approach in the how to develop spells with effect over time and give you an idea in how it will look this. Doing it in this way you'll have a more concise, efficient and isolated code.

The idea, is to make something like this (I hope you can get the idea):

Code: jass  [Select]
  1. // this trigger will require of a sort of timerutils to manage timers
  2. scope EOT initializer init
  3.  
  4. private struct data
  5.     // the purpose of this struct is to contain with one data several handles and variables...
  6.     unit caster
  7.     unit target
  8.    
  9.     static method create takes unit c, unit t returns thistype
  10.         local thistype this = thistype.allocate()
  11.         set this.caster = c
  12.         set this.target = t
  13.         return this
  14.     endmethod
  15. endstruct
  16.  
  17. private function Loop takes nothing returns nothing
  18.     local timer t = GetExpiredTimer() // get the timer variable...
  19.     local Data D = Data(GetTimerData(t)) // retrieves the data linked to the timer
  20.     // and here we do all the stuff we need... including the detection of when the effect should finish, etc...
  21.     set t = null
  22. endfunction
  23.  
  24. private function Dostuff takes nothing returns boolean
  25.     // the action itself... this function will store in a struct the caster and the target, then
  26.     // it will link taht struct into a timer and run the timer to apply the effect over those units...
  27.     local data D
  28.     local timer t
  29.     if GetSpellAbilityId() == 'A001' then
  30.         set D = data.create(GetTriggerUnit(), GetSpellTargetUnit())
  31.         set t = NewTimer()
  32.         call SetTimerData(t, integer(D)) // links the data struct D with the timer...
  33.         call TimerStart(t, 0.002, true, function Loop) // start the timer
  34.         set t = null
  35.     endif
  36.     return false
  37. endfunction
  38.  
  39. private function init takes nothing returns nothing
  40.     //this funciton initializes the trigger
  41.     local trigger t = CreateTrigger()
  42.     call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT) // register the trigger to start when the effect of a spell begins
  43.     call TriggerAddCondition(t, Condition(function Dostuff)) // yes in jass you can add a lot of code, and it's faster than an action :)
  44.     set t = null // frees the variable
  45. endfunction
  46.  
  47. endscope

« Last Edit: January 03, 2013, 12:14:52 AM by moyack »

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 977
  • WC3 Models: 59
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 12
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 6
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
JASS 101 Main Index
« Reply #8 on: February 10, 2013, 02:13:33 PM »

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

  • Site Owner
  • Administrator
  • Starter - level 4
  • *
  • Posts: 977
  • WC3 Models: 59
  • WC3 Tutorials: 13
  • WC3 Tools: 10
  • WC3 Maps: 12
  • WC3 Skins: 6
  • WC3 Icons: 2
  • WC3 Spells: 6
  • Reputation: 1153
  • Site Admin - I love fix things
    • View Profile
    • Blizzard Modding Information Center
JASS 101 Main Index
« Reply #9 on: February 10, 2013, 02:19:57 PM »

We can give you full hosting for your projects, a complete page!!

A custom altered melee map where you can play Naga and Demons. Check it out!!
Use Dropbox...

 

The Jass NewGen Pack (JNGP) 2.0 vs Warcraft III's patch 1.27a

Started by ApelliBoard General Help and WC3 Discussion

Replies: 9
Views: 5385
Last post March 21, 2016, 06:32:55 AM
by LembidiZ
Jass Newgen Pack 2.0 Alpha - Recruiting for testing

Started by moyackBoard General Help and WC3 Discussion

Replies: 84
Views: 46588
Last post July 17, 2013, 09:37:47 AM
by moyack
What's the best jass preprocessor? pjass or zoxc jassparser?

Started by moyackBoard Jass Theory & Questions

Replies: 2
Views: 8729
Last post December 14, 2012, 02:58:27 PM
by moyack
The Jass NewGen Pack (JNGP) 2.0

Started by moyackBoard WC3 Editing Tools

Replies: 213
Views: 199153
Last post August 01, 2017, 04:16:29 AM
by Glowackos
Jass NewGen Pack Update

Started by PurgeandfireBoard General Jass Discussion

Replies: 4
Views: 12705
Last post July 29, 2012, 03:28:05 PM
by Purgeandfire
Blizzard Modding Information Center Starcraft II Modding Information Center Wacraft III Modding Information Center WC3JASS.com - The JASS Vault Chronicles of Darkness - A Warcraft III mod Jetcraft - A Starcraft II mod Troll Smash - A Warcraft III Arena
  Mod DB - Change the Game Power of Corruption - A Warcraft III altered melee map Chaos Realm - The world of Game modders and wc3 addicts Follow us on Facebook!!