Skip to content

Duel.GetChainInfo ​

Signature ​

lua
Duel.GetChainInfo(int chainc, ... any) -> ...

Description ​

Returns information fields from chainc in the same order as the requested CHAININFO_* constants. Use chainc=0 for the currently resolving Chain. Unknown requested fields return nil, and no values are returned if the Chain does not exist. For stored LP/player data, read CHAININFO_TARGET_PLAYER and CHAININFO_TARGET_PARAM. For official targets you are about to affect, prefer relation-aware target helpers.

How To Use It ​

Use chainc=0 inside an operation to read data from the currently resolving Chain Link.

lua
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)

For official card targets, prefer relation-aware helpers such as Duel.GetFirstTarget() or Duel.GetTargetsRelateToChain() when you are about to act on them.

Parameters ​

  • chainc int - Chain index/count to inspect; scripts commonly use 0 for the current Chain Link.
  • ... any - One or more CHAININFO_* constants. Each requested field produces one return value.

Returns ​

  • ... - Values corresponding to the requested CHAININFO_* constants. CHAININFO_TARGET_CARDS returns the Chain's target Group.

Source ​

  • D:\Programs\GitHub\ygopro-core\libduel.cpp:4947

Guided Examples ​

Learn how to use this function in context:

More guided lessons (5)

Used By ​

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

  • Detected in 2180 indexed script(s).
  • Search this function in the Script Explorer with Duel.GetChainInfo.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua2
Goyo Emperor59255742Scripts/c59255742.lua3
Meteoroa Drytron24166324Scripts/c24166324.lua1
Performage Cup Tricker6812770Scripts/c6812770.lua1
Pere-Zenet Em Heru46273941Scripts/c46273941.lua1
Prank-Kids Weather Washer44509529Scripts/c44509529.lua1
Enneacraft - Asta.PIXEA28454232Scripts/c28454232.lua1
Converging Wishes20007374Scripts/c20007374.lua2
PSY-Framelord Omega74586817Scripts/c74586817.lua1
Graydle Split75361204Scripts/c75361204.lua2
Enneacraft - Archa.TAIL81237046Scripts/c81237046.lua1
D/D/D/D Dimensional King Arc Crisis71398055Scripts/c71398055.lua1
D/D Count Surveyor5997110Scripts/c5997110.lua1
Enneacraft - Atil.SPIA71801447Scripts/c71801447.lua3
Enneacraft - Aiza.LEON82359538Scripts/c82359538.lua1
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua1
Bujinki Ahashima71095768Scripts/c71095768.lua5
Flower Cardian Peony with Butterfly57261568Scripts/c57261568.lua1
DoSolfachord Coolia80776622Scripts/c80776622.lua1
W:P Fancy Ball4993187Scripts/c4993187.lua1
A Bao A Qu, the Lightless Shadow4731783Scripts/c4731783.lua1
Radiant Typhoon Varuroon, the Marine Eidolon39341885Scripts/c39341885.lua1
Flower Cardian Willow with Calligrapher89818984Scripts/c89818984.lua1
Prank-Kids Rocket Ride18514525Scripts/c18514525.lua1
...and 2156 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

lua
	if chk==0 then return true end
	local c=e:GetHandler()
	local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_SINGLE)

Goyo Emperor (59255742) ​

Source: Scripts/c59255742.lua

lua
end
function c59255742.operation(e,tp,eg,ep,ev,re,r,rp)
	local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
	if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() then return end
	Duel.GetControl(g,tp)

Meteoroa Drytron (24166324) ​

Source: Scripts/c24166324.lua

lua
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
	local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
	local rg=tg:Filter(Card.IsRelateToEffect,nil,e)
	if rg:GetCount() then