Another Jass Question

adeoin

Member
Reaction score
11
Would a jass trigger mess up if i accidently added 1 too many parenthesis or 1 too little? Also how would i know what each line meant? like this...

GetSpellAbilityUnit how do i exactly know what that means. Jass Craft lists them all but i dont know what they all mean and how they are used

EDIT: Since I already posted 2 other threads I'll just ask another question here.

I got basic JASS down except for the part at the bottom. Creating actions and conditions and the gg_trg_ thingy. I have no idea what that part is. Could any explain in detail what that place really is all about
 

uberfoop

~=Admiral Stukov=~
Reaction score
176
Would a jass trigger mess up if i accidently added 1 too many parenthesis or 1 too little?
Yes.

Also how would i know what each line meant? like this...

GetSpellAbilityUnit how do i exactly know what that means. Jass Craft lists them all but i dont know what they all mean and how they are used
You learn them the same way you learn anything else. Look up what you need to know, gain knowledge from experience, take advantage of the extremely intuitive names of most functions, etc...
 

Matrixboy

New Member
Reaction score
1
Would a jass trigger mess up if i accidently added 1 too many parenthesis or 1 too little? Also how would i know what each line meant? like this...

GetSpellAbilityUnit how do i exactly know what that means. Jass Craft lists them all but i dont know what they all mean and how they are used
Yes, it will mess it up-- but it will not pass the syntax checker. It'll give you an error with a line. You'll notice your mistake (hopefully, or you'll start disecting your crazy inlining code you were just working on) and throw in the right parenthesis where it belongs.

Well, that's one thing I've always had problems with in JASS. Most of the natives (that I've had to use, anyway. I haven't experimented with cinematics really...) seem to be intuitive, but there are some that really knock you on your ass as to what they do.

The best way to understand what they do is look at what they take, and what they return.


As an example, I opened the API browser on sourceforge. No clue at all what this function could do

native GetUnitCount (integer unitid) returns integer
Well, the name can help us a little. GetUnitCount. Something about units, and counting them. But is it units owned by a player? All the units in a game?

We then see it takes an integer that is a unitid. (aka, it takes a unit). So, it takes one specific type of unit, and returns an integer. It must give us all of those _specific_ units that are currently on the map. So, if you ever wanted to know how many footmen all the humans made in a melee game, you'd use that.


And don't really bother going into creating your own triggers for now. Learn to add Actions, but don't bother with setting up the initialization trigger-- you need a global variable declaring the trigger exists, or you have to run a pre-global trigger that'll then call the local trigger. For now, it's not something to worry about.
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
> I got basic JASS down except for the part at the bottom. Creating actions and conditions and the gg_trg_ thingy. I have no idea what that part is. Could any explain in detail what that place really is all about

Example:

JASS:
function Init takes nothing returns nothing
        local trigger trig = CreateTrigger()    //Create the trigger, you can replace gg_trg_blabla with a local one since a variable name is more convenient than the whole gg_trg_blabla.
        call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_SPELL_EFFECT)  //Registers an event to the trigger named "trig". The event in this case is "A unit starts the effect of an ability"
        call TriggerAddCondition(trig, Condition(function Conditions)) //Adds a function named "Conditions" as the conditions for our trigger named "trig"
        call TriggerAddAction(trig, function Actions) //Adds a function named "Actions" as the actions for our trigger named "trig"
endfunction


That's basically the idea behind it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • jonas jonas:
    That sounds like fun!
    +1
  • The Helper The Helper:
    it was a blast!
  • The Helper The Helper:
    I am going to post the Youtube of the investigation in the forums when it is ready
    +1
  • jonas jonas:
    cool!
  • vypur85 vypur85:
    Sounds cool TH.
  • tom_mai78101 tom_mai78101:
    I was on a Legend of Zelda marathon...
  • tom_mai78101 tom_mai78101:
    Am still doing it now
    +1
  • jonas jonas:
    which one(s) are you playing?
  • jonas jonas:
    I played a little bit of the switch title two weeks ago and found it quite boring
  • The Helper The Helper:
    just got back from San Antonio this weekend had the best Buffalo Chicken Cheesesteak sandwhich in Universal City, TX - place was called Yous Guys freaking awesome! Hope everyone had a fantastic weekend!
    +1
  • The Helper The Helper:
    Happy Tuesday!
  • The Helper The Helper:
    We have been getting crazy numbers reported by the forum of people online the bots are going crazy on us I think it is AI training bots going at it at least that is what it looks like to me.
  • The Helper The Helper:
    Most legit traffic is tracked on multiple Analytics and we have Cloud Flare setup to block a ton of stuff but still there is large amount of bots that seem to escape detection and show up in the user list of the forum. I have been watching this bullshit for a year and still cannot figure it out it is drving me crazy lol.
    +1
  • Ghan Ghan:
    Beep boop
    +1
  • The Helper The Helper:
    hears robot sounds while 250 bots are on the forum lol
  • The Helper The Helper:
    Happy Saturday!
    +1
  • The Helper The Helper:
    and then it was Thursday...
    +2
  • tom_mai78101 tom_mai78101:
    And then Monday
    +1
  • The Helper The Helper:
    I got the day off today!
    +1
  • tom_mai78101 tom_mai78101:
    How...? (T-T)
  • The Helper The Helper:
    I took the day off. I work for myself so I can do that.
    +1
  • Varine Varine:
    Well I'm already over summer
  • jonas jonas:
    varine! good to see you
  • jonas jonas:
    what's going on, what's got you going
  • The Helper The Helper:
    good to see you varine hope you are well my friend

    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