JASS: Introduction

Flare

Stops copies me!
Reaction score
662
What errors are you getting (and what line are you getting them on)

The s was an argument taken by the function (see the takes string s part? the s just represents the name of the string so you can use it within the function e.g.)
JASS:
function Hello takes string myargumentname returns nothing
  call DisplayTextToForce (GetPlayersAll (), myargumentname)
endfunction
 

Fulgore

New Member
Reaction score
0
:eek: I'm must be too much of a simpleton to get this stuff. I read the whole thing, but it really made no sense to me. Pretty much all I get out of it is that it's an alternate way to make triggers. I suppose it just takes some serious dedication and trying it out for myself. JASS isn't for people like me who just want to figure it out fast and make a cool hero spell :p lol
 
Y

Yiska

Guest
The first obstacle, what happened to the "This is a message" text?

TRIGSTR_004 , reffers to a string in war3map.wts (the map strings) you are able to edit that file with the World Editor's File\Export/Import Strings... commands. But for practical reasons we will forget about that and just use the text we like.

wut? World Editor's File\Export/Import Strings... commands???

i cant find the *commands* your talking about :( i searched everywhere

ps: sry for my spelling me french :D
 

Jedimindtrixxx

┻━┻ ︵ ¯\(ツ)/¯ ︵ ┻━┻
Reaction score
168
5 star bump
very very nice. read through it twice. only because the first time i didnt understand shit. jass is hard to learn =\
time to move up to the big boy tuts
 

skyblader

You're living only because it's illegal killing.
Reaction score
159
Same with the other readers, but I found another error, somewhere in the ending part I think where ur supposed to get a random number from 1 to 10 and then if its 1, say one. The example u gave was
a=1
one
a=7
seven
The problem is, when u set a to the random number between 1-10, u set it to 1-100 instead.
 

12sea21

New Member
Reaction score
5
Vexorian said:
Were you able to understand the english used on this tutorial?
If the answer is yes, thank Trisped for the corrections he made to the contents of the tutorial
If the answer was no? lol jks
 

Wind

New Member
Reaction score
0
This is what I did:

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

function Trig_Jass_test_Actions takes nothing returns nothing
  local integer a=GetRandomInt(0,10)
  local integer b=GetRandomInt(0,10)
  local integer c=GetRandomInt(0,10)
    call Msg("a= "+I2S(a))
    call Msg("b= "+I2S(b))
    call Msg("c= "+I2S(c))
    if a>b then
        if a>c then
        call Msg("a is the largest number")
        endif
    elseif b>a then
        if b>c then
        call Msg("b is the largest number")
        endif
    else
        call Msg("c is the largest number")
    endif
endfunction


It won't call Msg("c is the largest number") so what am I doing wrong?
 

Wind

New Member
Reaction score
0
I was trying to do Challenge 1 and I see my mistake but can anybody give me the answers to the challenges so I can use it as references after I attempt them?
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Wind, when you compare a>b, that doesn't take c into account. So imagine the following scenario:
A = 5
B = 2
C = 7

A is > B, so the first if will be executed, but A is not > C, so no message will be displayed. Similarly, your other elseif would run when C < B but B > A, in which case no message would be displayed.

The concept you need to grasp is that once an if is executed, it will not evaluate any other "elses" until skipping to the end of the block. The special case is elseif, in which case it will execute elseifs until one is true, then skips to the end of the block.

What you should have written is:
JASS:
function Msg takes string s returns nothing
    call DisplayTextToForce( GetPlayersAll(), s )
endfunction

function Trig_Jass_test_Actions takes nothing returns nothing
  local integer a=GetRandomInt(0,10)
  local integer b=GetRandomInt(0,10)
  local integer c=GetRandomInt(0,10)
    call Msg(&quot;a= &quot;+I2S(a))
    call Msg(&quot;b= &quot;+I2S(b))
    call Msg(&quot;c= &quot;+I2S(c))
    if a&gt;b and a&gt;c then
        call Msg(&quot;a is the largest number&quot;)
    elseif b&gt;a and b&gt;c then
        call Msg(&quot;b is the largest number&quot;)
    else
        call Msg(&quot;c is the largest number&quot;)
    endif
endfunction
 

Wind

New Member
Reaction score
0
Lol. That's exactly what I had in mind but then I thought I couldnt use "and" haha so I just tried it my way and kept trying and failing that I forgot about trying that. Sorry.

- JASS Noob
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Did you try them? 3 is complex, but 2 and 4 should be really easy.
 

Quaeromore

New Member
Reaction score
0
The following.
JASS:
function Trig_JASS_test_Actions takes nothing returns nothing
 local string a
    call DisplayTextToForce( GetPlayersAll(), &quot;The value of a is +&quot;a+&quot; so live with it!&quot; )
endfunction

Is supposed to be.
JASS:
function Trig_JASS_test_Actions takes nothing returns nothing
 local string a
    call DisplayTextToForce( GetPlayersAll(), &quot;The value of a is <b><i>&quot;+a+&quot;</i></b> so live with it!&quot; )
endfunction

I told you that because I thought it would be helpful. Whatever.:cool:
 

Genemos

New Member
Reaction score
3
Crash

After having created the event and action as described in the beginning, I then change the text, save, and when I try to start test the map directly, it crashes.

"Warcraft.exe" has stopped working.

I have Windows 7 and I am running the WE using jassnewgen pack. I don't know what is wrong, but it is a bad depressing to have the first thing happening to you, is a crash :p
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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