Skip to content

A basic scripting tutorial

Naim edited this page Feb 1, 2026 · 3 revisions

This is meant to be a very basic guide for beginners.

This is currently incomplete. Last edit: 01-February-2026

In this tutorial you will learn:

  • how to create a database with your card's properties and where to keep it. (Done)
  • how to add a card's picture to the game. (Done)
  • how to create and name a script file. (Done)
  • how to create a working script with its initial effect. (Done)
  • how to test a card. (WIP)
  • how to create a trigger effect. (WIP)
  • how to create a continuous effect. (WIP)
  • how to create an ignition effect. (WIP)

What programs you will need (read this page if you want to know about other options) :

  • Edopro
  • a program to edit databases. Here we will use DataEditorX.
  • a program to edit scripts. Here we will use Notepad++.
  • the picture for your card (optional)

For this exercise, we will add to the game both the database and script for the following custom card:

Deskbot 002+

Machine/Earth/Tuner/Level 3/ATK 500/DEF 500

If this card is Summoned: You can add 1 "Deskbot" card from your Deck to your hand. All Machine-Type monsters you control gain 500 ATK and DEF, except this card. Once per turn: You can draw 1 card per each Machine monster you control.

Creating the database

Steps:

1 - Open DataEditorX. If it is not in English, go to the menu that has an H, choose the second option, then select English. Then restart the game.

Captura de tela 2026-02-01 150318

2 - Go to File, then to New.

3 - Select your edopro folder, then select the expansions folder. This is where the file will be kept.

4 - Type a name for your file, for example, mycustoms, then press Save.

5 - In the next screen, if the file was successfully created, DEX will ask you to open it. Select Yes.

Now you have a new database file, which is empty because we did not add any cards to it yet.

Adding a card to the database

The bare minimum information the database needs to identify a card is:

  • its name. On DEX, that is added in the big box above the area for a card's picture.
  • its passcode/id. On DEX, that is added in the Code field.
Captura de tela 2026-02-01 151240

Steps:

1 - Type the name of the card: Deskbot 002+

2 - Insert its passcode in the Code field: 270270001

3 - Press Add.

Note: we're using an 9-digits ID following the guidelines here to avoid conflicts with existing cards in edopro.

The steps above are enough to have the card correctly set in the database, which means that once you restart edopro, you'll be able to find it in the Deck editor. Try it out! You should notice, though, that several details are missing. We will add them in the next step.

Editing a card in the database

Let's learn how to modify a card's database entry.

Steps:

1 - Open DataEditorX

2 - Go to File, then to Open.

3 - Select your edopro's expansions folder, then select the file we created in the previous step, which should be named mycustoms.cdb, then press Open.

4 - Fill in all the fields for your card's properties:

  • ATK: 500
  • DEF: 500
  • Attribute: EARTH
  • Level: 3
  • Race: this is the monster's Type, so we are going to select Machine.
  • Archetype: Deskbot (you can either pick it from the dropdown menu or type is value. Since it is 0xab, you would type ab in the box for the first archetype.
  • Card Type: this is an Effect monster, so check those two boxes. But it also also a Tuner, so you need that checked too.
  • OT: this field tells the game the 'availability' of the card. If it is an TCG exclusive card, an OCG exclusive, or a card available in both regions (TCG/OCG), but it also identifies unofficial cards, such as manga, anime, Video Game exclusives, cards from Rush or only from the Speed Duel format, etc. Since this is a custom card, we will choose "Custom".
  • Add the text for its effects too: If this card is Summoned: You can add 1 "Deskbot" card from your Deck to your hand. All Machine-Type monsters you control gain 500 ATK and DEF, except this card. Once per turn: You can draw 1 card per each Machine monster you control.
  • Category: categories are used in edopro's Deck editor, as filter for your result in the Effect box. This is optional. Considering our card's text, we can select "Search", "Change ATK/DEF" and "Draw".
  • Script texts: these are 16 slots for strings that every card can hold. They are called by your script when the card needs to show some text (for example, in a prompt with a Yes/No question, in the description of an effect, etc.). Let's leave them empty for now.

5 - Press the modify button

Captura de tela 2026-02-01 154012

Now that every detail has been added to the database, restart EDOPro. Once you do it, you'll see the card with all of its information correctly set in the Deck editor.

Note: You might need to check the "Alternate format" option in edopro because now your card is (correctly) labeled as a custom.

Adding a picture

Pictures are optional because they have no purpose other than being a graphical resource to help identify the card more easily. They don't affect anything else in the game.

Steps:

1 - Create/download your picture. It must be either a PNG or JPEG file. Edopro only supports those types of pictures.

2 - Name it after your card's ID. In the previous example, we set as the ID of our card the number 270270001, so your picture for that card should be named 270270001.PNG or 270270001.JPG (or JPEG).

3 - In your PC, open edopro's folder and then open the expansions folder.

4 - Create a new folder, inside the expansions folder, called pics.

5 - Put your picture file in this folder, then open edopro.

You should now see the picture for your card in the Deck editor and during a duel!

Scripting the card

GetID

The first step, which you'll find in every script is to obtain two variables, which we will call s (a table), and id (an integer). They are obtained with the GetID function. So the first code lines would be

local s,id=GetID()

Here we call the GetID function using the function call operator (), then we store what is returned from that function in two local variables (s and id). s is a table, unique per card script, where you store all helper functions for this card which includes effects, summoning procedures and everything that is a code specific for this card. id holds the card's passcode/ID, if you neeed for some operation (usually used to request its strings, that we could have set in the "Script texts" in DataeditorX)

Q: Why do we use this line ?

A: Before GetID() was introduced, scripts often looked like this:

function c270270001.initial_effect(c)
	...
end

where you would need to manually reference the c270270001 table everytime you added something to to the card whose ID is 270270001. That could cause copy-paste errors, mismatched IDs and was just harder to maintain (for example, when a pre-release card had its ID changed to the official one, every occurence of c12345678 would have to be replaced by the new ID).

With GetID() you get automatic ID binding, a clean namespace and the script is safer to reuse and refactor.

Initial effect

Almost every card needs an initial effect. That initial effect is defined in a function called initial_effect and the game will try to call that for every card when a duel starts, except for Normal monsters that are not Pendulums. If it cannot find it, it gives you an error, which can happenen when:

  • the script is not in the correct folders, so the game could not find it.
  • the script is not named with the same ID of the card. If your card's ID is 270270001, then its script must be named exactly c + ID + .lua, which is c270270001.lua in this case.
  • you made a typo and didn't name the function exactly initial_effect

The initial effect will be added to this script's table, which we called s in the previous step, and it takes 1 parameter, which is a Card object. In code, that would be:

function s.initial_effect(c)

end

So now our full script is:

local s,id=GetID()
function s.initial_effect(c)


end

Having the function for the initial effect properly declared is enough for game to identify the card, even if it is empty just like the code above. Now if you already have your card's database and try to start a duel with it, the game will not give you any errors. The card will still do nothing because we did not script any of its effects yet, but that is the next step!

First effect

Let's now start with the actual effect of our card. The first part is a trigger effect that reads as:

If this card is Summoned: You can add 1 "Deskbot" card from your Deck to your hand

Clone this wiki locally