| 06-09-2009, 10:31 AM | #1 | |
in auto index documentation, ive got this paragraph which i dont understand much Quote:
JASS:public function UnitFilter takes nothing returns boolean return true endfunction //Any units you filter out in this function will not be indexed by AutoIndex. //Use GetFilterUnit() to refer to the filtered unit. If you use Caster System //or xe, make sure to filter out the dummy units' typeid. |
| 06-09-2009, 10:50 AM | #2 |
JASS:public function UnitFilter takes nothing returns boolean return not GetUnitTypeId(GetFilterUnit())==YOUR_DUMMY_ID endfunction |
| 06-09-2009, 01:06 PM | #3 |
JASS:globals boolean array FILTERINDEX endglobals function HASH8191 takes integer I returns integer return I - (I / 8191)*8191 endfunction function INITFILTERARRAY takes nothing returns nothing set FILTERINDEX[HASH8191('Hfoo')] = true endfunction function FILTERBYARRAY takes nothing returns boolean return not FILTERINDEX[HASH8191(GetUnitTypeId(GetFilterUnit()))] endfunction This functions allow you to build fast and efficient filter system to handle unlimited number of unit types. vJass LARGE arrays allows to cover large number of typeids also you can add collusion handler (check code section for linked list) |
| 06-09-2009, 02:13 PM | #4 |
the question is: why would anyone need to filter more than a handful of unit types? |
| 06-09-2009, 03:11 PM | #5 |
JASS:public function UnitFilter takes nothing returns boolean return (GetUnitAbilityLevel(GetFilterUnit(), 'Aloc') == 0) endfunction |
| 06-10-2009, 09:57 AM | #6 | |
Quote:
so which comes first? autoindex's unit detection on map enter, or systems that adds locust ability to dummy units on creation? im just asking |
| 06-11-2009, 12:20 PM | #7 |
I suggest waiting 0.00001 second and add locust then. |
| 06-11-2009, 12:30 PM | #8 |
autoindex would come first. At the moment I suggest you don't waste a lot of time worrying about AutoIndex. All unit indexing might become useless once we benchmark hashtable and see how it compares in speed to UnitUserData. |
