Group.FilterSelect
Signature
lua
Group.FilterSelect(Group g, int player, function f, int min, int max, [Card|Group|nil ex], ... any) -> GroupDescription
Lets player choose min to max cards from g that satisfy filter f, excluding ex, and returns the selected Group. Extra arguments after ex are passed to f after the Card argument. This is a selection from an existing Group, not an official Chain target selection.
How To Use It
Use this when you already have a Group, but only some cards in it should be selectable.
lua
local sg=g:FilterSelect(tp,s.filter,1,1,nil,e,tp)
if #sg>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
endThis is still an ordinary selection, not an official Chain target selection. Use Duel.SelectTarget during targeting effects.
Related Functions
Parameters
gGroupplayerintffunctionminintmaxintexCard|Group|niloptional...any
Returns
Group
Source
D:\Programs\GitHub\ygopro-core\libgroup.cpp:914
Guided Examples
Learn how to use this function in context:
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 241 indexed script(s).
- Search this function in the Script Explorer with
Group.FilterSelect.
Script Examples
Surprise Fusion (35167375)
Source: Scripts/c35167375.lua
lua
local srg=nil
local chk=Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil,tp,true)
srg=rg:FilterSelect(tp,s.cfilter,1,1,nil,tp,chk)
if srg and srg:GetCount()>0 then
local rc=srg:GetFirst()El Shaddoll Apkallone (50907446)
Source: Scripts/c50907446.lua
lua
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FMATERIAL)
g=mg:FilterSelect(tp,c50907446.FShaddollSpFilter1,1,1,nil,c,tp,mg,exg,chkf)
mg:Sub(g)
endPerformage Cup Tricker (6812770)
Source: Scripts/c6812770.lua
lua
if tg:GetCount()~=2 or not tg:IsExists(s.xyzfilter2,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,4))
local tg2=tg:FilterSelect(tp,s.xyzfilter2,1,1,nil)
tg:Sub(tg2)
local tc=tg2:GetFirst()