System Advanced Indexing & Data Storage

Monovertex

Formerly Smith_S9
Reaction score
1,461
Please bear with my noobiness, as I am only mapping for the tower contest at the moment. I have 2 questions:

Is this using the userdata field of units? I need a system that is not doing that.

Why do I get a Syntax Error on every line with "static if ... then"?
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
Hmm, what should I do then? I have the NewGen editor from the official thread in the WEH forum.

EDIT: Just to make sure, I redownloaded NewGen from Wc3C. Still getting the error.
 

13lade619

is now a game developer :)
Reaction score
398
the Jasshelper included in 1.5d is outdated.

http://www.wc3c.net/showthread.php?t=88142

there. just follow the download on the end of the post.

Vexorian said:
Easiest way to setup jasshelper with grimoire is by downloading the Jass NewGen pack and then just update its jasshelper.exe to the one included in this release.
 

Jesus4Lyf

Good Idea™
Reaction score
397
[edit] Lulz, workaround:
Not guaranteed to work - you should check to see if the struct creation was already successful, incase a unit is made after TU inits. :)

>Is this using the userdata field of units? I need a system that is not doing that.
Then why do you need a system at all. That's the point...
And yes, JassHelper update issue. ;)
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
Yeah, that did it. Thanks!

However, it uses the User Data xD. So I can't use it with my current method, I need to change the method I use >.<...

@Jesus: well, Ghan used the data field of his creeps in the contest map, so if I want to use indexing with them, it gets screwed up. And I would like to use his map, as he asked us to do. Meh :p.

EDIT: Nevermind, found another way to solve the problem. And since I already put AIDS in the map, I'll just use it, too lazy to change it back or something xD.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Not guaranteed to work - you should check to see if the struct creation was already successful, incase a unit is made after TU inits. :)
Isn't it? After all, there's an if referring to a global boolean that keeps them from initializing until that timer runs. And since it's to start a timer, there's no worry if a unit is created and removed before that comes to pass.

@Jesus: well, Ghan used the data field of his creeps in the contest map, so if I want to use indexing with them, it gets screwed up. And I would like to use his map, as he asked us to do. Meh :p.

EDIT: Nevermind, found another way to solve the problem.
Well, he did say we can change the map to allow for indexers. If you'd like (despite finding a fix on your own), I've posted a UnitUserData-free version of the template map that I made.
 

Monovertex

Formerly Smith_S9
Reaction score
1,461
As I said in the original thread, thank you for the map, but, as I said in this thread :)P), I already found a way around, which even proved itself more efficient :D.

