JASS: Introduction

Rad

...
Reaction score
228
Um maybe im getting an error, about 3/4 of those code fields are empty, and 2 are all messed up and stretched out of the box. I restarted my browser, am I the only one with this problem in this thread?
 
R

Ralle_Janis

Guest
Man this is very nice, one time when i feel like learning JASS, i will use this :D
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
thanks for not explaining jass


GENERIC USELESS TUTORIAL STAMP
APPROVED BY UBERFOOP



sry man, but when people make jass tutorials, what ive always looked for first thing is HOW the initial function lines work, WHAT the arguements do-just saying that they are called arguements is barely more then gibberish.
 
T

The_Prophet

Guest
this tutorial is anything but a " GENERIC USELESS TUTORIAL" This is the same tutorial i learned from, only on wc3jass.com, and i would consider it the best jass tutorial on the net. Especially for someone new to programing.
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
fine-maybe ill take your word for it and read the entire article and then decide if it makes sense...
 

Sargon

New Member
Reaction score
83
uberfoop said:
fine-maybe ill take your word for it and read the entire article and then decide if it makes sense...

He explains the arguments in there, just not in the beginning.
 

Vexorian

Why no custom sig?
Reaction score
187
uberfoop said:
thanks for not explaining jass


GENERIC USELESS TUTORIAL STAMP
APPROVED BY UBERFOOP



sry man, but when people make jass tutorials, what ive always looked for first thing is HOW the initial function lines work, WHAT the arguements do-just saying that they are called arguements is barely more then gibberish.
You are confusing a JASS tutorial with an explanation of each native function blizzard has added. blerg wc3jass.com jass.sourceforge.net/doc/ for that stuff .

You can't learn to use a blizzard's function if you didn't learn how to use JASS before doing that.
 

uberfoop

~=Admiral Stukov=~
Reaction score
177
5 Stars! Go vex!

I love how it has to be a '5 star bump' by helper rather than just a bump
Just felt like saying that
 

ayumilove

Youtube account suspended! youtube.com/ayumilove8
Reaction score
110
5 star bumps <3

Nice tutorial! Probably one of the easiest tutorial to learn ^^
 

Vulcansurge

Ultra Cool Member
Reaction score
27
Its been a few years since you wrote this tutorial, and people are still learning from it. Great work! Five stars from me!
 

Demi666

New Member
Reaction score
127
lal great tut very nice, but most of it explains how to display text in diffrent ways^^ and how to you the " * , - , + , / " anyways really nice

readed whole thing^^
 
F

Flameboy

Guest
I just have one problem when you talk about global:

function Msg takes string s returns nothing
call DisplayTextToForce( GetPlayersAll(), s )
endfunction

function AddSubstract takes integer a, integer b returns nothing
set udg_r1=a+b
set udg_r2=a-b
endfunction

function Trig_JASS_test_Actions takes nothing returns nothing
local integer a=14
local integer b=56
call AddSubstract takes(a,b)
call Msg("a= "+I2S(a))
call Msg("b= "+I2S(b))
call Msg("The Addition is "+I2S(udg_r1))
call Msg("The Substraction is "+I2S(udg_r2))
endfunction

The red line always get me an error and I can't find out why its wrong. I have tried to re-type everything, and it didn't work, so I copy-pasted everything and it still isn't working. Can I get some help please?

By the way, excellent tutorial, first one I find which is really helping me.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
You don't need the "takes" in there; the "takes" keyword is only used in the function name.

Thus, you'd call it like this:
JASS:
call AddSubtract(a,b)
 
F

Flameboy

Guest
Thanks a lot man, it works now :D
Would be a good idea to correct it in the tutorial.

Ps: How do I post a quick reply? The box is all grayish and it says ''click one of the quick reply icon in the post above'' but I just can't find the quick reply icon.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
It's the second button to the right of the "quote" button. When you press it, it higlights and then brings you to the quick reply box.
 
F

Flameboy

Guest
When i click the link for the answers to the challenge, it just doesn't work. It brings me to wc3campaigns.com or something like that, and there is no answer around there.

Edit: I found the answer by myself now, but would still be useful to have the answers for the future challenge. I'm proud i got this one :D

And about the loop part, instead of making two locals, would it work to do:

function Trig_JASS_test_Actions takes nothing returns nothing
local integer a=GetRandomInt(1,5)
loop
call Msg("a= "+I2S(a))
exitwhen a==0
call Msg("Hello")
set a=a-1
endloop
endfunction

Seems like less trouble to me, would it cause leaks or something? Or is it fine?
 

Faust

You can change this now in User CP.
Reaction score
123
I'm lost :(

Calling a function

For calling functions we use:

call <Function Name>(Argument1,Argument2,...,ArgumentN)

In cases where the function takes no arguments, it is just:

call <Function Name>()

Functions can call other functions, AS LONG AS the other functions are written ABOVE the function in the map script. If a function is above other function in the same 'trigger', the other function may call it. But there is no safe way to make sure the contents of a custom trigger will be added to the map script before the contents of another trigger.

The Frozen Throne editor, comes with a "Custom Script section" feature, When you are at the trigger editor, click on the map's name, and you will be able to see the Custom Script section, that's a place for functions. The contents of the Custom Script section are added to the map script before the contents of every trigger.

An example wouldn't hurt:

JASS:
Code:

function Msg takes string s returns nothing
    call DisplayTextToForce( GetPlayersAll(), s )
endfunction

function ShowMessage takes nothing returns nothing
    call Msg(&quot;This is a message!&quot;)
endfunction

function ShowSum takes integer a, integer b returns nothing
 local integer r=a+b
    call Msg(&quot;r= &quot;+I2S(r))
endfunction

function Trig_JASS_test_Actions takes nothing returns nothing
   call ShowMessage()
   call ShowSum(33,45)
endfunction

The result will be:

This is a message!
r = 78
JASS:


I'm trying to learn, but I can't figure out that "s" letter at the beginning of the code.

Code:
function Msg takes string s returns nothing
    call DisplayTextToForce( GetPlayersAll(), [COLOR="Red"]s[/COLOR] )
endfunction

It gives me a bunch of errors :(

Can someone explain, or is it the wrong place to ask?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top