System Advanced Indexing & Data Storage

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
surprised the system still gets attention. haven't seen a spell i can't live without that uses it...and it's overkill to do this crazy coding for every unit...u never dream of doing this crap on trees so why the special treatment for units?

best reason to use it would be it lets you use the damage system...can't you make a version that focuses solely on that?

we have multuple flavors of timerutils why not for aids like an aids that only supports the usage of damage system and does nothing else for example would be kinda nice...? or is it not so much different from current aids? or did someone already make a system or two like what i described?

Are you kidding? I think this, aside from a timer system is the system I use most in my maps.
 

Romek

Super Moderator
Reaction score
963
If you're not capable of seeing why indexing systems are good, then you're clearly not skilled enough to be using one anyway. In any case, it's not a problem with the system, but a problem with you. I'm confident that eventually you'l realise just how useful unit indexing systems are.

> u never dream of doing this crap on trees so why the special treatment for units?
How often do you store or do actions with trees?

> best reason to use it would be it lets you use the damage system...can't you make a version that focuses solely on that?
The purpose of this is to index units. It has a few little extras (which the Damage system uses anyway), but it all comes down to giving each unit a unique integer. You can't get any simpler than that.

> we have multuple flavors of timerutils why not for aids like an aids
Note to self: Add a strawberry and vanilla flavour for all systems regardless of whether they need it or not, just to keep some members happy.
 

tooltiperror

Super Moderator
Reaction score
231
>vanilla flavour for all systems
I'm listening :D

Also, AIDS is incredibly useful. I don't think you're good enough to understand its use.
JASS:

//! zinc
library SwapUnit {
    struct Data {
        static unit LastEnteredUnit;
        static boolean Entered;
        real x ;
        real y;

        method AIDS_onCreate() {
            if not Entered {
                Entered=not Entered;
                thistype.LastEnteredUnit=this.unit
                return;
            }
            this.x=GetUnitX(thistype.LastEnteredUnit);
            this.y=GetUnitY(thistype.LastEnteredUnit);
            SetUnitX(thistype.LastEnteredUnit,GetUnitX(this.unit));
            SetUnitY(thistype.LastEnteredUnit,GetUnitY(this.unit));
            SetUnitX(this.unit,this.x)
            SetUnitY(this.unit,this.y)
            thistype.LastEnteredUnit=this.unit;
        }
        method AIDS_onInit() {
            Entered=false;
            LastEnteredUnit=null;
        }
        //! runtextmacro AIDSZinc();
    }
}
//! endzinc
There may be (probably is) an error, but this took me a minute or two. How long would it take you if you had to handle all the triggers yourself and code it? Maybe 10 minutes, and that's not because it's hard, it's because it's annoying.
 

SanKakU

Member
Reaction score
21
>vanilla flavour for all systems
I'm listening :D

Also, AIDS is incredibly useful. I don't think you're good enough to understand its use.
JASS:
//! zinc
library SwapUnit {
    struct Data {
        static unit LastEnteredUnit;
        static boolean Entered;
        real x ;
        real y;

        method AIDS_onCreate() {
            if not Entered {
                Entered=not Entered;
                thistype.LastEnteredUnit=this.unit
                return;
            }
            this.x=GetUnitX(thistype.LastEnteredUnit);
            this.y=GetUnitY(thistype.LastEnteredUnit);
            SetUnitX(thistype.LastEnteredUnit,GetUnitX(this.unit));
            SetUnitY(thistype.LastEnteredUnit,GetUnitY(this.unit));
            SetUnitX(this.unit,this.x)
            SetUnitY(this.unit,this.y)
            thistype.LastEnteredUnit=this.unit;
        }
        method AIDS_onInit() {
            Entered=false;
            LastEnteredUnit=null;
        }
        //! runtextmacro AIDSZinc();
    }
}
//! endzinc
There may be (probably is) an error, but this took me a minute or two. How long would it take you if you had to handle all the triggers yourself and code it? Maybe 10 minutes, and that's not because it's hard, it's because it's annoying.

green panda bear in shopping cart can i ask you what you are proposing to use that bit of code for?


If you're not capable of seeing why indexing systems are good, then you're clearly not skilled enough to be using one anyway. In any case, it's not a problem with the system, but a problem with you. I'm confident that eventually you'l realise just how useful unit indexing systems are.
someone pushed the rude button on his word processor today? yes.
> u never dream of doing this crap on trees so why the special treatment for units?
How often do you store or do actions with trees?
don't change the subject. i'm talking about units, not trees.
> best reason to use it would be it lets you use the damage system...can't you make a version that focuses solely on that?
The purpose of this is to index units. It has a few little extras (which the Damage system uses anyway), but it all comes down to giving each unit a unique integer. You can't get any simpler than that.
if it's so simple then why is the code SOOOO long? have you seen itemdex? vexorian may not have written unit indexing, but he was smart enough to keep the system he did write for indexing simple.
> we have multuple flavors of timerutils why not for aids like an aids
Note to self: Add a strawberry and vanilla flavour for all systems regardless of whether they need it or not, just to keep some members happy.now your rudeness is just over the top. this isn't even your system. why don't you crawl out from under your umbrella of snobbery and we can have a REAL DISCUSSION?
responses in color.


