Starting JASS

tooltiperror

Super Moderator
Reaction score
231
^adding on what king said.

JASS:

struct Data
 method empathy takes nothing returns nothing
 endmethod
endstruct


That will compile in normal JASS to something like this:

JASS:

globals
integer nl_data_emapthy_alloc_
endglobals
function NL_DATA__empathy_ takes integer this returns nothing
endfunction


You know, a lot of random global blocks and random stuff. But it should show you that methods end up taking an integer called 'this'. If no one explained this yet, structs are integers.

JASS:

struct Data
integer lmao
endstruct
function onInit takes nothing returns nothing
    local Data data=Data.create()
    set data.lmao=3
endfunction


becomes->

JASS:

function onInit takes nothing returns nothing
    local integer data=nl_data__allocate()
    set lmao[data]=3
endfunction


See? this is just an integer pointing to a link in an array.
 

Ayanami

칼리
Reaction score
288
Thanks for the explanation. So is there any way to call a method in the Filter(function)?
 

decored

New Member
Reaction score
3
I suggest doing others as knockback requires timers struct etc for full effective. But if you can code in GUI i dont think you will ave a problem
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Thanks for the explanation. So is there any way to call a method in the Filter(function)?
Use a global to pass data.
You don't have to care about the MUIability, because it is instant.
 

roXplosive

New Member
Reaction score
15
I've just read this passage and i'm facepalming right now . I really don't get why Blizzard did structures this way since i know from programming (let's stick to C++) that an object is a data structure containing in order for each instance the member data as the type it is defined as and might get aditional fields that are pointers to polymorphic functions that are specific to the object if it is derived from a base class .

As for method calling the parameters passed to stack before calling are : pointer to the object calling the method named with "this" and the other function parameters .

So i'm asking the following questions about structures and similarities with C++ :

1) which is the default sharing of member data (default C++ is private)
2) is there a sharing parameter besides private and public like the "protected" of C++
3) can you declare abstract structures ? In C++ abstract structures can not have instances and their member functions are specified without parameters and ended with =0
4) the declarations of new structures is alike to the "Public" inhgeritance ? In c++ there are 3 types of inheritance : public : the new class has access to all the members of the base class can use all the data of the base class , protected : can use public and protected members of the base class and the members defined as protected in the base class become private here private inheritance turns all the data of the base struct into private regarding the new class , so deriving this class more would render the new objects unable to use the grandparent's class members
5) the C++ had a nice feature making possible to create eterogenous arrays using the inheritance of classes knowing that a pointer to a base class can point to a data of a derived type from the base
6) are restrictions to redefining methods of the base class in the classes inheriting it ?
 

Sevion

The DIY Ninja
Reaction score
413
Why are you posting this here?

And Blizzard did not make vJASS. Vexorian did.

1. Public with no prefix.
2. No.
3. No.
4. You prefix each member and method with the access level.
5. I'm sorry, but I don't understand. "eterogenous" is not an English word. If you mean two arrays that have the same values as a base array, then you have to manually clone the arrays.
6. If you want to redefine methods in child structs, you have to make the parent have stub methods.
 

Bribe

vJass errors are legion
Reaction score
67
Actually, Sevion, a "stub" method is mildly similar to a "protected" method, so #2 should not entirely be false.

I don't know how many of these features are unlockable in StarCraft 2, but there may be some room for this guy with the (Andromeda?) language.

vJass is semi-automatic with a lot of its functions. Things that are automatic with PHP, C++ can be done with certain libraries people have made. It may interest you that there is very little need for hashtables in most cases; people have found really useful methods of indexing data without the limitation of the pathetic 8192-sized array.
 

Sevion

The DIY Ninja
Reaction score
413
True, at that. My mistake.

Actually, all of these answers can be found in the JassHelper manual.
 
General chit-chat
Help Users
  • 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!
  • 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