SerraAvenger
Cuz I can
- Reaction score
- 234
A simplistic indexing library. Please use this together with an interface, don't use these functions directly.
API
SUI_GetUnitIndex( u ) -> int, Gets a unique index for every unit. If the unit previously had none, a new one will be allocated.
SUI_GetUnitByIndex( i ) -> unit, returns a unit associated with the index such that u == SUI_GetUnitByIndex( SUI_GetUnitIndex( u ) ) always holds true. Thanks to Jesus4Lyf for this idea!
SUI_GetCustomValue() -> int, returns a new, unique custom value every time it is called.
Restrictions
Only 400 units that had custom indicies may be dead at a time
Only 2048 units that have custom indicies may be in a map at any time.
The custom value with the id "IdentificationIndex" may not be used. By default, the IdentificationIndex is 1337.
If those doesn't work for you (for any possible reason), just change the values.
This work is published under the NonCommercial Sampling Plus CreativeCommons license.
Please also see...
UnitIndexing, the interface this is meant to be used with.
FAQ
Q<HELP! Everything is only "Untitled blabla"! I can't use this!
A>That is normal. You are probably in standard GUI mode. In order to see function & variable names, press Ctrl+D (raw mode). HOWEVER that is only if you want to look at the code. If you want to use this library, go to UnitIndexing and follow the steps under "how to use this?">SerraUnitIndexing. Don't use functions from this library (or any Indexer) directly. ESPECIALLY if you're coding your own library.
ChangeLog
6/18/2010 - Added UnitGetByIndex(). Fixed a little bit of stuff such that the changeable variables are visible from standard GUI. V0.3
6/11/2010 - Fixed recycling bug. V0.2
API
SUI_GetUnitIndex( u ) -> int, Gets a unique index for every unit. If the unit previously had none, a new one will be allocated.
SUI_GetUnitByIndex( i ) -> unit, returns a unit associated with the index such that u == SUI_GetUnitByIndex( SUI_GetUnitIndex( u ) ) always holds true. Thanks to Jesus4Lyf for this idea!
SUI_GetCustomValue() -> int, returns a new, unique custom value every time it is called.
Restrictions
Only 400 units that had custom indicies may be dead at a time
Only 2048 units that have custom indicies may be in a map at any time.
The custom value with the id "IdentificationIndex" may not be used. By default, the IdentificationIndex is 1337.
If those doesn't work for you (for any possible reason), just change the values.
This work is published under the NonCommercial Sampling Plus CreativeCommons license.
Please also see...
UnitIndexing, the interface this is meant to be used with.
FAQ
Q<HELP! Everything is only "Untitled blabla"! I can't use this!
A>That is normal. You are probably in standard GUI mode. In order to see function & variable names, press Ctrl+D (raw mode). HOWEVER that is only if you want to look at the code. If you want to use this library, go to UnitIndexing and follow the steps under "how to use this?">SerraUnitIndexing. Don't use functions from this library (or any Indexer) directly. ESPECIALLY if you're coding your own library.
ChangeLog
6/18/2010 - Added UnitGetByIndex(). Fixed a little bit of stuff such that the changeable variables are visible from standard GUI. V0.3
6/11/2010 - Fixed recycling bug. V0.2