Skip to content

Duel.MoveToField ​

Signature ​

lua
Duel.MoveToField(Card c, int move_player, int target_player, int dest, int positions, bool enable, [int zone]) -> bool

Description ​

Moves c onto target_player's field and returns true if the move succeeds. dest is normally LOCATION_MZONE or LOCATION_SZONE. LOCATION_FZONE and LOCATION_PZONE are accepted and converted to the matching Spell & Trap Zone handling by the core. For LOCATION_PZONE, the core requires a Pendulum Card, lets the player choose an open Pendulum Zone, and sends the card to the GY by rule if no matching Pendulum Zone is usable. Use this for field placement, not for Equip relationships; Equip Cards should use Duel.Equip.

How To Use It ​

Use this for effects that place an existing card directly onto the field, such as moving a card to the Field Zone, Pendulum Zone, or Spell & Trap Zone.

lua
if tc:IsRelateToEffect(e) then
    Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end

enable=true applies the moved card's field effects immediately. The optional zone mask restricts which zone can be used.

Parameters ​

  • c Card - Card to move.
  • move_player int - Player making the placement selection.
  • target_player int - Player whose field receives the card.
  • dest int - Destination location. LOCATION_PZONE is accepted for Pendulum Zone placement.
  • positions int - Allowed position mask, commonly POS_FACEUP for Pendulum Zone placement.
  • enable bool - Whether to enable the card's field effects after it moves. Local Pendulum placement scripts commonly pass true.
  • zone int optional - Optional zone mask. For LOCATION_PZONE, low bit 0 allows the left Pendulum Zone and low bit 1 allows the right Pendulum Zone; omitted defaults to both.

Returns ​

  • bool - true if the move succeeds; false if the move is invalid or no usable zone is available.

Source ​

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

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 264 indexed script(s).
  • Search this function in the Script Explorer with Duel.MoveToField.
CardIDScriptDetected Calls
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua1
Astrograph Sorcerer76794549Scripts/c76794549.lua1
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua1
Ghostrick Renovation61818176Scripts/c61818176.lua1
Ursarctic Polari27693363Scripts/c27693363.lua1
D/D/D/D Dimensional King Arc Crisis71398055Scripts/c71398055.lua1
D/D/D/D Super-Dimensional Sovereign Emperor Zero Paradox97417863Scripts/c97417863.lua2
Odd-Eyes Arcray Dragon6218704Scripts/c6218704.lua2
Starving Venemy Dragon93729065Scripts/c93729065.lua1
Chronograph Sorcerer12289247Scripts/c12289247.lua1
Radiant Typhoon Varuroon, the Marine Eidolon39341885Scripts/c39341885.lua2
Camelot, Realm of Noble Knights and Noble Arms15635751Scripts/c15635751.lua2
Yummy★Snatchy30581601Scripts/c30581601.lua1
Aroma Blend25861589Scripts/c25861589.lua1
Chef de Nouvelles29251488Scripts/c29251488.lua1
Starving Venom Wing Dragon5148778Scripts/c5148778.lua1
Plunder Patrollship Jord85969517Scripts/c85969517.lua1
Sea Stealth Attack19089195Scripts/c19089195.lua2
D/D/D Deviser King Deus Machinex46593546Scripts/c46593546.lua2
Odd-Eyes Rebellion Dragon Overlord98452268Scripts/c98452268.lua1
Nirvana High Paladin80896940Scripts/c80896940.lua1
Dreaming Nemleria70155677Scripts/c70155677.lua1
Favorite Hero11881272Scripts/c11881272.lua1
Yummy☆Surprise29369059Scripts/c29369059.lua1
...and 240 more

Script Examples ​

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

lua
	local g=Duel.SelectMatchingCard(tp,s.pfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tp)
	local tc=g:GetFirst()
	if tc and Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) then
		local e1=Effect.CreateEffect(c)
		e1:SetType(EFFECT_TYPE_SINGLE)

Astrograph Sorcerer (76794549) ​

Source: Scripts/c76794549.lua

lua
		end
		if op==0 then
			Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
		else
			Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)

D/D/D Alfred the Divine Sage King (11852093) ​

Source: Scripts/c11852093.lua

lua
	end
	for tc in aux.Next(pg) do
		Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
	end
	local sg=g:Filter(Card.IsLocation,nil,LOCATION_REMOVED)