HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I have an interest in learning jass, any advice?

08-29-2008, 03:51 AM#1
TheDefiled
I have an interest in learning jass, but I would like to know if any of you "Veterans" have a bit of advice you'd be willing to give me. Such as where to start, any useful tutorials you could point me to. Seeing as members of THW just called me a noob and refused to help.

I apologise if this is the wrong place to post this, feel free to move it if needed.

Thank you, I greatly appreciate it.

TheDefiled
08-29-2008, 04:02 AM#2
DioD
There are 3 ways:

Easy one - tutorials and articles about jass, just read them.
Hard one - work with commented systems and submissions.
Bad one - hack maps\work with open source maps.
08-29-2008, 04:25 AM#3
Ammorth
I personally would divulge into Jass and learn the syntax and as soon as you get the basics, jump directly to vJass, so there is no double learning curve, just 1 curve.

I compiled a list of tutorials and what you should expect to learn from them for a guy who wanted to learn (but gave up a day later). I'll post it if I find it.

Edit: found it. There is a lot to read, but take your time if you really want to learn.

The Basics of Learning Jass

Introductions to Jass
This is the basics and it will show you how to read Jass and how to type basic functions. It will show you some of the syntax (ways of writing) certain elements and what they do.

Beginning Jass - By a thing
http://www.wc3campaigns.net/showthread.php?t=71484
- This is a basic approach to Jass and should be easy to follow and grasp. Don't be afraid to try what is posted there and make modifications to test scripts until you feel comfortable with it.

Introduction to Jass - By Vexorian
http://www.wc3campaigns.net/showthread.php?t=74894
- Although it covers the same ideas, the language used is a bit more advanced and "code-like" Vexorian is an awesome coder and he is the founder of vJass, so if you can understand him you are doing awesome.

After this, there isn't really much medium stuff, but if I were you, I would try downloading and using JassCraft http://www.wc3campaigns.net/showthread.php?t=80051
- Although the program is old and you will rarely use it later, is is really easy to write code in. One of the reasons is the syntax highlighting and the other is the searchable natives list. When starting out, its hard to remember all the names of all the native functions. Having a searchable table is a god-send.

Once you can write some basic scripts, or even write some of your GUI scripts in Jass, it's time for round two.

Local Var Leaks - by PipeDream
http://www.wc3campaigns.net/showthread.php?t=81872
- This covers one of the most crucial parts of coding; clearing up leaks. If you notice after time, some maps become laggy (especially TDs and Mauls) this is the reason. Leaks can destroy maps if they aren't taken care of, so you should familiarize yourself with them.

Timers, the Tips the Tricks and the Traps - by Rising_Dusk
http://www.wc3campaigns.net/showthread.php?t=89072
- When you start writing more advanced code, timers will be your friend. They provide accurate and quick delays between functions, and you should know how they work, why they work and how they can hurt you if you screw up.

Round 3 - Thinking Like a Coder!

Mapping Math - by PipeDream
http://www.wc3campaigns.net/showthread.php?t=81954
- Once you know the basics of coding, its time to learn about effective coding. Designing code for speed rather than look and being able to figure out the best way to approach a problem. If you don't get it the first time, thats fine.

Deducting Forumals (JASS) - by Daelin
http://www.wc3campaigns.net/showthread.php?t=91493
- This tutorial talks about how to design functions to work for you and not against you. It shows how a little pre-planning can speed up coding time as well as code speed and effectiveness.

Moving Stuff With Jass - Trigonometry - by Knutz
http://www.wc3campaigns.net/showthread.php?t=82489
- Every map has some sort of physical aspect to it, whether it be a spell or an entire physics system. Knowing how to move stuff requires some basic trig knowledge and this tutorial should make learning it simple for those who don't know. It also shows how to use the trig directly in your code.

Moving Stuff With Jass - Realistic Movement - by Knutz (optional)
http://www.wc3campaigns.net/showthread.php?t=82663
- Once you understand how to move things, now its time to make them act like real-life objects. This read is optional but recommended cause reading and seeing as many examples as you can will help you learn faster.

vJass - The Final Frontier!

Now that you have mastered all Jass, its time to move onto vJass. vJass still uses the normal Jass you know already, but adds a lot of functionality and control to the script. Introducing libraries, textmacros, structs and easily declared global variables are only the tip of the iceburg.

I must warn you though, vJass requires a bunch of mods and third party software to work. Luckily there is a "JassNewGenPack" which includes all the mods configured properly to work together. There is only one down-side though: The new patch (1.22) has ruined the main loading program, but there are work-arounds. Converting back to patch 1.21 is the only real fix, but there are a few ways to do it.
http://www.wc3campaigns.net/showthread.php?t=90999 - JassNewGenPack (compatible with 1.21)

Method 1: Use a 1.21 world editor executable, located here: http://www.wc3campaigns.net/showthread.php?t=101201
Downsize: can't use in-game support such as war3err and custom natives

Method 2: Use a program called "warcraft version switcher" http://www.google.ca/search?hl=en&q=...e+Search&meta=
I have never used this program before, so I'm not sure how it works, but apparently it does.

