Newb, Quick few Qs

TheCrystal

New Member
Reaction score
36
So I just began to actually use JASS. I can do the basics, etc, except being new and being rather solo at the moment I've been unsure of what to do about a few things.

Firstly, what is a "private?"
Like I've seen (I tried to search ^_^) people do things such as "private real BLEH" etc, but have been unsure what "private" actually does.

Another thing, I wish to make an array to use in JASS, but I don't want to do "udg_LargeArray[X]" every time I call upon it.
So I'm assuming I can create variable in JASS as to bypass this "udg_LargeArray[X]".

And, how would I create it? Example please.

Edit: One more thing, is there an easy way without using/making a system to store data in a unit? I've heard of those systems like AIDS and PUI (I think) but have been unsure exactly what they do (Quickly read them)


Oh, one last newb question. How do I make an actual event for a JASS trigger? I can really only speculate and looking at a converted GUI to JASS is all too confusing.



Early thanks for helping this newb.
 

Exide

I am amazingly focused right now!
Reaction score
448
private, as I understand it, only works within the scope which it was declared.

You can create a global array variable the same way as a non-array variable. The only difference is that you cannot set it upon declaration.

Example:

JASS:

scope Name initializer Init

globals
    private integer array i    //global, array
    private integer n = 0     //gobal, non-array, set upon declaration
endglobals

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()

    set i[1] = 1
    set i[2] = 2
    set i[3] = 3
    set i[4] = 4
    //And so on..
endfunction

endscope


Creating events for vJASS triggers works in the same way as for JASS triggers.
I'm assuming you are using vJASS, since you mentioned 'private' at the start of your post.

Here's a Tutorial on vJASS:
http://www.thehelper.net/forums/showthread.php?t=125565
 

TheCrystal

New Member
Reaction score
36
Sorry for bumping, but I can either make a new topic or just bump this recent one (same post count, don't derep me! ^_^)

Anyways, I went through it and learned a few things, clarified others, etc. I've reread the "private" and "public" section several times and I still don't understand it real well, or at all. Scopes I'm a little confused on as well with their part on privates and publics. Can anyone clarify?

Edit: His example confused me (link'ed one)
 

Exide

I am amazingly focused right now!
Reaction score
448
You should've edited your last post, instead of double posting.

Anyway, private functions/variables/whatever can only be accessed within the scope which it was declared. (Meaning that you can create two or more scopes using the same global variable names, without them overwriting each other.)
Public can be accesed from other scopes, by using the name of the scope where the variable was declared + _ + the variable name.

From Romek's example:
JASS:

set Pub = 5         //Error - It's public
set Test_Pub = 5    //This is allowed. 'Test' is the scope that 'Pub' is within


I can't explain it better than Romek did in his Tutorial.
 

TheCrystal

New Member
Reaction score
36
Ah, I see. Some parts I'm confused on but I'm sure a night of sleep will help.

I did not edit because I don't think it "bolds" the topic name, and I would then get no replys. Sorry bout' that tho.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • 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

      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