HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Trying to learn Jass

01-25-2009, 11:34 PM#1
Valdez
Anyway, I was experimenting and I have a few questions..

I was wondering if there was a place that contained the code for each Event/Condition/Action or would I have to convert GUIs nonstop to figure out what the code is for each one..

IE:
The code for
Trigger:
Game - Display to (All players) the text: Hello
in Jass is DisplayTextToForce( GetPlayersAll(), "Hello")


Also, are their any events/conditions/actions other than the converted standard GUI ones? Or does Jass just make the standard ones more versatile..
01-25-2009, 11:38 PM#2
Here-b-Trollz
This includes Grimoire, vJass and TESH (<-- syntax highlighter + function list for Jass)
01-25-2009, 11:45 PM#3
Valdez

Is that essentially like WE Unlimited but for Jass instead and without some of the other features?
01-26-2009, 12:03 AM#4
Here-b-Trollz
Essentially.
01-26-2009, 01:35 AM#5
darkwulfv
It's like WEU on steroids, but without some of the annoying drawbacks of WEU.
01-26-2009, 07:58 AM#6
Valdez
Well I took a look at it and honestly I like that it has all the functions but its a little more than I thought it would be.. Now I'm just confused again (well more like overwhelmed).. I think I'm going to stick to converted codes for a while and work my way up.

Can anyone reccomend me a good tutorial on conditional functions? Seems to be right now where I'm having the most trouble.

Edit: Also.. the whole "Takes nothing and returns nothing part" I don't fully understand.. I get that Return is something that the function essentially "exports" so would taking be like "importing" and export from another function (does that also mean local variables)? Also, in NewGen, alot of the functions already have "takes" values..does that mean they have to have something entered to that slot or can it be changed to "takes nothing?"

Sorry for all the questions.. I just get lost on some of these tutorials.. or end up with unanswered questions.. Especially Vexs, don't get me wrong I learned alot from it but I think its missing parts that make it less understandable to a newb like me..
01-26-2009, 09:16 AM#7
Frozenhelfire
There are a good amount of tutorials for learning JASS. I'd suggest looking in the tutorials section, can't miss them :). If you're easily overwhelmed, you may want to steer away from Vexorian's tutorial since it is long. IT is very informative however. a_thing's looks like it might work for you, but I haven't read it :P
01-26-2009, 09:47 AM#8
Valdez
Quote:
Originally Posted by Frozenhelfire
There are a good amount of tutorials for learning JASS. I'd suggest looking in the tutorials section, can't miss them :). If you're easily overwhelmed, you may want to steer away from Vexorian's tutorial since it is long. IT is very informative however. a_thing's looks like it might work for you, but I haven't read it :P

Well I've already read A_Things' tut, and Sid's tut. Also I read about 50% of Vexorians and I understood what he was doing in each of his funtions.. the only problem I had with it was the feeling he was leaving out information I feel I needed.. IE: I didn't know if he was just changing the function of the first converted trigger or if he had created a new one so I essentially got lost..

Mostly though I was looking for a tutorial directed to how conditional functions worked (not really shure if this makes sense to anyone but me though..)

On a side note: A_Things better explained the takes and returns issue for me.
01-26-2009, 12:49 PM#9
Here-b-Trollz
I learned Jass mostly from Blade.dk's 'Making a Simple Stomp Spell'

In order to use a function as a condition, it must takes nothing returns boolean <-- Means that no information is passed to the function, but it returns a true or false variable.

Then you must use the function Condition() on it. It usually looks like this:
Collapse JASS:
call TriggerAddCondition(<my trigger>,Condition(function MyConditions))

Your condition would often look like:

Collapse JASS:
function MyConditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A000'
endfunction

GetSpellAbilityId() == 'A000' is a comparison. If the two things are equal, then the comparison is true, otherwise it is false. Here we check that the spell that we cast has the rawcode of 'A000'
01-27-2009, 12:33 PM#10
MaD[Lion]
honestly i convert from GUI all the time :P Cus i cant be bothered to write it all. Sometime things are easier done in GUI than writing in jass. But 90% of the case Jass/vJass wins
01-27-2009, 05:25 PM#11
akolyt0r
Quote:
Originally Posted by MaD[Lion]
honestly i convert from GUI all the time :P Cus i cant be bothered to write it all. Sometime things are easier done in GUI than writing in jass. But 90% of the case Jass/vJass wins

i only do that for small triggers needed for debug ..sometimes ...
TESH is just pure ownage with function list and autocomplete :>
01-27-2009, 06:10 PM#12
MaD[Lion]
habit is wat i will say :D
01-27-2009, 06:56 PM#13
Valdez
Does this function have to call another to work or can I make it all into one trigger?

Collapse JASS:
function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
    call ForGroupBJ( GetRandomSubGroup(1, GetUnitsInRangeOfLocAll(600.00, GetUnitLoc(GetSpellAbilityUnit()))), function Trig_Untitled_Trigger_002_Func001A )
endfunction

I'm trying to shorten down my submission as much as possible for the spell contest.
01-28-2009, 12:47 PM#14
MaD[Lion]
man if u wanna subit... i suggest make it gui.
But to answer ur question, yes u need a function. And no u dont need u can break it down but then it will be something tat i dont think u understand