wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Samples
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 11-09-2006, 09:57 PM   #1
PandaMine
Panda > You
 
PandaMine's Avatar
 
Join Date: May 2006
Posts: 500

Submissions (4)

PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)

Send a message via MSN to PandaMine
Default Advanced Filter System

NOTE: You have been redirected in order for our attachments to be made available to you. This will only last two minutes; these measures where taken to avoid hotlinking and bandwidth theft.
To avoid these restrictions Log in or Register

Zoom (requires log in)
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

Collapse JASS:
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
Attached Images
File Type: jpg Prism_by_digitalgecko.jpg (3.3 KB, 1554 views)
Attached Files
File Type: w3x Advanced Filter System v1.20.w3x (30.1 KB, 788 views)
__________________
PandaMine's Creations:

Last edited by PandaMine : 12-04-2006 at 10:43 PM. Reason: Update
PandaMine is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 11-09-2006, 10:03 PM   #2
Taur
#8 in posting (nolifeftw)
 
Join Date: Jul 2005
Posts: 4,027

Taur is a jewel in the rough (215)Taur is a jewel in the rough (215)Taur is a jewel in the rough (215)Taur is a jewel in the rough (215)

Default

I havent looked at the map but I dont understand what exactly this system does, maybe post some screenshots?
Taur is offline   Reply With Quote
Old 11-09-2006, 10:08 PM   #3
PandaMine
Panda > You
 
PandaMine's Avatar
 
Join Date: May 2006
Posts: 500

Submissions (4)

PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)

Send a message via MSN to PandaMine
Default

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
Collapse 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
__________________
PandaMine's Creations:

Last edited by PandaMine : 11-09-2006 at 10:09 PM.
PandaMine is offline   Reply With Quote
Old 11-10-2006, 04:54 AM   #4
Jazradel
Superuser
 
Jazradel's Avatar
 
Join Date: Dec 2005
Posts: 651

Submissions (1)

Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)

Send a message via AIM to Jazradel Send a message via MSN to Jazradel
Default

Can't you use 'and' for that?
__________________


Table:
Jump Map
Point System
Warcraft III Model Archive

W3 Model Archive should be available from https://www.mediafire.com/folder/cd5..._III_Resources, PM me if it doesn't work.
Jazradel is offline   Reply With Quote
Old 11-10-2006, 11:21 AM   #5
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

'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.
__________________
blu_da_noob is offline   Reply With Quote
Old 11-13-2006, 01:13 AM   #6
PandaMine
Panda > You
 
PandaMine's Avatar
 
Join Date: May 2006
Posts: 500

Submissions (4)

PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)

Send a message via MSN to PandaMine
Default

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
__________________
PandaMine's Creations:
PandaMine is offline   Reply With Quote
Old 11-14-2006, 04:35 AM   #7
Jazradel
Superuser
 
Jazradel's Avatar
 
Join Date: Dec 2005
Posts: 651

Submissions (1)

Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)

Send a message via AIM to Jazradel Send a message via MSN to Jazradel
Default

I still don't understand what this does.

What's wrong with using and?
Collapse 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
And if you use the loop method you don't need filters at all.
__________________


Table:
Jump Map
Point System
Warcraft III Model Archive

W3 Model Archive should be available from https://www.mediafire.com/folder/cd5..._III_Resources, PM me if it doesn't work.

Last edited by Jazradel : 11-15-2006 at 03:42 AM.
Jazradel is offline   Reply With Quote
Old 11-14-2006, 01:50 PM   #8
Chuckle_Brother
Oh for the sake of fudge
 
Chuckle_Brother's Avatar


Respected User
 
Join Date: Dec 2005
Posts: 782

Submissions (2)

Chuckle_Brother will become famous soon enough (53)Chuckle_Brother will become famous soon enough (53)

Send a message via ICQ to Chuckle_Brother Send a message via AIM to Chuckle_Brother Send a message via MSN to Chuckle_Brother Send a message via Yahoo to Chuckle_Brother
Default

ForGroup is actually faster than iterating with a loop, Vex proved that a while back.
__________________
"...you play a mean banjo"
Chuckle_Brother is offline   Reply With Quote
Old 11-14-2006, 10:03 PM   #9
PandaMine
Panda > You
 
PandaMine's Avatar
 
Join Date: May 2006
Posts: 500

Submissions (4)

PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)

Send a message via MSN to PandaMine
Default

Quote:
Originally Posted by Jazradel
I still don't understand what this does.

What's wrong with using and?
Collapse 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
Not that you should use ForGroup when you can use the loop method.

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
__________________
PandaMine's Creations:
PandaMine is offline   Reply With Quote
Old 11-15-2006, 03:40 AM   #10
Jazradel
Superuser
 
Jazradel's Avatar
 
Join Date: Dec 2005
Posts: 651

Submissions (1)

Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)Jazradel has a spectacular aura about (110)

Send a message via AIM to Jazradel Send a message via MSN to Jazradel
Default

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.
__________________


Table:
Jump Map
Point System
Warcraft III Model Archive

W3 Model Archive should be available from https://www.mediafire.com/folder/cd5..._III_Resources, PM me if it doesn't work.
Jazradel is offline   Reply With Quote
Old 11-15-2006, 05:58 AM   #11
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

Your ClearFilter function is bugged. It will currently do nothing because your loop exit condition has the sign going the wrong way.
__________________
blu_da_noob is offline   Reply With Quote
Old 11-16-2006, 10:45 PM   #12
PandaMine
Panda > You
 
PandaMine's Avatar
 
Join Date: May 2006
Posts: 500

Submissions (4)

PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)

Send a message via MSN to PandaMine
Default

Quote:
Originally Posted by blu_da_noob
Your ClearFilter function is bugged. It will currently do nothing because your loop exit condition has the sign going the wrong way.

Eh woops, ill fix that right away
__________________
PandaMine's Creations:
PandaMine is offline   Reply With Quote
Old 11-17-2006, 04:47 AM   #13
PandaMine
Panda > You
 
PandaMine's Avatar
 
Join Date: May 2006
Posts: 500

Submissions (4)

PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)PandaMine has a spectacular aura about (96)

Send a message via MSN to PandaMine
Default

Updated and is now fixed
__________________
PandaMine's Creations:
PandaMine is offline   Reply With Quote
Old 11-21-2006, 01:49 PM   #14
blu_da_noob
Nonchalant
 
blu_da_noob's Avatar


Respected User
 
Join Date: Mar 2006
Posts: 1,933

Submissions (2)

blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)blu_da_noob is just really nice (398)

[Quicksilver #2] - 2nd Place[Quicksilver#1] 1st place

Send a message via MSN to blu_da_noob
Default

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 03:04 PM.
blu_da_noob is offline   Reply With Quote
Old 11-22-2006, 12:53 PM   #15
ArchWorm
User
 
ArchWorm's Avatar
 
Join Date: May 2006
Posts: 249

ArchWorm is on a distinguished road (14)

Send a message via ICQ to ArchWorm
Default

Eh, why that idea didn't come in my head? -_-
Ty, for the sys. +rep.
ArchWorm is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 06:36 PM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services