JASS: Moving From GUI to Jass, the Start

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
yeah u make me more understand about return
+rep
_______
SPREADING xIDS
 
H

Hjalle

Guest
Im a total beginner at JASS (almost really), so this helped me alot. Good tutorial. At last i understand the return, takes things :p

+rep and 5 stars :)
 

Tt112233

TH.net Regular
Reaction score
6
on your tutorial, you introduced an example about multiplying function

JASS:
function multiply takes integer a, integer b returns integer
    local variable counter = 1
    loop
        exitwhen counter > b
        set a = a + a
        set counter = counter + 1
    endloop
    return a
endfunction


Suppose the parameter given for this code is

a = 3
b = 3

which the result should return 9 right?

However, if you actually run the code, you would get 12 if you examine the loop since a gets a + a

First loop : 3 + 3 = 6
Second loop : 6 + 6 = 12
Third loop : Counter = b, loop exits here

You might want to make some changes :D

Sorry about double post. I thought that you should include a warning about global variables.

In any practice of computer programming (Yes, this includes JASS), it is almost always a good idea to avoid global variables. They are usually considered bad practice precisely because of their nonlocality: a global variable can potentially be modified from anywhere, and any part of the program may depend on it. A global variable therefore has an unlimited potential for creating mutual dependencies, and adding mutual dependencies increases complexity.

Furthermore, the use of global variables makes software harder to read and understand. Since any code anywhere in the program can change the value of the variable at any time, understanding the use of the variable may entail understanding a large portion of the program. They can lead to problems of naming because a global variable makes a name dangerous to use for any other local or object scope variable.

Well I suppose, in a few cases, global variables can be suitable for use. For example, they can be used to avoid having to pass frequently-used variables continuously throughout several functions.

But the bottom line is, unless if you are absolutely sure that having a global variable would be advantageous in your code, avoid using them.

P.S : (I do not understand why JASS tutorials here do not emphasize this enough. This is a crucial matter in programming).
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Very nice spotting about the function, I will fix it right a way. Thanks!

As for global variables, I agree with you completely, most people agree that locals are better then globals, and locals should be used if possible.
 

Naminator

Coming Back To Life
Reaction score
76
It really made me saw Jass in a different way. Help me a lot!

+Rep. Really good tutorial!
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Great tutorial, it was really helpfull.

Actually, isn't JASS similar to Visual Basic?

People say it is, I have no idea, I never bothered learning C++.

~Gals~, yes locals, if used correctly make a good MUI spells.

So, mods / admins, what's happening with this tutorial, is it approved or disapproved?
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
no idea...many tut just scattered around...+rep and push to 5stars :D
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> So, mods / admins, what's happening with this tutorial, is it approved or disapproved?

Well, at least it's not in the Graveyard yet. :p

> you could get rid of the center alignment from the table of contents and use the default font, as well. Makes easier to read.

I DO agree with that. Somewhat. I think you should make the headers for each of the sections larger and maybe bold, then make the sub-headings beneath them smaller. Also, you might add a blank line between each big section.
 

Tinki3

Special Member
Reaction score
418
>is it approved or disapproved?

I vote for approval.
-Long, and explanatory
-Useful
-Adds to the 'JASS Tutorial' collection(*)

>at least it's not in the Graveyard yet

Wait, AceHart's lurking around the corner!
Joking :p

(*) Wait, that is a good thing, right?
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
> I vote for approval.

Is there a poll on it? :p Make it happen, then.

I agree. The content certainly warrants approval.
 

Weebl

New Member
Reaction score
5
Very nice tut. I've read a few but they all manage to make even the most basic things look really scary. This however was really comprehensive and made it perfectly clear to me just how simple JASS actually is to learn.

O and by the way I disagree with all the people who say this is too long. Although I don't like unneccessarily drawn-out tuts, this one only takes half an hour (maximum) to read and it teaches you ALL the basics. As far as I'm concerned anyone who isn't willing to spend half an hour learning a comlpete new set of tools shouldn't call himself a modder.
 

cowmenace

New Member
Reaction score
22
I knew absolutely nothing about jass, custom scripts, I was hardcore GUIer I took this tutorial I understand functions, loops, ifthenelse, and so much more that looked like gibberish. Only took me about 1 hr to get thnx u r awesome!!!!!
 

mr_fj

New Member
Reaction score
10
OMG OMG OMG Thank you so much. If you havn't written this, i would never have begun learning Jass. Thx +rep (and maybe next time i see you post somewhere, because of this toturial ^^)

Thanks.























Thanks again :D



















Last time: THANKS!!!! THX THANK'U XD XD XD
 
M

MeRn00b

Guest
WoW, Thats truly a 11 of 10
Goodbye GUI, Hello JASS
+Rep
You really, really did create, it's like >:eek:< just simply amazing

~My thought is, lucky me, for waiting to learn JASS~
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top