Skip to content

Duel.SetTargetParam ​

Signature ​

lua
Duel.SetTargetParam(int param) -> void

Description ​

Stores param as the target parameter for the currently handled Chain. Operations commonly read it with Duel.GetChainInfo(0, CHAININFO_TARGET_PARAM), often together with CHAININFO_TARGET_PLAYER. Use it for data that should be frozen at activation time; recalculate in the operation when the card text depends on the current state.

How To Use It ​

Use this together with Duel.SetTargetPlayer to store a number needed at resolution, such as LP amount, number of cards, or a selected option.

lua
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)

If the amount should be recalculated at resolution, do not freeze it here; announce the expected operation with Duel.SetOperationInfo and calculate again in the operation.

Parameters ​

  • param int - Integer target parameter stored on the current Chain.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

More guided lessons (1)

Used By ​

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

  • Detected in 925 indexed script(s).
  • Search this function in the Script Explorer with Duel.SetTargetParam.
CardIDScriptDetected Calls
Pere-Zenet Em Heru46273941Scripts/c46273941.lua1
Junoldo the Shadespirit Power Patron10266279Scripts/c10266279.lua1
Flower Cardian Peony with Butterfly57261568Scripts/c57261568.lua1
A Bao A Qu, the Lightless Shadow4731783Scripts/c4731783.lua1
Flower Cardian Willow with Calligrapher89818984Scripts/c89818984.lua1
Magikey Dragon - Andrabime71159974Scripts/c71159974.lua1
Forbidden Dark Contract with the Swamp King10833828Scripts/c10833828.lua1
Plunder Patrollship Jord85969517Scripts/c85969517.lua1
Meklord Astro Mekanikle63468625Scripts/c63468625.lua1
Abyss-steam63941169Scripts/c63941169.lua1
Flower Cardian Moonflowerviewing33541430Scripts/c33541430.lua1
Witchcrafter Pittore95245544Scripts/c95245544.lua1
Fallen Paradise of the Sacred Beasts65861210Scripts/c65861210.lua1
Genex Ally Triforce52709508Scripts/c52709508.lua1
Vernusylph of the Thawing Mountains9238125Scripts/c9238125.lua1
Gladiator Beast Gaiodiaz90957527Scripts/c90957527.lua1
Megalith Anastasis29876299Scripts/c29876299.lua1
Fabled Realm's Revival57775790Scripts/c57775790.lua1
Miracle Synchro Fusion36484016Scripts/c36484016.lua1
Neo Super Quantal Mech King Blaster Magna95493471Scripts/c95493471.lua1
Indiora Doom Volt the Cubic Emperor3775068Scripts/c3775068.lua1
Vulcan Dragni the Cubic King77387463Scripts/c77387463.lua1
Rank-Up-Magic Zexal Force36224040Scripts/c36224040.lua1
Yummy★Redemption65853758Scripts/c65853758.lua1
...and 901 more

Script Examples ​

Pere-Zenet Em Heru (46273941) ​

Source: Scripts/c46273941.lua

lua
	if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
	Duel.SetTargetPlayer(tp)
	Duel.SetTargetParam(1)
	Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end

Junoldo the Shadespirit Power Patron (10266279) ​

Source: Scripts/c10266279.lua

lua
	if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
	Duel.SetTargetPlayer(tp)
	Duel.SetTargetParam(2)
	Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
	Duel.SetOperationInfo(0,CATEGORY_HANDES_SELF,nil,0,tp,1)

Flower Cardian Peony with Butterfly (57261568) ​

Source: Scripts/c57261568.lua

lua
	if chk==0 then return true end
	Duel.SetTargetPlayer(tp)
	Duel.SetTargetParam(1)
	Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end