• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[JASS] what is jass.

Status
Not open for further replies.
You can search the forums and grab tutorials. There are plenty of them, that describe what Jass is.
Anyway, Warcraft III has an internal language, out of which the game is made, then there is Jass and then there is GUI. Jass is the coding language of modding the Warcraft III, while GUI is the interface of Jass.

Example:
GUI:
  • Unit - Create 1 Footman for Player 1 (Red) at Point1 facing default building degrees
Jass:
JASS:
call CreateUnit (Player(0), 'hfoo', x, y, 270)

GUI is newbie-friendly, while Jass is supposed to be a bit more advanced. Anyone that knows a coding language though is easy to learn Jass too.

By extension, Jass was improved to vJass/cJass/Zinc. All of them are extensions of Jass. They are supposed to boost the power of Jass and fix some errors/bugs it can cause; they actually fill the gaps.

http://www.hiveworkshop.com/forums/jass-ai-scripts-tutorials-280/


What is JASS?
-JASS is the programming language used by the Wc3 engine.

What is GUI?
-GUI stands for Graphic User Interface. It is the default crap used by the trigger editor, made to make triggering easier. Unfortunatly, Blizzard made it harder. GUI is bad. It uses BJ's (which will be covered later on), inneficient code, and is overall messy and limiting.

Why use JASS? Can't I just use GUI?
-Sure, you can use GUI. It's not recomended anymore, but it's not dead or nothing.

Here are the Pros of JASS:
-Easier to write out
-Faster, more effecient, and no leaks (when done properly that is)
-Breaks many restraints created by GUI
-Doesn't use BJ's (which again is possible when done correctly)
-Neater, easier on the eyes for longer triggers
-Easier to copy/paste, and can be edited in a text editor or 3rd-party editors (such as JASScraft)
-Generally faster to do when you get the hang of it. Much less clicking around.

However, you must be careful with JASS. As great as it is, it must be used correctly. One single mis-type can screw up an entire trigger.
Source: http://www.hiveworkshop.com/forums/...als-280/beginning-jass-tutorial-series-30765/
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
JASS:
function Agree takes string statement returns boolean
    if statement == "GUI never was and never will be the future of modding Warcraft. ;) " then
        return true
    endif
    return false
endfunction
 
JASS:
function Agree takes string statement returns boolean
    if statement == "GUI never was and never will be the future of modding Warcraft. ;) " then
        return true
    endif
    return false
endfunction

agree!

JASS:
  function THE_END takes string playersaid returns nothing
      if Agree(playersaid) == false then
           call CloseWarcraftIII()
           call DestroyComputer()
      endif
  endfunction
 
Level 16
Joined
Feb 22, 2006
Messages
960
ot:those "funny" functions aren't funny....

Like pharao_ said jass is the wc3 intern scripting language. You may read some tutorials to learn it, or just learn it by testing. Furthermore I would say learning jass helps you to get a basic understanding of general programming, may helps you in other ways :)
 
Level 9
Joined
Oct 11, 2009
Messages
477
The only thing that I hate in Jass and vJass is that they are painful to the eyes not like GUI, colorful function icons which makes your eye to relax...


Aside from that, Jass is better than GUI because GUI lacks some functions.
 
Level 11
Joined
Apr 29, 2007
Messages
826
The only thing that I hate in Jass and vJass is that they are painful to the eyes not like GUI, colorful function icons which makes your eye to relax...


Aside from that, Jass is better than GUI because GUI lacks some functions.

Never seen beatiful colored code? Syntax highlighting makes your eyes feel very relaxed and is good for you in general.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
You should look at most of my code it's all very perty.

Syntax highlighting makes your eyes feel very relaxed and is good for you in general.

Not to mention with TESH/Horus you can change the styles of your syntax highlights. Just look at how awesome my code looks with a dark background :D

 
Level 18
Joined
Jan 21, 2006
Messages
2,552
I use Consolas font-size 8 with ClearType. I have a monitor of resolution 1600x1200, the reason it doesn't look like clear-type is because ImageShack compresses the images you upload. This is the non compressed version. Basically if you click the image in my post it will bring you to a page where ImageShack has the full quality version that was uploaded. It could even be these forums that compresses the image.

About the font, I consider Consolas the absolute best fixed width font. None other even compare to it.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
It is a word, it means "struggle for air".

The Google definition is: "breathe noisily, as when one is exhausted"

