![]() |
#1 |
Panda > You
|
![]() Advanced Filter System is a system that allows you to customize your filters before you use them. Instead of having to make a seperate function for each different filter to use with AFS you set some options before you use your Condition (filter) Changelog v1.20 Added conditional functions for if a filtered unit is in range of a point Added extra Remove Option Functions Added conditional functions for Unit State (i.e. if a unit has less then/less then or equal to/equal to/greater then or equal to/greater then a certain amount of max/current health/mana Check the official changelog for more information v1.11 Fixed a very stupid bug with ClearFilter, it now works properly v1.10 Just some minor changes for the code Features - Allows you to use Exception and Acceptance Functions for Unit Types, Races and Players - Also has FilterAlliance and FilterVisible/Non-Visible - Can use tokenized strings as these datatypes are constant integer As an example of how the system works, you would od something like this ![]() set dummyvariable = FilterAddExceptionUnitType(UNIT_TYPE_HERO) + FilterAlliance(1) //Use Your Filter Here with UseAFS as a Conditional Function call ClearFilter() This will filter out all units that are heroes and any friendly units Credits - Give credit when you use it in a public map - The Functions Readme uses the same Template as the Caster System made by Vexorian - The tokenize scripts code was taken from Vexorians Caster System Last edited by PandaMine : 12-04-2006 at 11:43 PM. Reason: Update |
![]() |
![]() |
Sponsored Links - Login to hide this ad! |
|
![]() |
#2 |
#8 in posting (nolifeftw)
Join Date: Jul 2005
Posts: 4,027
![]() ![]() ![]() ![]() |
![]() I havent looked at the map but I dont understand what exactly this system does, maybe post some screenshots?
|
![]() |
![]() |
![]() |
#3 |
Panda > You
|
![]() Well you do really need to look at the map but anyways here is a clear explanation
__________________When you want to use filters (i.e. boolexpr filter when setting a group) you would use a filter something like this ![]() function FilterEnemy takes nothing returns boolean return IsUnitEnemy(GetFilterUnit(),GetTriggerPlayer()) endfunction However when you want more options (i.e. Filter All Enemy Units, Only Include flying units owned by player 3 etc), intead of having to make a different function for each type of Filter this system allows you to set the a filter before you call it. Some people call filters conditions, they are the exact same thing but Filters are only used with groups Last edited by PandaMine : 11-09-2006 at 11:09 PM. |
![]() |
![]() |
![]() |
#4 |
Superuser
|
![]() Can't you use 'and' for that?
__________________ |
![]() |
![]() |
![]() |
#5 |
Nonchalant
Respected User
|
![]() 'unittype' and 'race' both extend handle, you don't need seperate return buggers for them, just use H2I.
__________________Your ClearFilter function does nothing atm. Instead of storing a boolean 'r' and checking it each time, just return false if any of the conditions is false. Other than that, I'm debating the usefulness of this. Mm. |
![]() |
![]() |
![]() |
#6 |
Panda > You
|
![]() Changed it so it uses H2I. Clear filter doesnt do anything in the test map because only one filter is being used, it cleans out the array which must be done. Changed it so it returns r if the condition is false
__________________The system may be more useful on some maps than others as I mentioned in the into |
![]() |
![]() |
![]() |
#7 |
Superuser
|
![]() I still don't understand what this does.
__________________What's wrong with using and? ![]() function AndTestC takes nothing returns boolean return IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == true and GetUnitState(GetTriggerUnit(), UNIT_STATE_LIFE) > 0 endfunction function AndTestA takes nothing returns nothing local unit u = GetEnumUnit() endfunction function Trig_And_Test_Actions takes nothing returns nothing call ForGroup( GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function AndTestC)), function AndTestA ) endfunction Last edited by Jazradel : 11-15-2006 at 04:42 AM. |
![]() |
![]() |
![]() |
#8 |
Oh for the sake of fudge
Respected User
|
![]() ForGroup is actually faster than iterating with a loop, Vex proved that a while back.
__________________ |
![]() |
![]() |
![]() |
#9 | |
Panda > You
|
![]() Quote:
The point of this system is not where you have simple Filters that have 1 or 2 conditions (such as using the and operator as you have shown) in which in the introduction to the system I have specifically stated. It is when you have more complicated combinations and possibilities, i.e. filter out all units that belong to a player that is a hero, undead and ranged that is invisible to a certain player. Not only that but the main point of the system is you do not have to create a seperate function for each different type of Filter. This system is similar to damage options in Vex's Caster System, but instead of damage options this system just filter's out groups. In later versions there will be more options such as if unit is in a group or belongs to a specific force. The system is definitly not as useless as you may think it is, i am currently a programmer for a map called RoW and it makes coding a hell of a lot faster and a lot less code |
|
![]() |
![]() |
![]() |
#10 |
Superuser
|
![]() Oh okay now I get it. I wouldn't use this personally but if your doing a lot of work with filters I can see how it would be useful.
__________________I know Vexorian proved ForGroup was faster but I don't like having to pass variables to it with globals, the gamecache, etc. |
![]() |
![]() |
![]() |
#11 |
Nonchalant
Respected User
|
![]() Your ClearFilter function is bugged. It will currently do nothing because your loop exit condition has the sign going the wrong way.
__________________ |
![]() |
![]() |
![]() |
#12 | |
Panda > You
|
![]() Quote:
Eh woops, ill fix that right away |
|
![]() |
![]() |
![]() |
#13 |
Panda > You
|
![]() Updated and is now fixed
__________________ |
![]() |
![]() |
![]() |
#14 |
Nonchalant
Respected User
|
![]() You don't need to double post that kind of stuff >.>
It's useful enough, so... approved. Oh, eh. Forgot this needs a picture. Please add one soon. Last edited by blu_da_noob : 11-21-2006 at 04:04 PM. |
![]() |
![]() |
![]() |
#15 |
User
|
![]() Eh, why that idea didn't come in my head? -_-
Ty, for the sys. +rep. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
|