

If chkc then return chkc:IsOnField() and chkc:IsFaceup() end If chk=0 then return e:GetHandler():CheckRemoveOverla圜ard(tp,1,REASON_COST) endĮ:GetHandler():RemoveOverla圜ard(tp,1,1,REASON_COST)įunction stg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Saving as another file and cutting out what we don’t need, we should come up with a file that looks like this:Į3:SetDescription(aux.Stringid(48905153,1))įunction scost(e,tp,eg,ep,ev,re,r,rp,chk)
#GIDEO AI YGOPRO CODE#
In addition, that segment of code references the functions “scost”, “destg” and “desop”, so we’ll need those. Luckily, official card scripts are written to a standard that includes heading comments for each effect, so we can see that we’re interested in the heading “-destroy”. Now that we have the script, we’ve got to figure out what part of it is relevant to us.

script command to display it in Discord, with a link if it's too long. There are multiple folders card scripts can be in, so it’s best to search in the base folder. To find its card script, go to your YGOPro folder and search “c”, the ID, and “.lua”, like so: id command if you don't need the extra info.) Simply put the card’s name between or, and Bastion will tell you everything about it, including the ID. Since Drident is a real card, you can find her ID on Yugipedia or even on a copy of the physical card, but we’re going to look it up the way that works with any card in Percy - with the Bastion bot. For this effect, we’ll start by modifying Zoodiac Drident. The first step in scripting a card is to find a cards with similar effects. Getting Started - Examining an existing script You can only use this effect of “Tutorial Test Card” once per turn. If you control no other cards (Quick Effect): You can discard 1 card, then target 1 monster your opponent controls with the same attribute as this card destroy it, then draw 1 card. Today we’ll be scripting the following monster effect, that I made up to show off as much of the process as possible: I’ll be using some mildly technical terms like “variable” and “parameter” in this tutorial. In addition, basic programming knowledge is very useful to understand what you’re doing and help prevent errors.
#GIDEO AI YGOPRO HOW TO#
#GIDEO AI YGOPRO WINDOWS#
A text editor - I use Notepad++ on Windows and Sublime Text on Mac.I don't mean to step on the toes of either of the two existing tutorials - this simply goes through the process I personally use, and focuses on scripting the cards as a complement to the others, which are more focused on creating the database. Rather than give the same advice however many times, I thought I’d write a tutorial going through how I script my cards, using an in-depth example. With the launch of Gideon’s Custom Server, there’s a surge of interest in learning how to script cards.
