Skip to content

Duel.SetOperationInfo ​

Signature ​

lua
Duel.SetOperationInfo(int chainc, int category, Card|Group|nil targets, int count, int player, int param) -> void

Description ​

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:

lua
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:

lua
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.

Parameters ​

  • chainc int - Chain index/count passed to the core chain lookup; scripts commonly use 0 for the current Chain Link.
  • category int - CATEGORY_* operation category to record.
  • targets Card|Group|nil - Known affected cards. Card or Group values are cloned into a read-only Group; nil records only count, player, and param.
  • count int - Expected number of affected cards.
  • player int - Target player stored in the operation info.
  • param int - 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:

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.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua3
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua3
Artmage Non-Finito74631897Scripts/c74631897.lua1
Pendulum Evolution55795155Scripts/c55795155.lua1
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua3
Lady's Dragonmaid48658295Scripts/c48658295.lua3
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua2
Eternal Favorite87532344Scripts/c87532344.lua2
Surprise Fusion35167375Scripts/c35167375.lua3
Astrograph Sorcerer76794549Scripts/c76794549.lua3
Spellbook of the Grand Circle11911336Scripts/c11911336.lua3
Ultra Polymerization76647978Scripts/c76647978.lua2
Goyo Emperor59255742Scripts/c59255742.lua3
Accel Synchro Stardust Dragon30983281Scripts/c30983281.lua2
Melffy Playtime Surprise58036097Scripts/c58036097.lua1
Ashtraja Susanoo17020474Scripts/c17020474.lua3
Deftero Enneacraft - "alazoneIA"92171126Scripts/c92171126.lua4
Destiny HERO - Destro-Dogma25158975Scripts/c25158975.lua2
Yomagna the Fire Phantom17350692Scripts/c17350692.lua1
Fiendsmith's Sequence49867899Scripts/c49867899.lua4
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua3
El Shaddoll Apkallone50907446Scripts/c50907446.lua2
Mementotlan Fusion66518509Scripts/c66518509.lua4
Meteoroa Drytron24166324Scripts/c24166324.lua2
...and 10748 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

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

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

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)