What's funny about this is that you're describing the "gaps" in GUI as "gasps" in GUI, which makes it sound like GUI is a ghastly language to use.
 
Level 13
Joined
Mar 24, 2010
Messages
950
I like both although i'll be honest and say im more comfortable with gui..

That being said, in gui's defense..lol Heres some things that are better about gui and always will be:
-
  • Easier for beginners to learn and shows them what they have to work with and there basic initial limitations with the wc3 engine.
  • Wont screw over your whole game like it did with me in a few of them when blizzard came out with patch 1.24 and i had to re-due a lot of shit.. :/ (when i re-did it i just did it in gui this time so that never happens again, took a little longer to do though probably, but works just as well)
  • I Don't love typing a ton or enjoy reading a lot but i can skim through GUI quite quickly without even looking at its code sometimes, just finding the gui icon im looking for then looking at a few lines can be faster sometimes.
Thats about all i can think of lol so like anything theres +'s and -'s to everything..
When you run your game through a optimizer it coverts the gui all to jass text anyway also. Not saying it cleans leaks or bad coding though if there is some present.
 
Last edited:
What made me switch from GUI to JASS:

Since August, I started pushing the limits of World Editor. I wanted to make the best map possible. I found the terrain/object editors to be tremendously lacking throughout this experience, so I pushed the triggers to get some camerawork done and other things like gate systems and re-spawn systems.

I was irritated by the amount of time it took to register something so simple as changing the name of a variable, or if I want to group some objects together for readability it takes forever to position something (and it never looked quite right).

A huge trigger for me was how if I wanted to change a tiny bit of math or string concatenation, I had to do the entire thing over, clicking endless layers of "StringA" and "String B" or "Convert Integer to Real" this & that. I knew what I had to click, but I could not remember which part of those lists it was on. Not to mention, I even found myself struggling to track down specific parts of my OWN code! Was the action that made "this unit" talk in the "End Stage" trigger or was it in the "End Level" trigger? Scrolling through my dozens and dozens of variables was an utter nightmare!

I began to wonder if there was an easier way to do this, because I don't settle for garbage. Looking into JASS, I slowly discovered its hidden secrets (notably clearing memory leaks).

It didn't take me long to start hating to click the "custom script" box because even that took time to pop up. WHY couldn't I put all my "call RemoveLocation" and "call DestroyGroup" things in the same box??? Something as simple as "DestroyGroup[1]" and "DestroyGroup[2]" should be a matter of copy+paste and change the 1 to 2. I wanted to get this done faster because of all this clicking around nonsense.

JASS solves all these problems. When I began to convert my GUI triggers to custom script, I could feel the relief. The stress of programming was gone, and it felt really good. I started to despise the GUI so much that I even bothered to convert my one-action triggers to JASS.

I'm probably going to switch to a Linux-style OS soon, too. GUI in general is a perplexing conundrum.
 
Level 10
Joined
Mar 6, 2010
Messages
691
I am learning Jass right now, and already i am feeling greater comfort, it's such a relief not to scroll trough the endless pages of gui text, even tho you can use the searc function, it does not always give me what i want. i still use gui for about everything, since a lot of my jass doesn't work, still something i don't get about jass.

since there appears to be alot of Jass used people on this thread, even tho it's kind of off-topic, can anyone tell me whats wrong with this? the image doesn't display, what am i missing, i do have a image path with smiley.blp, is it that there is a String, not a... something else?

JASS:
function Create_Img takes string file, real SizeX, real SizeY, real PosX, real PosY, real PosZ, boolean Show returns image
  local image i = CreateImage(file, SizeX, SizeY, 0, PosX, PosY, PosZ, 0, 0, 0, 2)
  call SetImageRenderAlways(i, true)
  call ShowImage(i, Show)
  return i
endfunction

function Img_Call takes nothing returns nothing
   call Create_Img("smiley.blp", 64, 64, 0, 0, 0, true)
   endfunction
 
Ways to test that:

1. Put a string file you know for sure works, like a Blizzard one.
2. Check to see how other people do their images
3. Make sure you don't need "war3mapimported\\" before your file name, or some other folder index.

I want to note:

1. endfunction should be lined up with the start of the function. An endblock should never be lined up with things which it contains.

2. get Jass NewGen Pack, update JassHelper to A.0.2.B.

3. Use globals more than locals; images don't leak handles, but usually a situation like this would leak a handle.
 
Status
Not open for further replies.
Top