| 11-09-2006, 10:03 PM | #2 |
I havent looked at the map but I dont understand what exactly this system does, maybe post some screenshots? |
| 11-09-2006, 10:08 PM | #3 |
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 JASS: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 |
| 11-10-2006, 04:54 AM | #4 |
Can't you use 'and' for that? |
| 11-10-2006, 11:21 AM | #5 |
'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. |
| 11-13-2006, 01:13 AM | #6 |
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 |
| 11-14-2006, 04:35 AM | #7 |
I still don't understand what this does. What's wrong with using and? JASS: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 |
| 11-14-2006, 01:50 PM | #8 |
ForGroup is actually faster than iterating with a loop, Vex proved that a while back. |
| 11-14-2006, 10:03 PM | #9 | |
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 |
| 11-15-2006, 03:40 AM | #10 |
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-15-2006, 05:58 AM | #11 |
Your ClearFilter function is bugged. It will currently do nothing because your loop exit condition has the sign going the wrong way. |
| 11-16-2006, 10:45 PM | #12 | |
Quote:
Eh woops, ill fix that right away |
| 11-17-2006, 04:47 AM | #13 |
Updated and is now fixed |
| 11-21-2006, 01:49 PM | #14 |
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. |
| 11-22-2006, 12:53 PM | #15 |
Eh, why that idea didn't come in my head? -_- Ty, for the sys. +rep. |
