JASS: So You Want to Learn JASS?

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
 
what is the name of your trigger divider?
 
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 .
 
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.
 
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
 
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 ;) !
 
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.
 
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?
 
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.
 
He didn't change the name actually ;) .
Open your NewGen, make a new map, and convert it.
It gives the error he posted :) .
 
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.
 
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~
 
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?
 
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.
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/
  • The Helper The Helper:
    Happy Thursday!
  • Ghan Ghan:
    I'm not so sure, there's still a lot of Thursday left for it to become unhappy.
    +3
  • The Helper The Helper:
    still a few hours
  • The Helper The Helper:
    Its Friday!!!!
    +1
  • Ghan Ghan:
    Thursday 7/10 would Thursday again
    +3
  • The Helper The Helper:
    New forum coming soon going to be for my friend Saylor who is blind and he is doing motivational speaking and has an internet radio show and podcast. I am going to put a forum to promote him and other inspirational speaker stuff going to have some good stuff in it.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top