Effect.SetCategory
Signature
lua
Effect.SetCategory(Effect e, int cate) -> voidDescription
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.
Related Functions
Parameters
eEffectcateint
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.
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)