- Joined
- Nov 7, 2014
- Messages
- 571
What's the point of indexing systems and specifically "unit indexing systems" like (in no particular order): AutoIndex, UnitIndexer, AIDS, PUI
When the game does that for you (it reuses handle-ids), i.e:
Of course the map must NOT leak handle-ids (but that's somewhat easy, i.e null local variables that are handles and null struct members that are handles),
and the map doesn't have more than 8190 (dynamic handles (units, items, destructables, etc) at the same time), which is probably the case for most maps.
When the game does that for you (it reuses handle-ids), i.e:
set unit_index = H2I | GetHandleId(<unit-var>) - 0x00_10_00_00 // = 1_048_576 = MIN_HANDLE_ID
.0x00_10_00_00
should probably be the handle-id of the last "statically" allocated handle, i.e if you preload 2k+ timers, thenset MIN_HANDLE_ID = GetHandleId(timers[LAST_TIMER_INDEX])
or create trackables
thenset MIN_HANDLE_ID = GetHandleId(trackables[LAST_TRACKABLE_INDEX])
, etc.Of course the map must NOT leak handle-ids (but that's somewhat easy, i.e null local variables that are handles and null struct members that are handles),
and the map doesn't have more than 8190 (dynamic handles (units, items, destructables, etc) at the same time), which is probably the case for most maps.