Warcraft III resources & community, 2003–2006 · archived

JASS Tutorial

66 posts
#16
I've been really busy but when I'll get some time, I'll add the handlers as well. And yes, they are using game caches. I won't explain how they were made, but instead how to use them. But right now, I'm busy with my project. Hopefully I'll get some time.

~Daelin
#17
After reading your tutorial I tryed your spell that moves them back and your mass sleep and i kept getting a message saying "world editor has generated errors and needs to be closed by windows"

Do you have any ideas why this might be happening??
#18
Two ways :

= You made this badly. Maybe you written some jass lines bad

= Your World Editor is screwed up (it happened to me)
#19
JacekTwo ways :

= You made this badly. Maybe you written some jass lines bad

= Your World Editor is screwed up (it happened to me)


Actually there's only one way, the first. World Editor can't screw your script up but it may close without telling you the errors, with some errors, but it's because your script is bugged, like you've forgot an endloop or something..


@Draqz: If you have a complicated spell, don't convert it from GUI to Jass, that's a mesh and ain't easy for anyone.. Instead learn the function from converting simple spells, and write the advanced Jass spell directly in Jass. It something like impossible to make a spell multiinstance if you have 50 functions with names like "Trig_Spell_Jass_Func004006Func887" or whatever GUI --> conversion might result with.

@Daelin: Nice turorial, but globals aren't only udg (user defined globals if someone shouldn't know). There exist Blizard.j globals, and generated globals too and you should say a thing or two about them when talking about globals.. Anyways good tutorial :D .

Edit: Oh, and Daelin, not all you say about the type handle is correct, if you want to know what's wrong PM me, because if you aren't I'm too lazy to post it here.

~Blade
#20
- If you want to learn JASS don't ever Convert GUI to JASS, I tried this before, it was actually confusing, didn't work, DON't Ever Convert GUI to JASS if you want to learn JASS.
- Now if you want to learn pseudo JASS, a very lame, and unefficient version of JASS that sucks Convert it from GUI.
- Jacek , the fact you can't understand the caster system doesn't mean other people won't, stop going every where about don't use vexorian's spells because caster system is difficult to understand for no reason.
#21
Now now Vex, don't be that harsh. I still keep converting some functions, since I don't know all of them. There are over 400 premade functions so how the hell am I supposed to remember them all?

I suggested GUI->JASS conversion STRICTLY for getting the names of the functions, and then just editing their parameters, with the help of the JASS editor. I don't think you just learnt all the functions overnight, and simply by looking into the blizzard.j stuff. So I suggest this method, so you don't have to search between hundreds of functions for Polar offset let's say...

~Daelin
#22
Yeah.. Daelin right, actually that's the way i learn JASS. But, I think what vex said is right for someone that doesn't have experience at programming language. So he won't understand about what happen on converted code, he must learn from 'hello world' thingy that doesn't need to be converted from GUI.

BTW, you're back vex.. :)
#23
@Jacek:
Vexorians spells aren't that difficult to understand.
He always leaves comments.

If you have problems to understand it tell me.
#24
@Vex,@BertTheJasser : I don't mean "dont use vexorian's spells". I mean that if you're first to spellmaking (never or little triggers learning) then when u look at Caster System you'll say "oh the jass is so complicated, what these functions mean, man what this means". This is what I meant.

About GUI>JASS conversion, jass is more simple and logical than gui triggers ^^
#25
DaelinNow now Vex, don't be that harsh. I still keep converting some functions


I thought i was the only one who didnt remember functions and converted them.
However GUI adds BJ functions for no reason.
#26
What is "BJ fuctions"? I have seen that many commands ends with "BJ" and that there is some commands that has a BJ verion and a not-BJ version.

Jacek@Vex,@BertTheJasser : About GUI>JASS conversion, jass is more simple and logical than gui triggers ^^
Only for those with programming knowledge. I can't think that it would be easier to understant JASS the first time you look at it than understand a GUI trigger. But I agree that they are more logical.

About this tutorial I think explanations of common errors would be good.
#27
Common errors? Hmm, I think it depends on the programmer. Some make a type of errors, others another type of errors. The most frequent are probably leaks and of course forgetting to close loops which results in a crash. If you know any other, please mention them and I will add them at the tutorial. ;)

And as for understanding GUI vs JASS, sometimes I understand JASS much easier but it depends on how organised is the programmer. I think I might add something for organisation of code as well, since sometimes it can be very difficult to understand what the programmer did here and there. Even the programmer himself could get in trouble if the code is too complicated and written in a messy way. :)

~Daelin
#28
A few common errors:
- You rename the trigger then you forget that you must rename some functions in the script.
- This one is very important I think. Some times when you get an error message it is not the marked line that holds the error. It is the line above. This made me a bit mad when I got error messages in a line that didn't even contain any text. I had no idea of what could be the error. That is a really improtant thing.
- Should also be noted that you must be carfully when you have a lot of "()" (don't know the english word) in a function or command. other wise you might get errors like "Expected ", "" or "Expected " "" or expected what ever.
- Know that an integer variable can never be given a value from a equation that contains any decimal parts. This gives error message.

When I began to use JASS I got these problems all the time and I almost thought that JASS was bugged. Especially the second one.
#29
i also have a question about memory leaking
Does giving a unit expiration timer removes the memorial things about that unit?
#30
i also have a question about memory leaking
Does giving a unit expiration timer removes the memorial things about that unit?