Looking for a Reliable Attachment system

Trithilon-V2

New Member
Reaction score
20
Well,its been a week since i moved on to jass.....and i like it.
However, it was the first day i found out that jass was useless without the capacity to attach information to handles...then i discovered HandleVars...and i made my first Jass spell.
Now recently i came to know that the there are limitations to gamecache apart from being slow.....something like 256 gamecaches.
Thats a pretty small limit if the player plays a lot of campaigns.
and might fail the triggers in the map.
Also...having a lot of globals and big arrays is not safe...and makes the triggers in the map fail due to improper initialization.
So is there any system better for attaching anything to anything?
Preferably Jass.... not going into VJass yet.
 

Flare

Stops copies me!
Reaction score
662
Without vJASS, you're pretty limited in choice (i.e. Handle Vars, and that's cache-based and unsafe)

Best option is to try and understand structs, and then you're pretty much sorted (since it's fairly easy from there)

All* the vJASS attachment systems can be found over at WC3Campaigns

CSData/TimerUtils are probably the best choice for simplicity/ease-of-use (since there is no Reset function needed, which makes things easier) and has a fairly big limitation before it starts to not work (400,800 handles in existence I believe), but it's very unlikely you would hit that limit unless you are doing it deliberately.

After that, you have ABC (which isn't hindered by handle leaks), HAIL, HSAS (both of these are hindered by handle leaks I think, more-so HSAS as far as I know) and a few others

*I think
 

Trithilon-V2

New Member
Reaction score
20
[EDIT] :- Like its about time i revive recode and release...all of the unreleased GUI systems i have made up till now. So i need a definitive platform to work on...i dont mind switching over to VJass for that sake.

So....you mean VJass is the way to go?
Cuz i though i would become better at Jass first....so that once i start looking into VJass i know there is no turning back.

But by far only 2 cons for VJass :-
1: They say campaigns crash if VJass is used
2: I dont know how structs work --- (are they global variables or just a collection of locals?)
3: I think map protection (code-obfucation) might scrable the code resulting into a corrupt war3map.j --- Thus leaving you out of the option for using map-optimiser.
 

Flare

Stops copies me!
Reaction score
662
vJASS -IS- JASS, just with a different image on the surface (when the map is saved, all vJASS code is parsed into standard JASS syntax)

1: They say campaigns crash if VJass is used
There's some issue with vJASS and campaigns, but I think you can use vJASS in campaigns, just not directly (Uberplayer made a thread about it in the JASS Help forum)


2: I dont know how structs work --- (are they global variables or just a collection of locals?)
They are a series of global arrays, but you can declare a local (or global) instance which gives you a reference to a specific array index for that collection of variables e.g.

JASS:
struct Test
  unit u
  real r
endstruct

function myfunc takes nothing returns nothing
  local Test a = Test.create ()
  local Test b = Test.create ()
  call BJDebugMsg ("a = " + I2S (a) + ", b = " + I2S (b))
  call a.destroy ()
  call b.destroy ()
//That should display
//a = 1, b = 2
endfunction


3: I think map protection (code-obfucation) might scrable the code resulting into a corrupt war3map.j --- Thus leaving you out of the option for using map-optimiser.
And how is that more likely to occur in maps where vJASS is used? And I've never heard of any problems with vJASS and Map Optimizer

But by far only 2 cons for VJass :-
You pointed out 3 things :rolleyes:
 

Trithilon-V2

New Member
Reaction score
20
Thx dude.....
Timers are ok....but is there is no system that can attach a handle to a handle in VJass?
 
Reaction score
333
Thats a pretty small limit if the player plays a lot of campaigns.

The limit is really quite large. Anyway, as I recall that is a strange bug but probably not really something to worry about unless you're creating 256 different gamecaches in a map or something like that.

Also...having a lot of globals and big arrays is not safe...and makes the triggers in the map fail due to improper initialization.

All arrays are the same size, and you can have hundreds of globals with no real issues. You may be thinking of the globals initialization stuff generated by the variable editor (which you won't be using once you start to use vJass).

So is there any system better for attaching anything to anything?
Preferably Jass.... not going into VJass yet.

Well, you should be. There is really no reason to stick with plain Jass if you have the option of vJass.

Once you are using vJass you can use HAIL for attachment.

1: They say campaigns crash if VJass is used

You can still use vJass in campaigns, it is just trickier (and documented somewhere over at wc3c). Anyway, you can always use normal Jass for campaigns if you wish.

2: I dont know how structs work --- (are they global variables or just a collection of locals?)

They are implemented as globals.

3: I think map protection (code-obfucation) might scrable the code resulting into a corrupt war3map.j --- Thus leaving you out of the option for using map-optimiser.

The optimizer works fine with maps made in vJass. The optimizer and jasshelper were intended to work together.
 

Trithilon-V2

New Member
Reaction score
20
The limit is really quite large. Anyway, as I recall that is a strange bug but probably not really something to worry about unless you're creating 256 different gamecaches in a map or something like that.
Its obviously large...but since there is a limit of 256 gamecaches per profile.....the triggers working on gamecache based systems will stop working or malfunction...because the systems will get "null" as an answer.....more info on this here.

And yea...HAIL looks nice....well off my way for VJass then.
 
Reaction score
333
Its obviously large...but since there is a limit of 256 gamecaches per profile.....the triggers working on gamecache based systems will stop working or malfunction...because the systems will get "null" as an answer.....more info on this here.

I have read the thread before but I have never encountered, or heard of anyone encountering, this bug under a normal set of circumstances and only rarely has it been discussed since it was first discovered. I suppose you might accidentally run into this bug if you played 256 different single player maps on a single profile, and they all created and saved different gamecaches, but it is really not worth even considering this as an argument against using gamecache in a map.
 

Romek

Super Moderator
Reaction score
963
That limit is only on single player. Where you can actually make profiles.
So if you play 256 campaigns (Or maps) on single player, then you will reach the limit.

In multiplayer, the caches are not saved, and thus, there is no limit.
 

Trithilon-V2

New Member
Reaction score
20
2: I dont know how structs work --- (are they global variables or just a collection of locals?)
They are implemented as globals.

Are you trying to say that you can use a lot of globals of gigantic sizes without any issues?

Like for instance i had attempted to make an attack detection system which failed to work due to a lot of arrays which were like 4000-5000 in sizes.
Acehart told me to reduce the sizes and the triggers started working.
So thats what i am trying to suggest.
 

Romek

Super Moderator
Reaction score
963
Arrays can only go up to an index of 8191.
Although things to boost this have been made :p
 

Trithilon-V2

New Member
Reaction score
20
Arrays can only go up to an index of 8191.
Although things to boost this have been made.
I know that and thats no an argument...the problem is the fact that there was this once that i used lots* of global arrays and my maps triggers stopped working.
Some variants of the map crashed WE during loading time.

* Lots = 8-12 arrays of 4000+ size
 
Reaction score
333
All arrays are the same size. It doesn't matter what you set the "size" field to in the variable editor, that only initializes part of the array to a given value.
 

Trithilon-V2

New Member
Reaction score
20
hmmm.....so if thats the case...why did the triggers in my map stop working....or even crashes map during load?
 
Reaction score
333
Compare these two functions, generated by the world editor to initialize a global array that was created in the variable editor. In the first case the array size field is set to 5000, and in the second it is set to 1:

JASS:
function InitGlobals takes nothing returns nothing
    local integer i= 0
    set i = 0
    loop
        exitwhen ( i > 5000 )
        set udg_SomeArray<i>=0
        set i = i + 1
    endloop
endfunction</i>

JASS:
function InitGlobals takes nothing returns nothing
    local integer i= 0
    set i = 0
    loop
        exitwhen ( i &gt; 1 )
        set udg_SomeArray<i>=0
        set i = i + 1
    endloop
endfunction</i>
 
Reaction score
333
If you needed to, yeah. It basically just loops through the array and sets each indexed value to the "initial value" you supply in the variable editor.
 

Trithilon-V2

New Member
Reaction score
20
Could you check this out?
what seems to be the problem.....
 

Attachments

  • Attack Detection System MOD.w3x
    36 KB · Views: 70

Expelliarmus

Where to change the sig?
Reaction score
48
I haven't looked through the whole thing, but I think you can reduce the loop by using PUI, otherwise set 4000 to MUIcounter. If your only finding the unit's index in the array, then PUI is a very efficient and good choice to handle this matter. You can still stick to GUI with NewGen if you use PUI, it's not necessary to convert to Custom Text.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      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