Now before we begin, you will have to download 2 programs.
Sqlite Expert Personal and
Lua Edit 2010 if you don't want Lua Edit you can use Notepad or any basic text editor program.
Update!
Video tutorial added for adding cards to Ygopro:
Video tutorial added for scripting cards in Ygopro Part 1!
Open the cards.cdb in your Ygopro folder with Sqlite.

Change the tab from Databases to Data.

Then on the left side click on "texts" under "cards" and "datas", then click the green + under the Data tab.
then
Double Click on one of the null areas that appear from pressing that.
Now start typing in the info.
Remember that everytime you want to edit or confirm something click the green check mark shown here:
The Id is the 8 digit number on the bottom left corner of a card, come up with a random number and make sure no other card has the same ID number, *For example Dark Magician is 46986414* Make sure you remember this number!
The name is the name of the card.
The description is everything it says on it's effect.
Press spacebar one time in string 1 all the way to string 16, if you don't then Ygopro will never open and crash.Press ok and change from "texts" to "datas" on the left.
Press the green + like last time and double click one of the null areas . The ID is the same as what you put in the "texts".
For the OT: 1=Ocg, 2=Tcg, 3=Ocg & Tcg, 4=Anime.
Alias is if it has more than 1 artwork or has an effect that says "this card's name is.." like A Legendary Ocean, otherwise leave this as 0. If you want a better explanation of the alias section, click here:
If you have a card like Blue-Eyes White Dragon, which has like 5 different card arts, notice they have the same Id Number in the deck constructor, but not in the cdb. That's because all of alternate artworks in their alias spot say "89631139" instead of 0 because that is the Id number they share to be the same card. So the original card will say 0, then the alternate artworks will have different ids but then you change the alias to the id of the card you want it to copy and BAM they have the same name. This also works with cards that share names with other cards in their effects. Look at A legendary Ocean's effect, it says 'This card's name is treated as Umi" or Elemental Hero Neo Bubbleman who says 'This card's name is treated as Elemental Hero Bubbleman.." so same scenario, they all have individual Id numbers but for a Legendary Ocean it will say the Id number of Umi in it's Alias spot and Neo Bubbleman with Bubbleman's Id in it's alias slot, yet they all have different Id numbers in general. Hope I cleared this up.
Warning, if your card is not a monster, Put 0 for ATK, DEF, Level, Race, and Attribute.Setcode is the archetype number, thanks to
Angel and
Jakester390 for the list of setcode numbers and explanations:
Basic Set Codes currently run from numbers 1 to 513, with quite a few gaps. If an set code does not come up on the database, it should be fine to use (1 exception is 258, which is something related to Evil Hero Fusions). For monsters that are in only 1 Archetype should be given their set code, or if custom, a blank set code from 1 to (presumably) 4095. The basic archetypes, and their hex values are as follows:
1: Ally of Justice 0x1
2: Genex 0x2
4: Amazoness 0x4
5: Arcana 0x5
6: Dark World 0x6
7: Ancient Gear 0x7
8: HERO 0x8
9: Neos 0x9
10: Evilswarm 0xA
11: Infernity 0xB
12: Alien 0xC
13: Saber 0xD
14: Watt 0xE
15: Ojama 0xF
16: Gusto 0x10
17: Karakuri 0x11
18: Frog 0x12
19: Meklord 0x13
21: B.E.S. 0x15
22: roid 0x16
23: Synchron 0x17
24: Cloudian 0x18
25: Gladiator Beast 0x19
26: Dark Scorpion 0x1A
27: Phantom Beast 0x1B
29: Koa'ki 0x1D
30: Chrysalis 0x1E
31: Neo-Spacian 0x1F
32: Shien 0x20
33: Earthbound Immortal 0x21
34: Jurrac 0x22
35: Malefic 0x23
36: Scrap 0x24
37: Iron Chain 0x25
38: Morphtronic 0x26
39: T.G. 0x27
40: Batteryman 0x28
41: Dragunity 0x29
42: Naturia 0x2A
43: Ninja 0x2B
44: Flamvell 0x2C
46: Gravekeeper 0x2E
47: Ice Barrier 0x2F
48: Vylon 0x30
49: Fortune Lady 0x31
50: Volcanic 0x32
51: Blackwing 0x33
52: Crystal Beast 0x34
53: Fabled 0x35
54: Machina 0x36
55: Mist Valley 0x37
56: Lightsworn 0x38
57: Laval 0x39
58: Ghiski 0x3A
59: Red-Eyes 0x3B
60: Reptilliane 0x3C
61: Six Samurai 0x3D
62: Worm 0x3E
63: Majestic 0x3F
64: Forbidden 0x40
65: LV 0x41
66: Nordic 0x42
67: Junk 0x43
68: Agent 0x44
69: Archfiend 0x45
70: Fusion 0x46
71: Gem- 0x47
72: Number 0x48
73: Skyblaster 0x49
74: Timelord 0x4A
75: Aesir 0x4B
76: Trap Hole 0x4C
78: Evol 0x4E
79: Assault 0x4F
80: Venom 0x50
81: Gadget 0x51
82: Guardian 0x52
83: Constellar 0x53
84: Gagaga 0x54
85: Photon 0x55
86: Inzektor 0x56
87: Resonator 0x57
88: Wind-up 0x58
89: Gogogo 0x59
90: Penguins 0x5A
91: Inmato 0x5B
92: Sphinx 0x5C
96: Bamboo Sword 0x60
97: Ninjitsu Art 0x61
98: Toon 0x62
99: Reactor 0x63
100: Harpie 0x64
101: Infestation 0x65
102: Symphonic 0x66
103: Iron 0x67
104: Tin 0x68
105: Hieratic 0x69
106: Butterspy 0x6A
107: Bounzer 0x6B
108: Lightray 0x6C
109: Majin 0x6D
110: Prophecy 0x6E
111: Heroic 0x6F
112: Chronomaly 0x70
113: Madolche 0x71
114: Geargia 0x72
115: Xyz 0x73
117: Abyss 0x75
118: Heraldic 0x76
119: Atlantean 0x77
120: Nimble 0x78
122: Noble Knight 0x7A
123: Galaxy 0x7B
132: Chronomaly Technology 0x84 (Currently Unknown why it has its own set code)
144: Meklord Pieces 0x90
145: Dark Tuner/Synchro 0x91
146: Fortune Fairy 0x92
147: Puppet 0x93
148: Fossil Warrior 0x94
149: Cat 0x95
150: Clear 0x96
151: VWXYZ 0x97
256: Synchron Synchros 0x100 (Synchros that require a Synchron Tuner)
257: Synchro Fusions 0x101 (Fusions that require a Synchro Monster)
258: Something Evil Hero Fusion Related 0x102 (Unknown what this is)
259: Cyber 0x103
512: Speed Spell 0x200
513: Chaos Xyz 0x201
There are also Extension Archetypes, which include R-Genex, X-Saber, and other archetypes that have their own support but are considered part of the including Archetype (e.g. All R-Genex are Genex monsters). These codes are a four digit hexadecimal code created by appending a hexadecimal number (that is 1-9,A,B,C,D,E,or F) to 1 or 2 0s and the hexadecimal set code of the containing Archetype. (For example R-Genex Monsters, which are considered Genex, have a set code of 1002 which is 1 appended to 00 appended to the Genex Set code of 2)
R-Genex
1 (Hexidecimal Number) 00 (Spacing) 2 (Genex Set Code)= 1002
Gem-Knight
1 (Hexidecimal Number) 0 (Spacing) 47 (Gem- Set Code)= 1047
Known extension Archetypes and their hexadecimal counterparts are as follows:
4098: R-Genex 0x1002
4106: Steelswarm 0x100A
4109: X-Saber 0x100D
4118: Vehichroid 0x1016
4139: Armor Ninja 0x102B
4149: The Fabled 0x1035
4167: Gem-Knight 0x1047
4175: /Assault 0x104F
4206: Spellbook 0x106E
8194: Genex Ally 0x2002
12296: E HERO 0x3008
12301: XX-Saber 0x300D
12354: Nordic Ascendant 0x3042
12366: Evoltile 0x304E
12397: Dragoon 0x306D
12435: Gimmick Puppet 0x3093
20488: Vision Hero 0x5008
20546: Nordic Relic 0x5042
24584: Evil HERO 0x6008
24642: Nordic Beasts 0x6042
24654: Evolsuar 0x606E
24685: Djinn of Rituals 0x606C
40968: Masked HERO 0xA008
41026: Nordic Alfar 0xA042
49160: D HERO 0xC008
Monsters that are members of two Archetypes are a little trickier to understand. In order to make a monster to be considered in two archetypes both hexidecimal set codes of the archetypes must be lengthened to 4 digits. So a 1 digit Set code like Genex (0x2) would have 3 zeros before it (becoming 0x0002), and a set code that is already 4 digits like Gem-Knight (0x1047) would remain that length. The two numbers are then appended to each other in either order: (so a Gem-Knight Genex monster would be either 0x00021047, which the excess zeros are removed becoming 0x21047 or 0x10470002). Known Dual Archetype cards are:
602120: Neos AND E Hero 0x93008
1828513: Six Samuari AND Shien 0x1BE6A1
2818065: Karakuri AND Ninja 0x2B0011
3866659: Malefic AND Red-Eyes 0x3B0023
4063268: Scrap AND Worm 0x3E0024
4390935: Junk AND Synchron 0x430017
4391168: Junk AND Synchron Synchro 0x430100
4521995: Infernity AND Archfiend 0x45000B
4522009: Gladiator Beast AND Archfiend 0x450019
4522020: Scrap AND Archfiend 0x450024
4522082: Toon AND Archfiend 0x450062
4526159: Archfiend AND /Assault 0x45104F
4591687: Gem-knight AND Fusion 0x461047
4718592: Heraldic AND Number 0x480000
4718704: Chronomaly AND Number 0x480070
4722731: Number AND Armor Ninja 0x48102B
5373963: Infernity AND Guardian 0x52000B
5373981: Koa'ki AND Guardian 0x52001D
5373994: Naturia AND Guardian 0x52002A
5374044: Guardian AND Sphinx 0x52005C
5374064: Guardian AND Chronomaly 0x520070
7012437: Photon AND Bounzer 0x6A0055
7143937: Chaos Xyz AND Djinn 0x6C0201
7209083: Galaxy AND Prohecy 0x75003A
7667770: Ghishki AND Abyss 0x75003A
7667828: Mermail AND Abyss 0x750074
8061000: Number AND Galaxy 0x7B0048
8061013: Galaxy AND Photon 0x7B0055
9449491: Meklord AND Emperor 0x903013
9461779: Meklord AND Army 0x906013
9764916: Crystal Beast AND Cat 0x950034
16777283: Junk AND Synchron Synchro 0x1000043 (if you look back at 4391168 you'll see that it is the same, proving that the codes can go in either order)
16842794: Naturia AND Synchro Fusion 0x101002A
16932872: Evil HERO AND 258? 0x1026008
33554445: Speed Spell AND Saber 0x200000D
33554468: Speed Spell AND Scrap 0x2000024
33554502: Speed Spell AND Fusion 0x2000046
81940232: Number AND Gimmick Puppet 0x4E24F08 (No Clue why this one defies the pattern)
Type is the type of card, *For example 33 is Effect Monster, 17 is Normal Monster, 2 is Normal Spell, etc.
Here is a list of all type numbers provided by
Angel :
2=Normal Spell Card
4=Normal Trap Card
17=Normal Monster
33=Effect Monster
65=Fusion Monster
97=Fusion / Effect Monster
129=Ritual Monster
130=Ritual Spell
161=Ritual / Effect Monster
545=Spirit Monster
1057=Union Monster
2081=Gemini Monster
4113=Tuner / Normal Monster
4129=Tuner / Effect Monster
8193=Synchro Monster
8225=Synchro / Effect Monster
12321=Synchro / Tuner / Effect Monster
16401=Token
65538=Quick-Play Spell Card
131074= Continuous Spell Card
131076= Continuous Trap Card
262146=Equip Spell Card
524290=Field Spell Card
1048580=Counter Trap Card
2097185=Flip Effect Monster
4194337= Toon Monster
8388609=Xyz Monster
8388641=Xyz / Effect Monster
ATK is the attack points, DEF is the defense points. Level is the amount of stars under it's name.
Race is the type of monster, *For example 256 is Rock and 1 is Warrior*.
Here is a list of all monster races provided by
Angel :
1=Warrior
2=Spellcaster
4=Fairy
8=Fiend
16=Zombie
32=Machine
64=Aqua
128=Pyro
256=Rock
512=Winged-beast
1024=Plant
2048=Insect
4096=Thunder
8192=Dragon
16384=Beast
32768=Beast-Warrior
65536=Dinosaur
131072=Fish
262144=Sea Serpent
524288=Reptile
1048576=Spychic
2097152=Divine-beast
4194304=Creator God
Attribute is the element of the monster.
Here is a list of all attributes a monster can have provided by
Angel :
1=EARTH
2=WATER
4=FIRE
8=WIND
16=LIGHT
32=DARK
64=DIVINE
And category can be left at 0 without worries. Category is an easier way to find the card in the deck constructor, like searching for cards that have a destroy effect or stop attacks.
Now the card should be in the game once you click ok and save.
If you want a simpler based explanation of CDB, click here:
Angel's Tutorial and thank him for finding the values for Setcodes, types, races, and attributes.
Now we are going to add the picture for our card. Make sure you have it in card form like this:
And not like this:
You can use websites like
YugiohCardMaker or card creating programs for pictures.
Now open your card picture in a picture editing program like Paint or Gimp.
Shrink the picture to these dimensions; 177 by 254 pixels, make sure not to maintain the aspect ratio.
This is going to be your big picture.
Save the picture with it's name being the ID Number of the card. So if you put the ID number as 11112222 in the Cdb, then the picture will be named 11112222.jpg.
Save the picture in your
pics folder located in your
Ygopro folder.
After you have done that, shrink the picture one more time and make it 44 by 64 pixels.
This is going to be your small picture.
Then save it in your
thumbnail folder in your
pics folder in your
Ygopro folder with the same name as the big picture.
If you are making a field spell card you will only need 1 picture, open the
field folder in your
pics folder in your
Ygopro folder.
Open one of the field spell pictures in there and make your picture look the same size as the other field spell pictures. The name of the picture will be the ID number again. The field spell picture, unlike the normal pictures must be .png files and not .jpg files.
Now we are done with the easy part.
Warning, if your monster is a Normal Monster, then you can skip this partIt is time to program the card effect. If you don't get this right on your first try then don't worry as almost no one understands Lua files the first time.
Open a blank Lua Edit 2010.
On the first line type:
--XXX And replace the XXX with the card name so this would look like this:
Then go to the next line and type:
function cXXXXXXXX.initial_effect(c)
And replace the Xs with the ID number of the card.
So it will look like this:
function c11112222.initial_effect(c)
Now look at the effect of your monster, now count how many effects it has. I will use Wisel Attack 5's effect for this example.
This card cannot be Normal Summoned or Set. This card cannot be Special Summoned except by Tributing 1 face-up "Wisel Attack 3". If you do not control a face-up "Meklord Emperor" monster, destroy this card. Double all Battle Damage a "Meklord Emperor" monster you control inflicts to your opponent. Also, during battle between an attacking "Meklord Emperor" monster you control and a Defense Position monster whose DEF is lower than the ATK of the attacking monster, inflict the difference as Battle Damage to your opponent. Once during your turn, when a "Meklord Emperor" monster declares an attack, you can negate the activation of an opponent's Trap Card and destroy it.This card has 6 effects.
1. It cannot be Normal Summoned or Set.2. It has to be Special Summoned (from your hand) by tributing a face-up "Wisel Attack 3".3. It will destroy itself if a "Meklord Emperor" monster is not on the field.4. It doubles all Battle Damage a "Meklord Emperor" you control will do to the opponent.5. It gives "Meklord Emperor" monsters you control to do piercing damage if battling an opponent's monster.6. It can negate and destroy 1 trap your opponent controls whenever a "Meklord Emperor" monster you control declares an attack once during your turn.So we are going to need to type 1 of these per effect:
local eX=Effect.CreateEffect(c)
The X is replaced by the order of the effect. So since the Cannot be Normal Summoned or Set effect is first, the X is replaced with a 1.
So your blank lua file will look like this:
--CARDNAME
function c11112222.initial_effect(c)
--defup
local e1=Effect.CreateEffect(c)
Your effect may look different than mine if it has more than 1 effect.
So if it has 2 effects it will look like this:
function c11112222.initial_effect(c)
--defup
local e1=Effect.CreateEffect(c)
--destroy
local e2=Effect.CreateEffect(c)
Now for every card effect a card has, we need details for it.
So say my card says: "This card gains 500 DEF for every other Machine-type monster you control."
I would look for a card that increases it's DEF by for every (something) on the field.
First thing that comes to mind is Amazoness Paladin and Machine King.
A few problems is Amazoness Paladin gains 100 ATK instead of DEF for every Amazoness on your side.
And Machine King gains 100 ATK instead of DEF for every Machine-Type on the field.
So we need to open both of these with a text editor program like Lua Edit or Notepad.
The Lua file for Machine King is:
--機械王
function c46700124.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c46700124.val)
c:RegisterEffect(e1)
end
function c46700124.val(e,c)
return Duel.GetMatchingGroupCount(c46700124.filter,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,nil)*100
end
function c46700124.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
And Amazoness Paladin:
--アマゾネスの聖戦士
function c47480070.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c47480070.val)
c:RegisterEffect(e1)
end
function c47480070.val(e,c)
return Duel.GetMatchingGroupCount(c47480070.filter,c:GetControler(),LOCATION_MZONE,0,nil)*100
end
function c47480070.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
end
Now we can examine their effects. But before that allow me to explain what these "e1:Set" things mean.
e1:SetType(EFFECT_TYPE_SINGLE) is the type of effect, since it is only 1 effect; the type is (EFFECT_TYPE_SINGLE).
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) is the property of the effect that says it will only affect one place, this is basically here so that it doesn't confuse the effect with affecting other locations.
e1:SetCode(EFFECT_UPDATE_ATTACK) Is literaly going to update the system on the ATK point values of a card(s).
e1:SetRange(LOCATION_MZONE) Means where the effect is coming from, since Paladin is a monster it is coming from the Monster Zone or MZONE, if it's a Spell or Trap it's SZONE and so on.
e1:SetValue(c47480070.val) Is how much the ATK is going up by. Since we can't put filters or values normally in the "e"s, we need to put a .val in there to tell it to keep looking for the value. the c47480070 is there to make sure this value isn't confused with other cards that have to do with ATK values.
And lastly the c:RegisterEffect(e1) is the string that registers and gives the ok for the effect. It is basically what seperates the e1 from e2 effects and e3 from e5 like a period in a sentence.
If you are done with all the "e" effects, put the magic word "end" after the last c:RegisterEffect(e) to verify.
So if I want my monster to increase it's DEF by 500 for every Machine-Type on the field, I need to borrow a couple of things from these cards. We need to change the --atkup to --defup, change the UPDATE_ATTACK to UPDATE_DEFENCE, change the c47480070.val to whatever the id of my card is.
The end result should look like this:
--CARDNAME
function c11112222.initial_effect(c)
--defup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c11112222.val)
c:RegisterEffect(e1)
end
And we have now done the e1 effect of our card!
If you have more than 1 effect for your card then you will keep adding "e" lines to the card.
e1, e2, e3, depending on how many effects it has like I said before.
Now we aren't done. We need to tell the system by how much the DEF points will go up and why is it going up.
We are going to need to borrow again.
function c47480070.val(e,c)
return Duel.GetMatchingGroupCount(c47480070.filter,c:GetControler(),LOCATION_MZONE,0,nil)*100
end
function c47480070.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4)
The function cXXXXXXXX.val effect is the value that it will go up and for having a certain number of things to increase it by. The (e,c) are the peripherals in the .val, e=Effect, and c=Card. Other cards have other peripherals in this like tp=target player, chk=check and so on.
Duel.GetMatchingGroupCount is the specified Group we have to have for this effect to do anything, it points to the filter first which I will explain later, c:GetControler() is the controller of this effect. LOCATION_MZONE is the Monster Zone, and the ,0 is there to tell which side it means, 0 and 1 are usually switched in these cases but try different things out until it works.
The function cxxxxxxxx.filter is what the val will go by to allow the effect through as a literal filter.
From what the filter says: c:IsFaceup() meaning for it to gain 500 it needs to be face-up on the field, and c:IsSetCard(0x4) means it has to be this specific SetCode in the cdb, 0x4 is hex for what the SetCode number is in cdb so just google "0x4 to decimal" to find the actual number. so 0x4 as a decimal is 4 and 4 is the Setcode for the Amazoness archetype in the Cdb. So we need to change this to being Machine-Type instead of an Amazoness. We can borrow that from Machine King.
So instead of c:IsSetCard(0x4) we change it to c:IsRace(RACE_MACHINE)
Now our card should look like this.
--CARDNAME
function c11112222.initial_effect(c)
--defup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c11112222.val)
c:RegisterEffect(e1)
end
function c11112222.val(e,c)
return Duel.GetMatchingGroupCount(c11112222.filter,c:GetControler(),LOCATION_MZONE,0,nil)*500
end
function c11112222.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
Save it as cXXXXXXXX.lua in your
script folder in your
Ygopro folder and replace the Xs with the Id number.
We have now programmened our first card! Different effects will look different ways and even the simplest of effects can be tricky.
So now that you know the basics of Lua effects. Say you want a more advanced effect like an ignition effect or trigger effect instead of a basic continuous effect or passive effect like "This card gains 500 DEF for each face-up Machine-Type on the field" to "Once per turn you can increase this card's DEF by 500 for each face-up Machine-Type monster you control" or even "When you Normal Summon a Machine-Type monster(s), increase this card's DEF by 500."
First allow me to explain, in Yu-gi-oh, all card effects have a time and place to be activated or used.
We decide what has to be happening by a .condition effect. And the time or timing of the effect with an eX:SetType effect where the X is replaced by whatever number of effect this is like I explained before.
We divide these timings by what is called a Spell Speed, or just the speed of the effect.
Spell Speeds have 3 categories;
Spell Speed 1, which is the slowest and has to be activated by your decision. These card effects cannot be activated in response to any other effects. Speed Spell 1 are the cards that usually start a Chain link 1, which a chain is cards activating in response to each other.
All of these types of cards fall under Spell Speed 1:
Normal/Field/Continuous/Equip & Ritual Spell Cards
Flip/Ignition and Trigger Effects
Ignition-like & Trigger-like Effects
Spell Speed 2, which is the second slowest and second fastest. You can chain to Spell Speed 2 cards with these but you cannot chain to Spell Speed 3 cards at the same time. These are cards that can start a Chain Link 1 or add up to an already started chain up to Chain Link 2,3,4 or higher if possible.
All of these types of cards fall under Spell Speed 2:
Quick-Play Spell Cards
Normal & Continuous Trap Cards
Quick Effects
Quick-like Effect
Spell Speed 3, these are the fastest effects out of the 3. You can't start a Chain Link 1 with these cards but you can always start a Chain link 2 or higher with these, if a Chain Link involving a Spell Speed 3 effect happens then the only way to keep responding to the effect is with Spell Speed 3 effects and nothing else. Spell Speed 3 effects can activate even before a monster is summoned to the field or a card effect is activated.
All of these types of cards fall under Spell Speed 3:
Counter Trap Cards.
These effects can usually be associated with the hint timing or Set Type of the effect.
But if we have an effect that says "Once per turn you can.."
the type of effect would look like this:
e1:SetType(EFFECT_TYPE_IGNITION)
and the amount of times we can use this effect would look like:
e1:SetCountLimit(1)
And if we want to increase the amount of times we can use this effect, we just change the (1) to (2) so we can use it 2 times per turn or even 3 if we want by changing it to (3) or even have no limit by not putting a CountLimit.
^This is an example of a Spell Speed 1 Effect.
If we have an effect that says "When you.." or "When" in general
the type of effect would look like this:
e1:SetType(EFFECT_TYPE_TRIGGER_O)
^This is an example of a Spell Speed 1 Effect.
For example, an effect that would say "During either player's turn.."
the type of effect would look like this:
e1:SetType(EFFECT_TYPE_QUICK_O)
^This is an example of a Spell Speed 2 Effect.
If we have an effect that would say "When a monster would be summoned" or "When a card would be activated" usually the type of effect would look like this:
e1:SetType(EFFECT_TYPE_ACTIVATE)
^This is an example of a Spell Speed 3 Effect.
If you want to see more Type of effects for different cards, look through Lua files of cards with similar timing like "During the battle phase" or "When your opponent would.." to get a better understanding of how Speed timing effects work.
~Jack