Sorry for the off-topic, J4L.
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Well, it seems not even KT supports starting a timer on AIDS_onCreate for preplaced units. :( (In the end, I shouldn't use TU because it still has a limited amount of timers in hashtable mode, and the default is 256, not nearly enough to have one or more per unit on the map.)

[edit] I was mistaken; KT just needs to be before AIDS in the map (or, [ljass]library AIDS uses optional KT[/ljass]).
[edit 2] OK, what's going on? I swear I tried [ljass]library AIDS uses optional TimerUtils[/ljass] before and it didn't work. Doesn't work for AutoIndex, though.
[edit 3] Mistaken again; it doesn't work simply if KT/TU is before AIDS in the map. Consider adding [ljass]library AIDS uses optional KT, optional TimerUtils[/ljass]?

JASS:
library Ktest requires KT, AIDS
	struct Test extends array
		private static method periodic takes nothing returns boolean
			local unit u = thistype(KT_GetData()).unit
			call BJDebugMsg(GetUnitName(u))
			return false
		endmethod
		method AIDS_onCreate takes nothing returns nothing
			call KT_Add(function thistype.periodic, this, .2)
		endmethod
		
		//! runtextmacro AIDS()
	endstruct
endlibrary
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Hmm, try this, perhaps?

If you are speed freak, try (Optimized by me, :p):
JASS:
library_once TimerUtils

    globals
        private integer array Data
        private timer array Timer
        private integer tid
    endglobals
    
    function SetTimerData takes timer t, integer value returns nothing
        set tid = GetHandleId(t)
        set Data[tid - (tid / 8191) * 8191] = value
    endfunction

    function GetTimerData takes timer t returns integer
        set tid = GetHandleId(t)
        return Data[tid - (tid / 8191) * 8191]
    endfunction

    globals
        private integer array tH
        private integer tN = 0
        private constant integer HELD=0x28829022
        //use a totally random number here, the more improbable someone uses it, the better.
    endglobals

    function NewTimer takes nothing returns timer
     local timer t
        if (tN == 0) then
            loop
                set t = CreateTimer()
                set tid = GetHandleId(t)
                set tH[0] = tid - (tid / 8191) * 8191
                exitwhen Timer[tH[0]] == null
            endloop
            set Timer[tH[0]] = t
        else
            set tN = tN - 1
        endif
        set Data[tH[tN]] = 0
     return Timer[tH[tN]]
    endfunction

    function ReleaseTimer takes timer t returns nothing
        set tid = GetHandleId(t)
        set tid = tid - (tid / 8191) * 8191
        if (t == null) then
            debug call BJDebugMsg(&quot;Warning: attempt to release a null timer&quot;)
            return
        endif
        debug if (Timer[tid] != t) then
        debug     call BJDebugMsg(&quot;ReleaseTimer: Wrong handle id, only use ReleaseTimer on timers created by NewTimer&quot;)
        debug endif
        call PauseTimer(t)
        set tH[tN] = tid
        if (Data[tH[tN]] == HELD) then
            debug call BJDebugMsg(&quot;Warning: ReleaseTimer: Double free!&quot;)
            return
        endif
        set Data[tH[tN]] = HELD
        set tN = tN + 1
    endfunction

endlibrary
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Am I correct in my discovery that using addLock on any AIDS struct will put off onDestroy of every AIDS struct? :( That puts a crimp in my plans to have one locked struct with a "removed" boolean, and one unlocked struct that changes that boolean in its onDestroy method, in order to use KT2.
 

Jesus4Lyf

Good Idea™
Reaction score
397
If you are speed freak, try (Optimized by me, :p):
How is that optimised at all? -_-
Am I correct in my discovery that using addLock on any AIDS struct will put off onDestroy of every AIDS struct?
Correct. The method I used in MSX which I linked you works, though.

KT2 can be fixed to have its initialisation run earlier if need be. JassHelper updates have caused this.

I don't think I would use KT2 for something that needs to be stopped from outside of its callback...
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
At this point, the discussion probably should move to the KT2 thread, but since it started here:

I don't think I would use KT2 for something that needs to be stopped from outside of its callback...
It's because aside from that, KT2 is just about perfect for my purpose, which requires at least one timer per unit on the map started at unit creation and stopped at unit removal, at a non-T32 rate, with multiple callbacks. TimerUtils has only one callback per period and would run out of timers at its default settings anyway; KT2 would do the callbacks efficiently, but has problems with starting and stopping, and starting for onCreate with preplaced units with either AIDS or AutoIndex (and yes, I do want to maintain that flexibility).

There doesn't seem to be a timer system that works well for this, so I'm left to create an integrated system with semi-dynamic triggers and timers. Go figure that the first thing I try to create in vJASS ends up being a headache...
 

tooltiperror

Super Moderator
Reaction score
231
I recommend that you add the specifications for the ability at the top of the script to the documentation for Mac Users, since we can't Object Merger.

You know, since some people might not want to copy it from the demo map.
 

Jesus4Lyf

Good Idea™
Reaction score
397
I recommend that you add the specifications for the ability at the top of the script to the documentation for Mac Users, since we can't Object Merger.

You know, since some people might not want to copy it from the demo map.
The specifications are clearly in the code as well as the demo map.
JASS:
//!          external ObjectMerger w3a Adef AIDS anam &quot;State Detection&quot; ansf &quot;(AIDS)&quot; aart &quot;&quot; arac 0

So I don't know what you're asking. :)
 

kingkingyyk3

Visitor (Welcome to the Jungle, Baby!)
Reaction score
216
Copy the "State Detection" ability to your map or just use periodic recycler.
 

Laiev

Hey Listen!!
Reaction score
188
hmm

how replace some function in AutoIndex to AIDS (to use AIDS), because some systems need it... and AIDS ins't compatible :(

example: AutoData, AutoCreate, and AutoDestroy modules
 

Jesus4Lyf

Good Idea™
Reaction score
397
There is a discrepancy in design between AutoIndex and AIDS.

AutoIndex believes structs should be destroyed just before the unit leaves the game.
AIDS believes structs should be destroyed when you're done with them (see locking).
The difference being being able to access the unit from the struct when it is destroyed as the unit leaves.

This means the two can never truly replaces the others' functionality. Or at least not natively.

One of us would need to spend a reasonable deal of work trying to replicate the functionality of the other.

If you don't actually care about that, it is possible for the functionality to be written to make them replacable... but someone has to do it, I guess. I don't know what AutoData is yet, I assume all the functionality you listed is covered in AIDS structs somewhere.

May I ask what it is you need AutoIndex functionality for?
 
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

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top