Struct....Is array?

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Well...
A straight question -

I had heard some people says that struct has 8191 instance...or array, or something like that...

What is it means?
We can only use 8191 struct in a map?
We can have 8191 members in a struct?
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
Basically it means you may not have over 8191 undestroyed structs of the same type in your map, or you'll hit the limit. Also check this thread for seeing how arrays inside a struct effect it.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Just because that thread is such a messy....so that i opened up another thread around..

>>8191 undestroyed structs of the same type in your map
What is it means?
We can only use 8191 struct in a map?
We can have 8191 members in a struct?
 
Reaction score
456
It means that there cannot be 8192? undestroyed structures of same type.. or something like that, not the best helper in struct problems :p
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Destroy them and you should be fine. Essentially "leaking" structs would continue to allocate indexes such that you would reach the limit, but I don't see how it would be feasible to do so without having a major coding error.
 

SFilip

Gone but not forgotten
Reaction score
634

Daelin

Kelani Mage
Reaction score
172
I have never worked with structures, as I have never used any custom JASS developed by Vexorian or anyone else (except of course the storing systems which do not use custom natives or concepts). Destruction clearly means that a structure has to be some sort of object (quite tricky way to insert structures into JASS, considering that in C they were just practically a user-defined data type - and later in C++ they became the watermark for classes ).

To put the problem in a simple way, imagine that if you had more than you cannot have more than 8191 units on the map. This is quite simple to actually put in mind, and imagine, considering that you can actually see the units on the map. Now, replace the word 'unit' with the word 'structure'. It's like you cannot have more than 8191 such objects. How can you get rid of an object? By destroying it. Hope this helped...

-Mihai
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
I have never worked with structures, as I have never used any custom JASS developed by Vexorian or anyone else (except of course the storing systems which do not use custom natives or concepts). Destruction clearly means that a structure has to be some sort of object (quite tricky way to insert structures into JASS, considering that in C they were just practically a user-defined data type - and later in C++ they became the watermark for classes ).

To put the problem in a simple way, imagine that if you had more than you cannot have more than 8191 units on the map. This is quite simple to actually put in mind, and imagine, considering that you can actually see the units on the map. Now, replace the word 'unit' with the word 'structure'. It's like you cannot have more than 8191 such objects. How can you get rid of an object? By destroying it. Hope this helped...

-Mihai

[/Off Topic]Rofl. I wouldn't care if I had 8,191 "such" objects, I wouldn't destroy it, I would sell it. :p [/Off Topic]
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
It is quite not possible for a map to hold 8k objects...though, 1k would also hard to be reach too...
 

SFilip

Gone but not forgotten
Reaction score
634
Putting a unit on the map adds to the script. Creating a region adds to the script. A lot of other stuff add to the script.
Even if you don't use much Jass you can still reach a rather high number of handles.
 

darkbeer

Beer is Good!
Reaction score
84
I think this limit is because structs are somehow based on integers,m though i dont understand how, but integers have a limit as well^^
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Structs are just an easy-to-use interface for global arrays. Array indexes cannot go past 8191, thus you cannot have more than 8191 of any given struct in existence at any given time.

Look at the compiled code for a spell that uses structs and you'll see what I mean.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
>>Look at the compiled code for a spell that uses structs and you'll see what I mean.

Pretty hard to find 1
 

Vexorian

Why no custom sig?
Reaction score
187
I don't think I have ever seen a map with 8000+ living handles.

JASS:

struct axa
    integer a
    integer b
endstruct

struct bxb
    integer a
    integer b
endstruct


two different structs, you can have up to 8191 instances of EACH of them, so you can have 8000+ axas and 8000+ bxbs

But what if you use array members?

JASS:

struct axa
    integer array a[100]
    integer array b[30]
endstruct

struct bxb
    integer array a [80]
    integer array b [15]
endstruct


You can have up to 80 instances of axa and 100 instances of bxb...
 

SerraAvenger

Cuz I can
Reaction score
234
Destruction clearly means that a structure has to be some sort of object (quite tricky way to insert structures into JASS, considering that in C they were just practically a user-defined data type - and later in C++ they became the watermark for classes ).
-Mihai

here they seem more like classes in an object orientated programming language
Still wondering how to define class functions - I'll gonna read more about these structs^^

EDIT: okay I had a look into vexorian's explanation
it's actually pretty cool
and enables me to do a lot of things I was unable to do ( or thought so, at least )
Ty vm!
hell, that's just awesome - it makes everything easier for me : )
Should have started using your JassPack NewGen earlier :banghead:
Ty again
Greetings Davey Jones
 
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

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top