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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • 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 Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top