It isn't doing much. Indexers are pretty light unless you are going to mass-spawn units. The thing they do is allow you to convert a unit's user data to a unique integer that is usable for arrays. (i.e. 0-8191 [and they also have some extra features, like controlling what happens on index/deindex... etc.]) Tbh, if you really don't care about speed and simplicity, just use hashtables. However, it can become annoying to manually get the kind of control that indexers have. :p
hmm...i don't know hashtables. can you point me in the direction of where i can learn them? i remember blizzard supporting them and reading the documentation that came with the patch update but i didn't understand anything.

if you want an idea of what systems i basically understand, check out my map the demon hunt tournament hosted at hiveworkshop. it's the most up to date version, and so i weeded out systems i don't use for their lack of purpose, so it excluded this system. at any rate, viewing the systems i am using in that should give you a starting point to understand what i understand. of course you can check out the other map referenced in the signature...but currently the trigger editor in that one is a big mess, so you might stumble around there.

last i checked thehelper bans use of signatures except for use by moderators, and i can frankly understand why with the way a lot of users would abuse it...but i wouldn't abuse the signature feature and i wish i could have the link up but that's the way it is...
Are you kidding? I think this, aside from a timer system is the system I use most in my maps.

no, i'm not kidding you, and if you are going to talk like that then i want some open source food, now!
please feed me your code!
 

tooltiperror

Super Moderator
Reaction score
231
>green panda bear in shopping cart can i ask you what you are proposing to use that bit of code for?
Every time a unit enters the map, it gets swapped with the unit that last entered the map.

>hmm...i don't know hashtables. can you point me in the direction of where i can learn them? i remember blizzard supporting them and reading the documentation that came with the patch update but i didn't understand anything.
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/

>no, i'm not kidding you, and if you are going to talk like that then i want some open source food, now!
His entire map script is online.
https://github.com/Darthfett/Forest-CTF

Can you please point out your argument, exactly? From what I understand, you are saying AIDS is not useful. But you don't seem to know vJASS very well. And that's not an attack on you, that's a fact.
 

NeuroToxin

New Member
Reaction score
46
If you're not capable of seeing why indexing systems are good, then you're clearly not skilled enough to be using one anyway. In any case, it's not a problem with the system, but a problem with you. I'm confident that eventually you'l realise just how useful unit indexing systems are.
someone pushed the rude button on his word processor today? yes.
> u never dream of doing this crap on trees so why the special treatment for units?
How often do you store or do actions with trees?
don't change the subject. i'm talking about units, not trees.
> best reason to use it would be it lets you use the damage system...can't you make a version that focuses solely on that?
The purpose of this is to index units. It has a few little extras (which the Damage system uses anyway), but it all comes down to giving each unit a unique integer. You can't get any simpler than that.
if it's so simple then why is the code SOOOO long? have you seen itemdex? vexorian may not have written unit indexing, but he was smart enough to keep the system he did write for indexing simple.
> we have multuple flavors of timerutils why not for aids like an aids
Note to self: Add a strawberry and vanilla flavour for all systems regardless of whether they need it or not, just to keep some members happy.now your rudeness is just over the top. this isn't even your system. why don't you crawl out from under your umbrella of snobbery and we can have a REAL DISCUSSION?

Buddy, you made some pretty idiotic things said, and you don't even capitalize right, He's also an administrator, so he can say whatever the hell he wants. I personally was as ignorant as you were until I actually used it. Also, Green panda Bear is not his name. Its tooltiperror, Respect your seniors bud.
 

Nestharus

o-o
Reaction score
84
Ok... let's say that you want to attach something to a unit. Remember the old handle attachment with H2I and etc?

There are two ways to do that... one way is to use the unit's user data ([ljass]SetUnitUserData[/ljass]) and the other way is to do it via a hashtable/table [ljass]call SaveInteger(myHashtable,GetHandleId(myUnit),0,value)[/ljass]

Now, the hashtable call with the get handle id call is obviously way slower... the load call is also way slower than the equivalent [ljass]GetUnitUserData[/ljass] call.

