Skip to content

Learning Path ​

Sacred Book has two useful modes: a guided curve for learning the engine and a task library for finding one exact pattern. New scripters should follow the first curve in order. Experienced scripters can jump to a branch, confirm the call in the API, then search real local use in the Script Explorer.

Pick Your Starting Point ​

Your experience or taskStart here
New to programming or Lua.Start with Lua Essentials, then follow the seven-step curve below.
Familiar with Lua; new to card scripts.Follow the seven-step curve below.
Comfortable with Lua, but new to YGOPro effects.Read Effect Objects, Effect Types, and Callbacks.
You know the engine and need one implementation pattern.Jump to the Lesson Library, then use the Script Explorer.
A script almost works, but fails in one game state.Trace Activation Legality, Effect Lifecycle, and Common Script Errors.
Building a Rush Duel card.Follow the Rush Duel track.
Returning after an engine update.Read Applying Engine and Script Changes for the new card-type API and corrected patterns.

First Complete Card Curve ​

Checkpoints For Your First Card ​

You do not need to memorize every function before moving on. Use these observable checkpoints to choose your next lesson:

AfterYou should be able to
Reading a filePoint to the effect registration, the callbacks, and the filters.
Building small effectsExplain what chk==0 checks without selecting or moving cards.
Writing and wiring a cardLoad your card with the correct name, type, script, and prompt text.
Tracing activationExplain which values are chosen now and which must be checked again at resolution.
DebuggingReproduce one legal activation, one illegal activation, and one changed-state resolution.

If a checkpoint fails, return to that stage with one small card. For a Rush card, complete the shared Lua/callback foundations, then follow the Rush track before copying a standard-format effect.

Use the site layers together instead of expecting one page to answer every question:

LayerBest use
Learning pagesUnderstand why a pattern is shaped a certain way and see a complete example.
Function referenceConfirm the exact signature, parameters, return value, and local source.
Script ExplorerFind every local card that uses a function or a similar text pattern.
Featured examplesRead larger real cards with their detected calls and source.

For a new effect, read one relevant lesson, find two local scripts with the same shape, and verify unfamiliar calls in the API. That workflow scales from a first card to veteran-level edge cases.

Common Effect Pattern Route ​

Once you can follow target and operation callbacks, these three pages answer a lot of real custom-card questions:

  1. Functions that move cards across locations
  2. Equip Spells and Equip Cards
  3. LP Recovery and Effect Damage

Read them when the card text says "send", "banish", "equip", "recover LP", or "inflict damage" and you need to choose the right local API shape.

Lesson Library ​

Use this library after the first route, or jump to the branch that matches the card you are scripting.

Foundations

Lua essentialsScript structureEffect objectsEffect typesCategories and propertiesFirst scriptsBeginner script ladderFirst custom cardCard data and script wiring

Activation Flow

CallbacksActivated effectsActivation legalityEffect lifecycleChain timingClient UI and prompts

Cards And Groups

Filters and GroupsTargeting flowSelection and Group handlingMin/Max stat selectionMoving cardsOperation results and follow-up effectsTokens and summon choicesReset flags and duration

Spell And Trap Patterns

Spell CardsQuick-Play SpellsEquip SpellsField SpellsTrap CardsNormal and Continuous TrapsCounter Traps

Summon Procedures

Ritual procedureRitual choices and backtrackingFusion procedureFusion monster and material choicesSynchro procedureXyz procedureLink procedurePendulum procedureSpecial Summon-only monstersTribute Summon materials

Monster Families

Gemini MonstersToon MonstersUnion MonstersSpirit MonstersArchetypes and set codes

Card Outcomes

Methods for affecting cardsContinuous effectsContinuous stat modifiersCountersNegation and immunityControl changeBattle position effectsBattle participants and timingField zones and sequences

Rush Duel

Choose your Rush starting pointRequirements and resolutionSelection, actions, and temporary statsMaximum, Fusion, and RitualFusion and Ritual choicesSpecial Summons and result checksReal Rush scriptsRush helper reference

Maintenance And Debugging

Apply engine and script changesCommon script errorsVerify card data and scripts

Player Data And Memory

LP recovery and effect damagePlayer-targeted effectsPlayer restrictionsDraw, hand, and Deck effectsFlag effectsCount limits

How To Read A Real Script ​

When a local card script looks confusing, read it in this order:

  1. Find initial_effect(c).
  2. Read each Effect.CreateEffect(c) block.
  3. Note SetType, SetCode, SetRange, SetProperty, and callbacks.
  4. Read SetCondition, SetCost, SetTarget, and SetOperation callbacks.
  5. Read helper filters last, because they usually only answer "which cards count?"

Useful reference while learning: