Duel.SetOperationInfo
Signature
Duel.SetOperationInfo(int chainc, int category, Card|Group|nil targets, int count, int player, int param) -> voidDescription
Records operation information for category on chainc. Use concrete targets and count when the affected cards are known. For unresolved non-targeting movement effects, pass nil targets with the expected count, target player, and target location. For LP effects, target_player is the affected player and target_param is the amount. This information announces intent; it does not perform the operation or create official card targets.
How To Use It
Call this in the Target callback when the Chain Link can announce a category, affected cards or players, count, amount, or source location.
Known targets can be passed directly:
local g=Duel.SelectTarget(tp,s.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)For unresolved movement from a location, pass nil for targets and use target_player plus target_param as the location or amount:
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,800)This announces intent; the operation still has to recheck legality and perform the actual action.
Related Functions
Parameters
chaincint- Chain index/count passed to the core chain lookup; scripts commonly use 0 for the current Chain Link.categoryint- CATEGORY_* operation category to record.targetsCard|Group|nil- Known affected cards. Card or Group values are cloned into a read-only Group; nil records only count, player, and param.countint- Expected number of affected cards.playerint- Target player stored in the operation info.paramint- Category-specific value, commonly a destination location, amount, or other operation parameter.
Source
D:\Programs\GitHub\ygopro-core\libduel.cpp:5008
Guided Examples
Learn how to use this function in context:
- Methods for Affecting Cards
- Beginner Script Ladder
- Categories, Properties, And Hint Timing
- Chain Timing And Activation Windows
- Client UI And Prompt Behavior
- Common Script Errors And Debugging
More guided lessons (11)
Used By
Generated from the local Scripts/ folder and cards.cdb.
- Detected in 10772 indexed script(s).
- Search this function in the Script Explorer with
Duel.SetOperationInfo.
Script Examples
Salamandra with Chain (62091148)
Source: Scripts/c62091148.lua
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function s.posfilter(c)Astrograph Sorcerer, the Starfrost Magician (48171151)
Source: Scripts/c48171151.lua
if chk==0 then return c:IsDestructable()
and Duel.IsExistingMatchingCard(s.pfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,c,1,0,0)
end
function s.pop(e,tp,eg,ep,ev,re,r,rp)Artmage Non-Finito (74631897)
Source: Scripts/c74631897.lua
end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.fspop(e,tp,eg,ep,ev,re,r,rp)