JASS: So You Want to Learn JASS?

LuckyStrike

New Member
Reaction score
1
Something wrong

Hello, i converted the melee initialisation Gui trigger in custom script and when i check for sintax errors it shows me this
Code:
Line 14: Undeclared variable gg_trg_Melee_Initialization

function Trig_Melee_Initialization_Actions takes nothing returns nothing
    call MeleeStartingVisibility(  )
    call MeleeStartingHeroLimit(  )
    call MeleeGrantHeroItems(  )
    call MeleeStartingResources(  )
    call MeleeClearExcessUnits(  )
    call MeleeStartingUnits(  )
    call MeleeStartingAI(  )
    call MeleeInitVictoryDefeat(  )
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    [B]set gg_trg_Melee_Initialization = CreateTrigger(  )[/B]
    call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction
Can you pls enlighten me :)<3
 

emjlr3

Change can be a good thing
Reaction score
396
what is the name of your trigger divider?
 

LuckyStrike

New Member
Reaction score
1
srry, but i have no ideea what that is...i just tried to convert the default melee initialisation trigger from anny map in Jass script and when I clicked sintax check ( to check for errors) it displayed this :
Code:
Line 14: Undeclared variable gg_trg_Melee_Initialization
JASS:
function Trig_Melee_Initialization_Actions takes nothing returns nothing
    call MeleeStartingHeroLimit(  )
    call MeleeStartingAI(  )
    call MeleeInitVictoryDefeat(  )
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
    set gg_trg_Melee_Initialization = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction


I just started today to learn about Jass, so pls have patience with me. Thx .
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Don't worry about that error.
Syntax Check will almost always give errors.
As long as you can save your map (CTRL + S) without errors, you're good.
 

LuckyStrike

New Member
Reaction score
1
Don't worry about that error.
Syntax Check will almost always give errors.
As long as you can save your map (CTRL + S) without errors, you're good.
Thanks for the advice:thup:. That means that anny good working GUI trigger can be converted into Jass and properly work?:D
 

WolfieeifloW

WEHZ Helper
Reaction score
372
Any GUI trigger that works can be converted to working JASS.

Notice how working is bolded.
There's a huge difference between working and efficient ;) !
 

WolfieeifloW

WEHZ Helper
Reaction score
372
No.
I mean when you convert a trigger from GUI to JASS, it's still as inefficient as it was in GUI.
You need to "optimize" your script to make it efficient.
 

LuckyStrike

New Member
Reaction score
1
No.
I mean when you convert a trigger from GUI to JASS, it's still as inefficient as it was in GUI.
You need to "optimize" your script to make it efficient.
Oh...then i've got an "optimization" problem, because I can create my own script, without understanding which parameter does what...Its just as in chinese to me... :banghead:Btw is there anny tutorial about Jass, explaining more concrete?
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
srry, but i have no ideea what that is...i just tried to convert the default melee initialisation trigger from anny map in Jass script and when I clicked sintax check ( to check for errors) it displayed this
you converted the default melee initialization trigger to JASS... and then renamed the trigger. If you want to rename a trigger, you either have to make a scope with an initializer, and create a local trigger (vJASS syntax), or you have to change the name of the Initialization function and trigger name to match the new name of the trigger. You can see what I mean in these lines:

JASS:
function InitTrig_Melee_Initialization takes nothing returns nothing
    set gg_trg_Melee_Initialization = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction


change into this:

JASS:
function InitTrig_TRIGGER_NAME_GOES_HERE takes nothing returns nothing
    set gg_trg_TRIGGER_NAME_GOES_HERE = CreateTrigger(  )
    call TriggerAddAction( gg_trg_TRIGGER_NAME_GOES_HERE, function Trig_Melee_Initialization_Actions )
endfunction


Don't worry about that error.
Syntax Check will almost always give errors.
As long as you can save your map (CTRL + S) without errors, you're good.
I believe the Syntax Check only gives errors for vJASS (with a few possible exceptions with warnings). In this case, however, it is on regular JASS, which did have errors in the first place.

However, WolfieNoCT is correct in that you should use the save button to check for errors, and not the Syntax Check button, as the Syntax Check button does not recognize vJASS syntax.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
He didn't change the name actually ;) .
Open your NewGen, make a new map, and convert it.
It gives the error he posted :) .
 

Romek

Super Moderator
Staff member
Reaction score
960
Globals can be used everywhere and anywhere. They can be set from any function, and then used in another.
Locals are function-specific. They cannot be used by other functions, but they keep things MUI.
All GUI variables are globals.
 

IAmSoDoomed

New Member
Reaction score
0
Maaaybe I'm just to stupid buuuut arn't there two " , " missing at your last Trigger you posted :confused:

here:
Code:
call AddSpecialEffectLocBJ( l[COLOR="Red"],[/COLOR] "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
and here:
Code:
call UnitDamagePointLoc( u[COLOR="Red"],[/COLOR] 0, 500, l, 100, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
It might just happend that I'm to silly aswell, but I copyed to WE and it threw up Errors without them... :confused::confused:

~Sorry if somebody already mentioned, I just noticed that it's still without~
 

WolfieeifloW

WEHZ Helper
Reaction score
372
He might've/probably just forgot them :rolleyes: .
If adding them in fixed it, then go for it!

EDIT: Doesn't damaging a point desync Mac users?
 

Vozho

Active Member
Reaction score
0
A problem comes out...

Well,this tutorial is nice,thanks for trying to learn jass some people who don't know anything about it,for e.g. me :) but it is incomplete...

i have some problem.It looks like jass is making an error.When is try to convert GUI trigger from one of my maps:

events:
Time - Every 30.00 seconds of game time
Conditions
Actions
Quest - Display to (All players) the Hint message: |c0080FFFF(If you w...

it converts to:

JASS:
function Trig_message_1_Actions takes nothing returns nothing
    call QuestMessageBJ( GetPlayersAll(), bj_QUESTMESSAGE_ALWAYSHINT, &quot;TRIGSTR_076&quot; )
endfunction

//===========================================================================
function InitTrig_message_1 takes nothing returns nothing
    set gg_trg_message_1 = CreateTrigger(  )
    call TriggerRegisterTimerEventPeriodic( gg_trg_message_1, 30.00 )
    call TriggerAddAction( gg_trg_message_1, function Trig_message_1_Actions )
endfunction


The problem is:There is no text of my quest message anywhere in jass script!
what happened?Can this be solved?
(In GUI trigger only a beginning of the text is displayed...)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    Happy Sunday!
    +1
  • The Helper The Helper:
    I will be out of town until Sunday evening
    +1
  • The Helper The Helper:
    I am back! Did you miss me LOL
    +1
  • jonas jonas:
    where did you go?
  • The Helper The Helper:
    Jefferson TX on a Paranormal Investigation of a haunted bed and breakfast - I got some friends that are paranormal investigators and they have an RV and do YouTubes
    +1
  • The Helper The Helper:
    It was a lot of fun. The RV was bad ass
  • 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 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