By giving all unit's on the map a unique id stored in the user data, one can then attach structs via that id where the struct's instance is that id. This speeds the map up a bit and is actually very lightweight (the indexing/deindexing have a very small overhead).

Virtually all maps attach something to a unit, meaning that virtually all maps use some sort of unit indexer, whether that be AutoIndex, AIDS, or UnitIndexer.

So it's not just about damage... you could attach whatever to a unit from a custom buff in a spell to a custom inventory to just random data like the unit's quest info or something... any time you want to attach data to a unit, you use a unit indexer =).

There have been attempts at an item indexer, but there won't be a good one until Bribe finishes his little project =P.
 

SanKakU

Member
Reaction score
21
Ok... let's say that you want to attach something to a unit. Remember the old handle attachment with H2I and etc?

There are two ways to do that... one way is to use the unit's user data ([ljass]SetUnitUserData[/ljass]) and the other way is to do it via a hashtable/table [ljass]call SaveInteger(myHashtable,GetHandleId(myUnit),0,value)[/ljass]

Now, the hashtable call with the get handle id call is obviously way slower... the load call is also way slower than the equivalent [ljass]GetUnitUserData[/ljass] call.

By giving all unit's on the map a unique id stored in the user data, one can then attach structs via that id where the struct's instance is that id. This speeds the map up a bit and is actually very lightweight (the indexing/deindexing have a very small overhead).

Virtually all maps attach something to a unit, meaning that virtually all maps use some sort of unit indexer, whether that be AutoIndex, AIDS, or UnitIndexer.

So it's not just about damage... you could attach whatever to a unit from a custom buff in a spell to a custom inventory to just random data like the unit's quest info or something... any time you want to attach data to a unit, you use a unit indexer =).

There have been attempts at an item indexer, but there won't be a good one until Bribe finishes his little project =P.
i didn't even know thehelper had war3 editor help back when that was popular. i was busy struggling with learning jass by the time the patch that released hashtables came out.
>green panda bear in shopping cart can i ask you what you are proposing to use that bit of code for?
Every time a unit enters the map, it gets swapped with the unit that last entered the map.

>hmm...i don't know hashtables. can you point me in the direction of where i can learn them? i remember blizzard supporting them and reading the documentation that came with the patch update but i didn't understand anything.
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/hashtables-mui-133407/

>no, i'm not kidding you, and if you are going to talk like that then i want some open source food, now!
His entire map script is online.
https://github.com/Darthfett/Forest-CTF

Can you please point out your argument, exactly? From what I understand, you are saying AIDS is not useful. But you don't seem to know vJASS very well. And that's not an attack on you, that's a fact.
ok so my argument is you can make a map just fine without aids? check my map, it's without bugs and isn't even version 1.0 yet. meanwhile we have this admission from darthfett about his map which you linked me to:
"Currently the game is version 2.0 alpha. It's not in any way ready for testing, and has many bugs and unimplemented \
features. If the code is currently in a compilable state, you can play the game as a preview of what is to come."
and you have the audacity to question my argument? lol. go you. you're running in the wrong direction, btw.

oh and, thanks for the link. this is actually fascinating what he posted.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
ok so my argument is you can make a map just fine without aids? check my map, it's without bugs and isn't even version 1.0 yet. meanwhile we have this admission from darthfett about his map which you linked me to:
"Currently the game is version 2.0 alpha. It's not in any way ready for testing, and has many bugs and unimplemented \
features. If the code is currently in a compilable state, you can play the game as a preview of what is to come."
and you have the audacity to question my argument? lol. go you. you're running in the wrong direction, btw.

The map is unfinished because at one point it was working, but is in the process of having a very complicated AI, as well as being overhauled. There was a working version that used AIDS, and was fun. It's possible to make anything without any resources, it merely means hardcoding everything you need into the map, which means your code is either reinventing the wheel, or just completely not reusable.
 

Romek

Super Moderator
Reaction score
963
> someone pushed the rude button on his word processor today? yes.
Would that be referring to me?

> don't change the subject. i'm talking about units, not trees.
That's quite immature. You quite clearly started talking about trees in the quote I replied to.

> if it's so simple then why is the code SOOOO long? have you seen itemdex? vexorian may not have written unit indexing, but he was smart enough to keep the system he did write for indexing simple.
It's simple to use. There's effectively only one function that's exported in the system. How the code actually works is irrelevant, though you can be sure it works well.

> last i checked thehelper bans use of signatures except for use by moderators, and i can frankly understand why with the way a lot of users would abuse it.
Signatures aren't banned for anyone. It's something you earn around the forums for being helpful and for contributing positively. Moderators and higher get signatures by default, of course. Though the majority of members with signatures aren't moderators.

