Skip to content

Auxiliary.SelectTargetFromFieldFirst ​

Signature ​

lua
Auxiliary.SelectTargetFromFieldFirst(int tp, function f, int player, int s, int o, int min, int max, any ex, ... any) -> Group

Description ​

Target-selection helper that first offers matching on-field effect targets with HINTMSG_FIELD_FIRST. If accepted, it sets those cards as targets; otherwise it restores the previous hint and falls back to Duel.SelectTarget.

Parameters ​

  • tp int
  • f function
  • player int
  • s int
  • o int
  • min int
  • max int
  • ex any
  • ... any

Returns ​

  • Group - The selected target cards.

Source ​

  • Utilities/utility.lua:1398

Used By ​

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

  • Detected in 35 indexed script(s).
  • Search this function in the Script Explorer with Auxiliary.SelectTargetFromFieldFirst.
CardIDScriptDetected Calls
Melffy Playtime Surprise58036097Scripts/c58036097.lua1
S:P Little Knight29301450Scripts/c29301450.lua1
Zoroa, the Magistus Verethragna37260677Scripts/c37260677.lua1
Snake-Eyes Vengeance Dragon79415624Scripts/c79415624.lua1
Snake-Eyes Flamberge Dragon48452496Scripts/c48452496.lua1
Metalfoes Vanisher56518311Scripts/c56518311.lua1
Primite Roar92501449Scripts/c92501449.lua1
Primite Howl41488249Scripts/c41488249.lua1
Ars Magna - "Philosophirum"90728287Scripts/c90728287.lua1
Startling Stare of the Snake-Eyes74906081Scripts/c74906081.lua1
Filia Regis70538272Scripts/c70538272.lua1
The Undying Legion43355214Scripts/c43355214.lua1
Adamancipator Crystal - Tiamite51420096Scripts/c51420096.lua1
Exosister Returnia197042Scripts/c197042.lua1
Strength in Unity96239878Scripts/c96239878.lua1
Dragonmaid Tidying57416183Scripts/c57416183.lua1
Adamancipator Luminous41458361Scripts/c41458361.lua1
Regenesis Overlord47082621Scripts/c47082621.lua1
Vernusylph in Full Bloom7206349Scripts/c7206349.lua1
Blitzclique Return Stroke23526128Scripts/c23526128.lua1
Exosister Mikailis42741437Scripts/c42741437.lua1
S-Force World Sorting11642993Scripts/c11642993.lua1
Expurrely Noir83827392Scripts/c83827392.lua1
Virgil, Rock Star of the Burning Abyss601193Scripts/c601193.lua1
...and 11 more

Script Examples ​

Melffy Playtime Surprise (58036097) ​

Source: Scripts/c58036097.lua

lua
	if chk==0 then return Duel.IsExistingTarget(s.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
	local g=aux.SelectTargetFromFieldFirst(tp,s.thfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
	Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end

S:P Little Knight (29301450) ​

Source: Scripts/c29301450.lua

lua
	if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
	local g=aux.SelectTargetFromFieldFirst(tp,Card.IsAbleToRemove,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,1,1,nil)
	Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end

Zoroa, the Magistus Verethragna (37260677) ​

Source: Scripts/c37260677.lua

lua
		and Duel.IsExistingTarget(s.eqfilter,tp,LOCATION_GRAVE,LOCATION_ONFIELD,1,nil,tp) end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
	local g=aux.SelectTargetFromFieldFirst(tp,s.eqfilter,tp,LOCATION_GRAVE,LOCATION_ONFIELD,1,1,nil,tp)
	if g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)>0 then
		Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)