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 :)
 

l46kok

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
887
> 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
887
> 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.
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air

      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