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
964
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
964
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: 74

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.
  • 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 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 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