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
395
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
Reaction score
964
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.
  • Ghan Ghan:
    Howdy
  • 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 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