Skip to content

Effect.SetCategory ​

Signature ​

lua
Effect.SetCategory(Effect e, int cate) -> void

Description ​

Sets e's operation category flags, such as CATEGORY_DESTROY, CATEGORY_TOHAND, or CATEGORY_SPECIAL_SUMMON. Categories describe what the effect may do; known operation details should still be recorded with Duel.SetOperationInfo in the Target callback.

How To Use It ​

Categories tell the engine and response checks what kind of action the effect may perform.

lua
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)

The category is not the actual operation. If the affected cards, player, or count are known during targeting, also call Duel.SetOperationInfo in the Target callback.

Parameters ​

  • e Effect
  • cate int

Source ​

  • D:\Programs\GitHub\ygopro-core\libeffect.cpp:623

Guided Examples ​

Learn how to use this function in context:

Used By ​

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

  • Detected in 11516 indexed script(s).
  • Search this function in the Script Explorer with Effect.SetCategory.
CardIDScriptDetected Calls
Salamandra with Chain62091148Scripts/c62091148.lua2
Astrograph Sorcerer, the Starfrost Magician48171151Scripts/c48171151.lua3
Artmage Non-Finito74631897Scripts/c74631897.lua2
Pendulum Evolution55795155Scripts/c55795155.lua2
Levia-Dragoon - Daedalus78579058Scripts/c78579058.lua2
Lady's Dragonmaid48658295Scripts/c48658295.lua2
Azure Ocean Dragon Lord - Neo-Daedalus Rage41570943Scripts/c41570943.lua2
Eternal Favorite87532344Scripts/c87532344.lua2
Surprise Fusion35167375Scripts/c35167375.lua2
Astrograph Sorcerer76794549Scripts/c76794549.lua3
Spellbook of the Grand Circle11911336Scripts/c11911336.lua2
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.lua2
D/D/D Alfred the Divine Sage King11852093Scripts/c11852093.lua1
El Shaddoll Apkallone50907446Scripts/c50907446.lua2
Mementotlan Fusion66518509Scripts/c66518509.lua2
Meteoroa Drytron24166324Scripts/c24166324.lua2
...and 11492 more

Script Examples ​

Salamandra with Chain (62091148) ​

Source: Scripts/c62091148.lua

lua
	--
	local e1=Effect.CreateEffect(c)
	e1:SetCategory(CATEGORY_EQUIP+CATEGORY_POSITION+CATEGORY_MSET)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)

Astrograph Sorcerer, the Starfrost Magician (48171151) ​

Source: Scripts/c48171151.lua

lua
	local e1=Effect.CreateEffect(c)
	e1:SetDescription(aux.Stringid(id,0))
	e1:SetCategory(CATEGORY_DESTROY)
	e1:SetType(EFFECT_TYPE_IGNITION)
	e1:SetRange(LOCATION_PZONE)

Artmage Non-Finito (74631897) ​

Source: Scripts/c74631897.lua

lua
	local e4=Effect.CreateEffect(c)
	e4:SetDescription(aux.Stringid(id,0))
	e4:SetCategory(CATEGORY_SSET)
	e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
	e4:SetCode(EVENT_SPSUMMON_SUCCESS)