Method 3: Best, but hardest; make a copy of your warcraft III folder when it is version 1.21. You can then update the install to 1.22 why keeping the copy folder at 1.21 You then need to uncomment a line find in the findpath.lua file in JassNewGen folder and set the path to the copy folder you made. This allows you to use all the JassNewGen features in both world edit and warcraft 3 and still allow you to play online with the other install.
Getting back to patch 1.21 may be a problem as you have to uninstall and reinstall warcraft 3 and then use the patch here to patch to 1.21: http://files.filefront.com/Warcraft+.../fileinfo.html

vJass for Spell Makers - by Vexorian
http://www.wc3campaigns.net/showthread.php?t=91491
- Introduces the struct and scope/library syntaxes. Explains about handle vars (hashtables) and how using structs can speed up code (less hashtable calls)

Scopes - by Toink
http://www.wc3campaigns.net/showthread.php?t=94242
- Explains scopes and special keywords which can be used in scopes. Most of the info here can be applied to libraries as well. Sets a good basis for starting to write systems and spells.

08-29-2008, 04:25 AM#4
Kwah
Quote:
work with open source maps.

Nothing wrong with that.

Right now, I'm at the same stage. My JASS is basic at the best right now, but I'm working on it. I have a bunch of old code belonging to PurplePoot lying around (and some new stuff too), which I'm taking a look at.
08-29-2008, 04:38 AM#5
TheDefiled
I've looked at tutorials and sample maps. I expanded Vuens RPG item system to allow 6 different item types instead of 2. That helped me learn some more.

I'm going to read some more tutorials and expand my knowledge.

I really just want to learn how to create full screen inventory systems, then go on from there.

I thank you all for the advice.

TheDefiled
08-29-2008, 05:08 AM#6
Ammorth
I hate to sound like the bearer of bad news, but full screen inventory systems are rather difficult and tiring to code. Sure, you make make the visuals quickly, but getting the system to handle anything you give it is another story.

I'm actually in the midst of writing one and I've been working on it for a good couple weeks (excluding vacation time). With it though, I had to write a bunch of other systems to deal with item properties and stats.

Unless you are determined to write one, no matter what the cost, I would wait till you completely understand Jass and vJass especially. I don't and I'm starting to feel the toll.
08-29-2008, 05:16 AM#7
Kwah
I'm going to start out with writing some of my own systems such as a (2-d projectile and knockback) but that's just me.
08-29-2008, 05:43 AM#8
TheDefiled
Hmm, JASS's syntax is very similar to Javascript, it's kind of like a mix of php and javascript. I'm pretty good at Javascript, and I'm OK at php, and that knowledge seems to be helping with the learning process.

I'm pretty determined to learn how to code a fullscreen inventory system. But let me ask one thing. Do I use a trackable to detect when an item is clicked or moved, and then another trackable to detect where they're trying to move an item?

TheDefiled
08-29-2008, 06:48 AM#9
Ammorth
Well, you would lay trackables out in a grid when the map loads. You can then detect when a player mouses over (display item stats) and when a player clicks (some item action).

The grid is usually 1 trackable per slot, and then 1 trackable per button.

Moving the item is entirely triggered since fullscreen inventories are not native to warcraft 3. You will need to code all the movement functions and any special properties and effects.
08-29-2008, 06:59 AM#10
fX_
im also new to jass but what i did was make simple triggers in gui convert them into jass then enhance/de-BJ/de-redundant them. then i made some stuff by crude methods (passing data by ability markers with levels, etc.) then ameliorated these crudes with vjass.
08-29-2008, 01:14 PM#11
TheDefiled
Hmm, thanks Ammorth, that's how I thought it was done.
08-29-2008, 02:27 PM#12
Alevice
Quote:
Originally Posted by TheDefiled
Hmm, JASS's syntax is very similar to Javascript, it's kind of like a mix of php and javascript.

I find JASS to be a little too verbose to be remniscient of javascript or php, and them too weak typed to be like JASS.</anal> The programming logic should be remarkably the same, so that's what I believe you find similar actually.

The way I learnt jas was when I was trying to do some math, which was hell in GUI. I started converting my code, and using JASSCraft back then to get used to the api.

It would be interesting that soemone creates a JS/PHP/C/etc compiler for the jass vm.


Concerning the fullscreen inventory UI, what would be the general idea to write one? I heard TC used destructibles for some reason, but I would like to know what for and such.
08-29-2008, 03:35 PM#13
Ammorth
Destructables are for the graphics, since you can use Replacable textures (1 model for all the icons and graphics).

When I started mine, I extracted all the images I needed from war3.mpq and stuck it in a photoshop document. I then arranged them on a screenshot until the positions and layouts were what I wanted. Then I split the inventory up into a grid and started making icons out of the different pieces.
08-29-2008, 05:14 PM#14
ShadowWolf
Thanks for the list Ammorth, I've been working with GUI for years, and just made it work for me, but it's probably about time I learn JASS lol. I've kind of always wanted to learn, I just never knew where to start. +rep imo.
08-29-2008, 09:14 PM#15
darkwulfv
I'm surprised the mass tutorials I helped write hasn't been mentioned... You know, the "Collected JASS Lessons" which was made specifically for people starting JASS?

EDIT: Sorry for the advertisement, but... yeah. They're awfully helpful tutorials for new JASSers.