Group.KeepAlive
Signature
lua
Group.KeepAlive(Group g) -> voidDescription
Prevents g from being automatically released by Lua until Group.DeleteGroup is called. Use this when a selected Group is stored on an Effect with SetLabelObject or otherwise needs to survive into a later callback. Pair it with Group.DeleteGroup when the delayed effect is done.
Parameters
gGroup- Group to preserve until DeleteGroup is called.
Source
D:\Programs\GitHub\ygopro-core\libgroup.cpp:901
Guided Examples
Learn how to use this function in context:
- Common Script Errors And Debugging
- Creation, Building, and Registration of an Effect Object
- Selection And Group Handling
- Special Summon-Only Monster Guide
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 285 indexed script(s).
- Search this function in the Script Explorer with
Group.KeepAlive.
Script Examples
Artmage Non-Finito (74631897)
Source: Scripts/c74631897.lua
lua
tc2:RegisterFlagEffect(id+o,RESET_EVENT+RESETS_STANDARD,0,1)
local sg=Group.FromCards(tc,tc2)
sg:KeepAlive()
e:SetLabelObject(sg)
return trueLevia-Dragoon - Daedalus (78579058)
Source: Scripts/c78579058.lua
lua
local sg=mg:SelectSubGroup(tp,s.LCheckGoal,cancel,minc,maxc,tp,c,gf,lmat)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return trueLady's Dragonmaid (48658295)
Source: Scripts/c48658295.lua
lua
local sg=g:SelectSubGroup(cp,s.fselect,true,2,2)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true