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
508
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.
  • 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 The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    Sticking with the desserts for now the latest recipe is Fried Apple Pies - https://www.thehelper.net/threads/recipe-fried-apple-pies.194297/
  • The Helper The Helper:
    Finally finding about some of the bots that are flooding the users online - bytespider apparently is a huge offender here - ignores robots.txt and comes in from a ton of different IPs
  • Monovertex Monovertex:
    @The Helper I'm really not seeing the "Signature" link in the sidebar on that page. Here's a screenshot:
  • The Helper The Helper:
    I have reported it - I was wondering why nobody I have given sigs to over the last few years have used them
  • The Helper The Helper:
    Ghan has said he has fixed this. Monovertex please confirm this fix. This was only a problem with people that had signatures in the upper levels like not the special members but the respected members.
  • The Helper The Helper:
    Here is a better place to manage this stuff https://www.thehelper.net/account/account-details which I think should be way more visible
  • The Helper The Helper:
    I am hoping that online user count drop is finally that TikTok bot banned
  • Ghan Ghan:
    I added the filter last night.
  • The Helper The Helper:
    They are still there

      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