Skip to content

Group.FilterSelect ​

Signature ​

lua
Group.FilterSelect(Group g, int player, function f, int min, int max, [Card|Group|nil ex], ... any) -> Group

Description ​

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)
end

This is still an ordinary selection, not an official Chain target selection. Use Duel.SelectTarget during targeting effects.

Parameters ​

  • g Group
  • player int
  • f function
  • min int
  • max int
  • ex Card|Group|nil optional
  • ... 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.
CardIDScriptDetected Calls
Surprise Fusion35167375Scripts/c35167375.lua1
El Shaddoll Apkallone50907446Scripts/c50907446.lua3
Performage Cup Tricker6812770Scripts/c6812770.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
D/D Count Surveyor5997110Scripts/c5997110.lua1
Nekroz Kaleidoscope51124303Scripts/c51124303.lua1
Ursarctic Polar Star62714453Scripts/c62714453.lua1
Kewl Tune Crackle39576656Scripts/c39576656.lua2
Particle Fusion39261576Scripts/c39261576.lua1
Ostinato9113513Scripts/c9113513.lua4
Trickstar Light Arena63492244Scripts/c63492244.lua1
Black Dragon Ninja56562619Scripts/c56562619.lua1
Frightfur March74416026Scripts/c74416026.lua1
Power Tool Braver Dragon63265554Scripts/c63265554.lua1
Alba System Dogmatikalamity93053159Scripts/c93053159.lua2
Triamid Pulse96100333Scripts/c96100333.lua4
Amazement Administrator Arlekino94821366Scripts/c94821366.lua1
Exosisters Magnifica59242457Scripts/c59242457.lua1
R.B. Lambda Cannon81794107Scripts/c81794107.lua1
Hyperinvoked Aeon33166263Scripts/c33166263.lua1
Psychic Arsenal16238373Scripts/c16238373.lua1
Dragunity Arma Leyvaten63487632Scripts/c63487632.lua1
Kewl Tune Remix88170262Scripts/c88170262.lua1
Fydraulis Harmonia70088809Scripts/c70088809.lua1
...and 217 more

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)
	end

Performage 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()