Also, stop being so childish. You still seem to be under the impression that any code that is long or that you can't understand is rubbish. You have no reason to bash any systems, especially if you don't know what it does (take a hint from other members that are quite happy with it?). Not every system here is an absolute necessity in every map you make either, so if you can't find a use for something, chances are you simply don't need it. Also, being rude to those that help you isn't the way forward. As somebody mentioned before, we're not out to get you. Quite the opposite in fact - we're here to help. You're not going to learn much if you believe you're superior to everyone else here either.
Cut it out.
 

Rllulium

New Member
Reaction score
10
Oh god damnit, I've used this library hundreds of times before, why does it throw syntax errors at me when I try to import it...

I can't live... err, map... without this Library!

EDIT: Oops, silly me. Guess I shouldn't lament my fate before I really need help.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Gah, you're all making me read so much!! XD

In regards to the AIDS flavouring, AIDS was originally written to support Damage, and almost all the functionality in AIDS is, in fact, used in Damage. If you look closely, there is flavouring in AIDS. There's the use periodic timer option. Depending on whether you use it or not, one chunk of code is essentially removed/unused. The irony is that this "flavouring" of sorts is what makes the code large, which was the suggestion you listed next to wondering why the code is large/complex. :p

AIDS automates creation/cleanup of unit data and things attached to units, which is why it is important to many mappers. Damage, for example, uses it to attach a trigger to each unit automatically (without which the functionality of Damage is not possible). It is nice because it also cleans up the data at the right time without having to write the code to hook units being removed and manage the cleanup so much yourself. That's why at high levels of mapping, AIDS is a good convenience. :)
 

luorax

Invasion in Duskwood
Reaction score
67
Gah, you're all making me read so much!! XD

In regards to the AIDS flavouring, AIDS was originally written to support Damage, and almost all the functionality in AIDS is, in fact, used in Damage. If you look closely, there is flavouring in AIDS. There's the use periodic timer option. Depending on whether you use it or not, one chunk of code is essentially removed/unused. The irony is that this "flavouring" of sorts is what makes the code large, which was the suggestion you listed next to wondering why the code is large/complex. :p

AIDS automates creation/cleanup of unit data and things attached to units, which is why it is important to many mappers. Damage, for example, uses it to attach a trigger to each unit automatically (without which the functionality of Damage is not possible). It is nice because it also cleans up the data at the right time without having to write the code to hook units being removed and manage the cleanup so much yourself. That's why at high levels of mapping, AIDS is a good convenience. :)

Where's the like button? :D

BTW this system is one of the most useful system ever made. I use it each time I create a system that works with units: vertex colors, taunt, inventory, spell books.... the list is endless.
 

vuongkkk

New Member
Reaction score
1
JASS:
function GetUnitIndex takes unit u returns integer


This function does not have any filter. Why, Jesus4Lyf?
When a unit enter map, your sys have a filter to prevent massive indexing at func IndexEnum (To exclude unexpected unit from this system)

JASS:
private function UnitIndexingFilter takes unit u returns boolean


I supposes this function is the rule for the entire of AIDS. Should you place this filter func at function GetUnitIndex too?
Or I misunderstood your mean, didnt I ?
 

Bribe

vJass errors are legion
Reaction score
67
I think you misunderstand. GetUnitId should always be used, not GetUnitIndex. GetUnitIndex should only be used if you want to index a previously-filtered unit.
 

vuongkkk

New Member
Reaction score
1
OK, what should I use if i want to index a placed unit in WE? In this case, use GetUnitId with debug mode you can see AIDS error mes ;)
 

Bribe

vJass errors are legion
Reaction score
67
GUI-placed units are indexed by this system.

1. Are you using SetUnitUserData in any other part of the map?
2. Are you calling GetUnitId from a library which initializes before AIDS?

If you change your GetUnitId calls to after map-initialization, and that fixes the problem, then that means that the latter is the problem. You need to have your library require AIDS. I'm not sure if GetUnitId will return 0 with AIDS if called from a module initializer.
 

mysteriis

New Member
Reaction score
0
Im really interested in using this, but everytime I save the map with the "//! external ObjectMerger w3a Adef AIDS anam "State Detection" ansf "(AIDS)" aart "" arac 0" line it shows THIS ERROR, although it saves the map.

Tried with JNPG 5d, and 6a, excluding and reinstalling multiple times and got the same. No antivirus or anything that could possibly interfere.

Please, tell me whats this error about and the most important, is the system going to work or not with this error, and how can I fix it.

Thanks in advance.
 

tooltiperror

Super Moderator
Reaction score
231
Delete the "!" at the start of the line as if it were a comment so that it does not get executed.

Then, open the AIDS dummy map and copy the ability from that map into yours.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top