Skip to content

Group.SelectSubGroup ​

Signature ​

lua
Group.SelectSubGroup(Group g, int tp, function f, bool cancelable, [int min], [int max], ... any) -> Group|nil

Description ​

Lets tp select a subgroup from g with size between min and max that satisfies f. It respects already selected cards and returns nil if no valid selection is completed. Use Group.CheckSubGroup for the legality check, then SelectSubGroup where the player actually chooses the cards. If the chosen Group is stored for a later callback, call KeepAlive and later DeleteGroup. Use this for group-level requirements; use Group.FilterSelect for ordinary one-card filters.

How To Use It ​

Use this when the player must choose a subset that satisfies a group-level rule, not just individual card filters.

lua
local sg=g:SelectSubGroup(tp,s.goal,false,2,3)
if sg then
    Duel.SendtoGrave(sg,REASON_EFFECT)
end

Use the matching Group.CheckSubGroup shape in chk==0 legality checks so the real prompt only appears after activation is legal.

Parameters ​

  • g Group
  • tp int
  • f function
  • cancelable bool
  • min int optional
  • max int optional
  • ... any

Returns ​

  • Group|nil - The selected subgroup, or nil if no valid selection is completed.

Source ​

  • Utilities/utility.lua:1258

Guided Examples ​

Learn how to use this function in context:

Used By ​

Generated from the local Scripts/ folder and cards.cdb.

  • Detected in 648 indexed script(s).
  • Search this function in the Script Explorer with Group.SelectSubGroup.
CardIDScriptDetected Calls
Pendulum Evolution55795155Scripts/c55795155.lua1
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua1
Lady's Dragonmaid48658295Scripts/c48658295.lua1
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua1
Spellbook of the Grand Circle11911336Scripts/c11911336.lua1
Yomagna the Fire Phantom17350692Scripts/c17350692.lua1
Meteoroa Drytron24166324Scripts/c24166324.lua1
Performage Cup Tricker6812770Scripts/c6812770.lua1
Ehther the Heavenly Monarch96570609Scripts/c96570609.lua1
Pere-Zenet Em Heru46273941Scripts/c46273941.lua1
Am Duazenet45151304Scripts/c45151304.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
Prank-Kids Weather Washer44509529Scripts/c44509529.lua1
D/D/D/D Dimensional King Arc Crisis71398055Scripts/c71398055.lua1
D/D Count Surveyor5997110Scripts/c5997110.lua1
Shining Draw35906693Scripts/c35906693.lua1
Barian's Chaos Draw97769122Scripts/c97769122.lua2
Nekroz Kaleidoscope51124303Scripts/c51124303.lua1
Artmage Masterwork -Succession-37517035Scripts/c37517035.lua1
Enlightenment Dragon46186135Scripts/c46186135.lua1
Bujinki Ahashima71095768Scripts/c71095768.lua1
Ultimate Crystal Rainbow Dragon Overdrive84544192Scripts/c84544192.lua1
Chimera Fusion63136489Scripts/c63136489.lua1
Tellusion the Magna Warrior24431911Scripts/c24431911.lua1
...and 624 more

Script Examples ​

Pendulum Evolution (55795155) ​

Source: Scripts/c55795155.lua

lua
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
	aux.GCheckAdditional=aux.PendOperationCheck(ft1,ft2,ft)
	local g=tg:SelectSubGroup(tp,aux.TRUE,false,1,math.min(#tg,ft))
	aux.GCheckAdditional=nil
	if not g then

Levia-Dragoon - Daedalus (78579058) ​

Source: Scripts/c78579058.lua

lua
				Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
				local cancel=Duel.IsSummonCancelable()
				local sg=mg:SelectSubGroup(tp,s.LCheckGoal,cancel,minc,maxc,tp,c,gf,lmat)
				if sg then
					sg:KeepAlive()

Lady's Dragonmaid (48658295) ​

Source: Scripts/c48658295.lua

lua
	local g=Duel.GetMatchingGroup(s.fusfilter,cp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
	Duel.Hint(HINT_SELECTMSG,cp,HINTMSG_REMOVE)
	local sg=g:SelectSubGroup(cp,s.fselect,true,2,2)
	if sg then
		sg:KeepAlive()