Warcraft 3 documentation
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 Main Index No New Posts Jass Tutorials

Started by
moyack

0 Members and 1 Guest are viewing this topic.

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 »



Re: JASS 101 Main Index
Reply #1 on: October 17, 2012, 07:23:31 AM

Thread renamed and updated. Comments and suggestions are welcome


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".


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 »



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".


Re: JASS 101 Main Index
Reply #5 on: October 21, 2012, 11:57:34 AM



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?



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
  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 »





 

Started by moyack

Replies: 2
Views: 6007
WC3 Editing Tools

Started by moyack

Replies: 3
Views: 4166
Jassdoc

Started by moyack

Replies: 225
Views: 313730
WC3 Editing Tools

Started by Magtheridon96

Replies: 1
Views: 8623
Codes & Snippets

Started by grim001

Replies: 0
Views: 1881
Codes & Snippets
Vivir aprendiendo.co - A place for learning stuff, in Spanish   Chaos Realm - The world of Game modders and wc3 addicts   Diplo, a gaming community   Power of Corruption, an altered melee featuring Naga and Demon. Play it now!!!   WC3JASS.com - The JASS Vault + vJASS and Zinc   Jetcraft - A Starcraft II mod   WormTastic Clan (wTc)   Warcraft RESOURCES Reforged: Modelos, mapas, proyectos y mas...