DescriptionThis library aims to provide a simple way to attach data to units via unit indexing. It offers the minimal functions required to work. This library is the result of thinking about this proposal.

1.3: Added functionality to trigger a condition or a function when a unit is about to be removed from the game, via RemoveUnit() or when it dies. This can be useful when you need to do something with the unit about to be removed like clearing any data attachment done to it. I don't plan to add more features, only optimization unless a good reason makes merits to an addition.

- you can't use the function arguments of the hooked function, nor the returned value ...- if you want to use the hooked function inside the hook (and it's the case there) you have to do some silly stuff to avoid infinite recursivity.

The only way where hooks are "useful" is for debug stuff.

« Last Edit: December 14, 2012, 12:56:46 PM by Troll-Brain »

vJass is already a jass preprocessor, no need to (ab)use vJass features in order to make some inferior vJass preprocessor coded "by hand".

- you can't use the function arguments of the hooked function, nor the returned value ...- if you want to use the hooked function inside the hook (and it's the case there) you have to do some silly stuff to avoid infinite recursivity.

The only way where hooks are "useful" is for debug stuff.

Well, I was able to use hooks in the new version and it works like a charm. Please check first post and the test map.

Interesting, so such units trigger the summont event and it's equal to GetTriggerUnit ?Also you should null the "u" member on deallocate.

DId i've already said that i think this library is pointless ? :p

EDIT : And meh you're doing it wrong, i would expect that an unit keep the same data until it is removed of the game, even if it dies, and then revives.Actually it's not always the case. And the best way is to use the 'Adef' bug, so end of this resource ?

« Last Edit: January 07, 2013, 03:57:22 PM by Troll-Brain »

vJass is already a jass preprocessor, no need to (ab)use vJass features in order to make some inferior vJass preprocessor coded "by hand".

Interesting, so such units trigger the summont event and it's equal to GetTriggerUnit ?Also you should null the "u" member on deallocate.

Ok, added to 1.3...

Quote

DId i've already said that i think this library is pointless ? :p

In some way yes, but there's still some people who still loves to use this as attachment system... so I want to offer a simple version of this kind of tool.

Quote

EDIT : And meh you're doing it wrong, i would expect that an unit keep the same data until it is removed of the game, even if it dies, and then revives.Actually it's not always the case. And the best way is to use the 'Adef' bug, so end of this resource ?

Well, I thought this but at the end we have this idea: if a unit dies, the script removes the use of attach something and anything attached to it should be removed. If you (for ANY chance) can revive it, then the script will reassign an index to use it.

Actually I'm going to make available this feature and I don't expect to add more features.

I simply didn't understand what was your plan for the update.Now as i expected it fails, because when an unit dead it lost its index and that's 100 % wrong, not only because it can be resurrected but because then you can't use corpses ...Something like the demo spell i've made with my UnitLL resource will not work with your indexer behavior.

There is only 2 way for unit indexing : recycle periodically the ids (of removed units), or deindex it on remove "event", and this last one is much better because it gives you more possibilities and controls.

vJass is already a jass preprocessor, no need to (ab)use vJass features in order to make some inferior vJass preprocessor coded "by hand".

As Troll-Brain said, this needs to retain unit data while they're "out of scope".The only cool way is by taking advantage of the Defend bug (Credits to all the Wc3c people involved in discovering it (I think PurplePoot or Anitarf mostly?))

Oftopic; I have been looking for this "Defend Bug", I really want to know what it is, and what you could use it for, but I can't find anything about it (all I find is people having problem with the cap of 10.0 for it in the object editor)

Oftopic; I have been looking for this "Defend Bug", I really want to know what it is, and what you could use it for, but I can't find anything about it (all I find is people having problem with the cap of 10.0 for it in the object editor)

As far as I remember... 1. you have a unit, you do damage to it.2. With a damage detection, you add the defend ability to it before it dies and order him to defend3. The unit dies.4. If the unit decays or it really dissapear from the game it will trigger the undefend order, and this will help you to detect properly when it really has to be released from the indexing unit.

What's this site?

Here is the place where making your favorite games can be possible, with the support of a cordial and warm community. Here you will find resources that will help you develop your projects in an effective and agile way. In addition, you can show your projects, share your ideas or simply contribute with resources to establish bonds with a growing community, forming in the process the network of fanatic users to do Modding and mapping Warcraft 3.