Ok. I noticed a lot of people want to make their custom cards but a lot of them were unsuccessful. What I do is still the same as I started, by copy-pasting but I learned how to make the overall easier.
Let's start with the basics.
NOTE: The tutorial is below is extremely outdated and will only be used when I refer it during my Tutorial, skip ahead.
http://www.ygopro.co/Forum/tabid/95/g/posts/t/120/Adding-cards-to-YGOPro--Tutorial----Scripting-video-Added Basically, I also use SQLite since it's kind of easier for me rather than using a Card Packer.
First off, we use cdb files, there is one in-game by default but adding cards directly to that can risk being deleted in the next update. So I promote the use of the expansions format which was added years back.
To use the expansions format, you have to use to have a cdb and a zip and place them in the expansions folder.
And due to the difficulty for adding an effective expansions format, I decided to include the template here for the ease of reusability. Basically, this includes the .cdb and .zip when extracted. The .cdb is the empty database while the .zip contains pics and scripts folders where the .jpg, .png and .lua files will be placed. For first timers, these files are to be placed in your expansions folder and rename them to anything to avoid accidental overwriting of files. Remember as well that in order to overwrite their contents or to apply changes, YGoPro must be closed. Plus, even if you update the official YGoPro game, you won't lose your Custom Cards.
Empty Expansions Template text tab in the cdb in SQLite. Refer to Jackmoonward's Tutorial.
And now we move on to the
data in SQLite.
First of all, the concept in SQLite uses 2 number types. Decimal and Hexadecimal. Decimal is 0-9 which is the one we use and Hexadecimal is 0-F (A-F are equivalent to 10-15). SQLite can only read Decimal but its values are solely based on their Hexadecimal counterpart. By opening your Calculator (in Windows, a scientific calculator also works but I think the one in my laptop is easier), go to
View and change it to Programmer (Alt+3 in my laptop, Windows 😎. Now you see the
Dec and
Hex at the left side? That's where you gonna use the whole time.
In order to convert a hex value to decimal, simply copy-paste the sum (if any) of the hex values, then click on dec, now copy-paste that into your SQLite.
--we'll use this the entire time!idWhich is your card number, it should be the same number as the one in your
text tab.
ot --This is to check the availability of cards and where is it usable.To make it simple, it's to check if it's for OCG, TCG, etc. Oh and I decided to change this to decimal already instead of hex, because rarely will you add values and if you do, it's usually just TCG and OCG.
OCG - 1
TCG - 2
Anime - 4
Illegal - 8
Video Game - 16
Custom - 32
alias --We add this for the sake of same name cards.We use this mostly for cards with the same artwork, such as Dark Magician, or Blue-Eyes White Dragon. And also with Anime counterparts of cards.
setcode The setcode is the archetype of your cards.Jackmoonward has explained this in his tutorial but it's all outdated. I cannot give you the complete list of archetype yet but I'll reshow you how it works and to check each setcode that exists.
How exactly (and basically) these setcodes work.
--Like I said, it all starts with the hex.
All cards are cut off by 4 hex digits. XXXX XXXX (spaces don't exist when scripting or in the calculator, just to show you.)
0 obviously when converted to decimal is also 0 --This means it has no setcode, or in short, no archetype.
Each archetype is 3 digits. But the fourth one (from the right) is the extension archetype.
If ever the setcode has less than 4 hex digits, like in decimal, the 0s from the left are removed.
Extension Setcodes have a rule. To create a new setcode extension ONLY, it has to be in the multiple of 1-2-4-8. So basically, a maximum of 4 setcode extensions. Always remember that these are in hex so if you want to combine extension setcodes such as 8+4=12 => C => Cxxx wherein xxx is your base setcode number.
Example:
roid uses 0x0016 --0s will be cut off.
Vehicroid uses 0x1016 --0 will not be cut off since it's in the middle.
Speedroid uses 0x2016
Now just take the numbers, roid use 16, Vehicroid use 1016, Speed Roid use 2016 and convert them to dec from hex.
Now they will become 22, 4118 and 8214 respectively. And if you want to make a Custom Roid, you can use any of these or make a new extension, using 4016 or another number.
If you want to combine these extension setcode such as a Vehicroid + Speedroid. Add the 2 numbers 1+2=3 => 3016.
How to check if a specific setcode exists:
So you have thought of your setcode number, better if it's in hex since everything's basis will be here.
If it's decimal, convert it first to hex to ensure it's not an Extension archetype.
Convert your number in decimal and type it into the search filter at the top at setcode.
If there are results, it means your archetype is taken and you may want to check YGoPro who uses it.
Copy the id of that card and search it in the database. Now you'll see which cards use it. "Chronomaly", "Ally of Justice", etc.
Repeat until you find one which no one uses. Although if the archetype is by an Anime Card BUT NOT using the card number 51100XXXX, 51200XXXX, 810000XXX, 800000XXX, 888000XXX, then it's fine to use since those setcodes are wrongly made and shouldn't have been there.
NOTE: you can open the main database or expansions database, usually you'll only find my given numbers at the expansions folder.
How to make a card of an existing archetype OR make an extension of an existing archetype.
FIrst, it would be better if the card you search has exactly 1 archetype. Searching for Number 39: Utopia, but you only want Number? This is a bad choice, you better search for a different card like Number 85: Crazy Box
Now take its card number in YGoPro, beside its name on the right under its picture. The card should show up as soon as you type in its whole card number. If it didn't show up, and it's an official non-Anime card, search the number online.
Now copy this whole card number and paste it in the search filter in SQLite in id.
Check this setcode, convert it to decimal to check if it's an extension archetype (If ever you want it to be a part only of the main archetype and not the specific one).
To make an extension, just convert it to hex, add 0s so it becomes 4 digits and change the 4th number, from the right, to another number.
If you can't find a specific card, it's probably in expansions folder. If you can't find the SINGLE setcode, try dividing the hex-ed setcode to 4 digits. Check each combination (convert to dec and check the search) on which it corresponds to. And the one left with probably no results, then that's probably the one you're looking for.
Example:
Number C1000: Numerronius --this is in expansions folder btw.
So you can find Number C but you will never find Numerronius, just cut the setcode into parts and you should find Numerronius.
Type --card type, just beside setcodeNow the card numbers, Jackmoonward missed the Pendulum Era and I'm going to explain how it works in hex format. Just add the values and convert them to Decimal to make your card's type.
This is more likely explained in Categories just a few steps below this so you may want to check it out if you didn't understand my explanation. Oh yeah and remember, disregard the "0x"
Monster 0x1
Spell 0x2 --Normal Spells plainly use this, no need to use the "Normal" for monsters.
Trap 0x4 --Same goes for Normal traps
Normal 0x10
Effect 0x20 --Don't forget this because your card may be immune to Skill Drain but we have to be fair for everyone unless it's really a unique card.
Fusion 0x40
Ritual 0x80 --This is both for the Monster and the Spell
Spirit 0x200
Union 0x400
Gemini 0x800
Tuner 0x1000
Synchro 0x2000
Flip 0x200000
Toon 0x400000
Xyz 0x800000
Pendulum 0x1000000
Quick-Play 0x10000
Continuous 0x20000 --Same goes here, both Spell and Traps use this.
Equip 0x40000
Field 0x80000
Counter 0x100000
Level --More likely because of the PendulumsNow, for any level (or Rank) (even above 12), just type in the number, simple as that.
As for Pendulum Scales:
As usual, SQLite goes back to hex. And it's the same with setcodes, use 4 digits. With Pendulum Scales, you will have 8 digits. Use hex (meaning A-F for 10-15 or even higher).
XX XX XXXX --this will be your format for Pendulums.
Left Scale, Right Scale and Level.
Example:
Pendulum Scale 1, 12, Level 10
01 0C 000A => 10C000A => convert to decimal => 17563658 --now this is your level
Yes, it's possible to make cards with different Left and Right Scales.
race --aka monster typeFor this, you can have multiple values at the same time, but most the users will only use one. I included the decimal because of this exact reason
0x1 Warrior 1
0x2 Spellcaster 2
0x4 Fairy 4
0x8 Fiend 8
0x10 Zombie 16
0x20 Machine 32
0x40 Aqua 64
0x80 Pyro 128
0x100 Rock 256
0x200 Winged Beast 512
0x400 Plant 1024
0x800 Insect 2048
0x1000 Thunder 4096
0x2000 Dragon 8192
0x4000 Beast 16384
0x8000 Beast-Warrior 32768
0x10000 Dinosaur 65536
0x20000 Fish 131072
0x40000 Sea Serpent 262144
0x80000 Reptile 524288
0x100000 Psychic 1048576
0x200000 Divine-Beast 2097152
0x400000 Creator God 4194304
0x800000 Wyrm 8388608
0x1000000 Cyberse 16777216
0x80000000 Yokai 2147483648 --This isn't permanent since this is an Anime-only monster type, this can change as Konami makes new types. Also this doesn't have its constant in-game and will always show up as ???
attribute Refer to Jackmoonward's Tutorial.
CategoryThese are used when searching a card in the game. So the categories are used let's say. I want a card that destroys monsters, then you see the "Effect" at the right side full of checkboxes.
--Don't be lazy guys, please add this when you make a card.And here's quoted by SGJin who knew how it works:
--P.S. The numbers below have 0x before the values, disregard those, just copy the numbers after it.
Well if you are going to use SQLite, then I hope you are familiar with Hexadecimal.
Each category is assigned a Hexadecimal value.
S/T Destroy =0x1
Destroy Monster =0x2
Banish =0x4
Graveyeard =0x8
Back to Hand =0x10
Back to Deck =0x20
Destroy Hand =0x40
Destroy Deck =0x80
Draw =0x100
Search =0x200
Recovery =0x400
Position =0x800
Control =0x1000
Change ATK/DEF =0x2000
Piercing =0x4000
Repeat Attack =0x8000
Limit Attack =0x10000
Direct Attack =0x20000
Special Summon =0x40000
Token =0x80000
Type-Related =0x100000
Property-Related =0x200000
Damage LP =0x400000
Recover LP =0x800000
Destroy =0x1000000
Select =0x2000000
Counter =0x4000000
Gamble =0x8000000
Fusion-Related =0x10000000
Tuner-Related =0x20000000
Xyz-Related =0x40000000
Negate Effect =0x80000000
To assign a category to a card in SQlite, you need to take the Hexadecimal value of the category and convert it into Decimal. Then place the Decimal value of the category into SQLite.
Basic Example 1:
-Compulsory Evacuation Device has the category "Send Back to Deck".
-The Hex value of the "Send Back to Deck" category is 0x20.
-0x20 in Hexadecimal is the value 32 in Decimal.
-Place the value 32 into the Category cell in SQLite.
-Compulsory Evacuation Device now has the "Send Back to Deck" category assigned.
For cards with multiple categories, you have to add the Hexadecimal values together.
Advanced Example: Relinquished
-Relinquished is assigned the categories, "Control, Change ATK/DEF, Damage LP, and Destroy".
The Hex values for the catagories are:
0x1000(Control)
0x2000(Change ATK/DEF)
0x400000(Damage LP)
0x1000000(Destroy)
Adding them all together gives you a Hex value of "0x1403000" Which converts to the Decimal value "20983808" in the database.
The scripts should have the same card number as your card.
The file should be named
cXXXX.lua wherein
XXXX is the card number.
A lot of things in the script ends up with the keyword
end.
Your script starts off with
function cXXXX.initial_effect(c)and you close it with end
Here's an empty script with no unnecessary codes.
function cXXXX.initial_effect(c)
end
You can change
constants.lua in strings folder for effects, races, attributes, etc. but make sure you
DON'T MODIFY ANYTHING there!!!
Now, here are the basic lua-based codes I've used so far:
1.
-- - single line comment - this really doesn't affect your code but it sometimes helps when you want to recheck your code for errors, clues for newer cards, etc.
2.
--[[ and
]] - multiple line comment - same as above and like I described it, multiple lines. You have to close every
--[[ with an
]] somewhere else or your entire code would become a comment and would render useless.
3.
end - widely used to close functions, if-else statements, etc. Even used in your initial function.
4.
function - I never use this by typing since I might make a mistake.
* You can only have
1 .initial_effect in every script or it might cause errors. But you're gonna use an amount of other functions.
5.
if,
then,
else,
elseif - conditions - it works like this:
if condition then --you need then after the if and elseif
--do somthing here
elseif another condition then
--do something else
else --if your elseif and else will be empty, don't use them anymore.
--another thing
end --see? The closing is important
6.
and and
or - used in conditions. When you make multiple condtion(s), you need these.
* You can use parenthesis ex.
(condition and condition) or another condition7.
while and
do - if then is as is but this one is for loops. Instead of
then, this uses
do
while variable<5 do
variable=variable+1 --just make sure it doesn't become an infinite loop or the game might crash
end
8.
return - actually, it's literal. It would return whatever is your result, either
true and
false or a value.
* In an operation, when you use
return, it would end the function.
9.
true and
false - returned results for conditions and filters.
10.
nil - it means it contains nothing, not a number value, nothing, not even a 0.
11.
local - used to create A HUGE AMOUNT of things. Effects, variables, etc.
IMPORTANT: when making variables, make sure you check where you place them.Here's an example when making locals in the function:
function cXXXX.op(e,tp,eg,ep,ev,re,r,rp) --these variables will be taught later
if condition then
local ex=5 --made a variable inside
end --some kind of cutoff, you cannot use the local variables inside.
ex=ex+1 --you cannot access the "ex" variable above since it's inside and this is outside it.
end
Variable making - you can use
any other name for an effect, group of cards, number, etc.
Just make sure you don't use the predefined variables.
function cXXXX.op(
e,tp,eg,ep,ev,re,r,rp)
--highlighted are the predefined variables.In the initial effect, there's only 1 variable which is c which means itself.
In effects, you don't need to use e1, e2, e3, e0, etc. But sometimes, it's easier just to use this to prevent confusion.
Not sure if it also applies to lua but in other coding, it's a must that you cannot start with a number and numbers should always go last.
So far, here are the possible codes that tested legal:
effec --I meant to remove the t. It might be a keyword, I haven't tried.
uu1572
another_name --yes you can use underscores but it's unconfirmed if you can use other symbols
You can use the predefined variables but you cannot create another with the same name.Meaning of predefined variables I know:
c - when in filters, this means to check any of the cards, when in summoning procs., this means itself.
Example: You can Normal Summon this card by Tributing 3 monsters. Check Beast King Barbaros or Egyptian God Cards.
e - effect. Which effect? Its own effect.
tp - player. Not sure which, but most likely, the player using the effect.
eg - event group. When you have something like "When a card(s) is destroyed", this will be the eg
ep - event player. When you have something like "When your opponent summons an monster"
ev - event value. When you have something like "When you take 2000 or more damage"
re - reason event. Not sure if this is correct but this worked for some cards. "When this card is summoned by a Spell Card"
r - reason. I haven't used this but I already saw how it works. "When this card is destroyed by a Trap Card"
rp - reason player. This is different from ep, just learn more and you will understand. "When this card is banished by an opponent's card effect"
og/tuner - taken from Number F0/Hundred Eyed Dragon (TF) - sometimes, when you use special special summon conditions. I think you can change it to any variable, but to avoid confusion, let's choose the best variable. - meaning overlay group or make it like sg (synchro group) or whatever. [:lol:]
This is more likely a predefined code to check the required materials to summon them.
Now, as much as possible, copy-paste from other cards to avoid errors. It's okay to copy-paste as long as you have a wide idea on scripting.
Example: Special Summon conditions - take from Number F0, Lava Golem, etc.
Cannot be Special Summoned - take from Ancient Gear Golem
I can't script from scratch but I can combine scripts together since I understood how they work.
Make realistic effects. I tried and you cannot attack from hand, you cannot detach Tokens without the game crashing (except with a code I've learned on my own. Ask me if you want to learn about this.)
Now, let's start off with the initial effect in YGoPro LUA scripting.
Just like what I said, this initial effect is necessary, it can be empty but it is a must.
function cXXXX.initial_effect(c) --contains "c" which means itself
end
You can add a lot of things inside but as much as possible, use normal effects.
I'll start off with the common normal effects.
Effect making. See the contents below and it will contain the basic effect with any use. Explanation is included.
local e1=Effect.CreateEffect(c) --local to make the effect, e1 is the variable name and we got the Effect.CreateEffect
--contents will be placed here but will be explained later. The c above is a single card making the effect.
--This explains why some effects are negatable by Skill Drain because it's their own effect and not another card's.
c:RegisterEffect(e1) - The c here is the card that gains the effect.
--also, don't forget to register that effect with :RegisterEffect(e1). You can register it at any point of the script, but not outside of that function, or your card wouldn't gain that effect.
local e2=Effect.CreateEffect(e:GetHandler()) --this used e:GetHandler() instead of c because it came from an operation (like the effect within a chain, like "Destroy 1 card on the field")
Duel.RegisterEffect(e2,tp) --Duel.RegisterEffect(e2,tp) is commonly used in effects and rarely on the main function. These are most likely unnegatable effects but you cannot define where it activates, etc. This should only be used to check actions, happenings, etc. (Like "If you had tributed a "Genex" monster this turn")
--if in case, you'll really need to use this, just replace the tp to 0 or 1. The player's value is either 0 or 1. And it's not declared in the main function. 0 is you, 1 is your opponent, 2 for none and 3 for all (2 and 3 can be checked in constants.lua)
Remember, constants.lua is very crucial if you're a beginner and will be used in the next parts of the tutorial or you can just copy from other cards. [:tongue:]
All the Card Codes and Duel Codes are here but of course, explanation and parameters are not included. I will explain them when I'm finished with all the basics.
Card/Duel Codes - interpreter.cpp Now we get to the parts of the effects.
Remember, there are a huge amount of effects in the game, chain effects, continuous effects, effect that is applied like "cannot be destroyed by battle".
Remember that in the effect itself, the named effect, like e1 from the main function, is now the current "e" in the effect itself.
e1:SetDescription(aux.Stringid(XXXX,n)) - when activating more than 1 of the same timing of effect, this would show up.
e1:SetDescription(aux.Stringid(XXXX,n)) --I had to repeat a lot of things to ensure you guys understood.
--e1 is the effect as usual, underlined
--the one in bold is the important part here. When you activate an effect, it will ask you which effect to activate.
--Highlighted is which string is used. These strings can be checked in SQLite or any Card Manager. Strings are just phrases to help you out within effects.
--just add a +1 (from the script) to see which string is used in the Card Manager.
e1:
SetCategory(some category/ies) - used in Trigger, Quick and Activation Effects. This is to check if chaining effects are what type of effect.
e1:SetCategory(some category/ies) --I had to repeat a lot of things to ensure you guys understood. (yeah this is copy-pasted.) [:lol:]
--e1 is the effect as usual, underlined
--Highlighted part is the Categories. Found in constant.lua.
Example:
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_RELEASE+CATEGORY_DECKDES) --this effect destroys, tributes and mills.
e1:
SetType(some type/s) - used to know what type of effect is used in that effect. There are only a few so I better include my explanation here.
All the effect types are explained within the spoiler.
e1:
SetType(some type/s) --I had to repeat a lot of things to ensure you guys understood. (yeah this is copy-pasted.) [:lol:] --e1 is the effect as usual, underlined
--Highlighted part is the Type. Found in constant.lua.Example:
e1:
SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) --this effect triggers, optional and single which means "When this card is"
--Remember that you can combine them as long as they are appropriate.EFFECT_TYPE_SINGLE --used in continuous effects that affect itself. Example: This card cannot be destroyed by card effects.
--also used to trigger "When this card is summoned" or "When this card is destroyed", etc.EFFECT_TYPE_FIELD --opposed to SINGLE, this is used in effects that affect more than one card. Example: Monsters you control are unaffected by card effects.
--also used to trigger/chain "When a monster was banished", "When a spell card is activated", etc.
--an exception, this is also used for Special Summon Protocols. Like Sp Summoning Lava Golem.EFFECT_TYPE_EQUIP --used when effect affects the equipped monster. Example: The equipped monster gains 500 ATK.EFFECT_TYPE_ACTIONS --This has never been used for real but it's likely to check if an effect is activated. This is a part of EFFECT_TYPE_ACTIVATEEFFECT_TYPE_ACTIVATE --This is used for Spell and Trap Activations, as well as PendulumsEFFECT_TYPE_FLIP --self explanatory, this is used when it Flips. Flip Effect Monsters.EFFECT_TYPE_IGNITION --these effects are Spell Speed 1 and cannot be chained, this effect is used with effects that can only be used during your Main Phase.
--Examples: Valhalla, Hall of the Fallen, Blizzard Dragon, Thunder Dragon, MezukiEFFECT_TYPE_TRIGGER_O --combined with the SINGLE or FIELD
--Remember that TRIGGER effects are delayed and mostly won't be chained to other effects, meaning the whole chain must resolve first before this applies, unless it's chained to another trigger effect.
--O means Optional.
--The whole thing seems self-explanatory thoughEFFECT_TYPE_TRIGGER_F --same with above
--F means Forced.EFFECT_TYPE_QUICK_O --now, the Quick effects. Some effects don't require the FIELD. But remember, TRIGGER effects can rarely be chained and QUICK can always be chained so this is why there are times we need to use this.
--QUICK effects can still work without the FIELD but well it's more of analysis.
--can usually be chained to any effect.EFFECT_TYPE_QUICK_F --same with above but ForcedEFFECT_TYPE_CONTINUOUS --same with QUICK_F but this doesn't trigger. It's like an invisible effect and shouldn't be used combine with to EVENT_FREE_CHAIN.
--This also requires FIELD
--this is why The Fabled Unicore can negate Super Polymerization since it's CONTINUOUS.Legit combinations of effects:
- EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F
- EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O
- EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F
- EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O
- EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O
- EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_F
- EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS
- EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O
- EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP --This is forced activation
--There are more possible effects but here are the ones that are ensured to work.
I haven't listed everything but it's because I'm quite busy. I just want to make a head start for now.
e1:
SetRange(some range/s) - used to know where the effect is applied. There are also a few so I'll include my explanation here.
All the ranges are explained within the spoiler.
e1:
SetRange(some location/s) --I had to repeat a lot of things to ensure you guys understood. (yeah this is copy-pasted.) [:lol:] --e1 is the effect as usual, underlined
--Highlighted part is the Locations. Found in constant.lua.Example:
e1:
SetRange(LOCATION_MZONE) --this effect applies while it is in the monster card zone
Same with above, you can combine them all, the only difference is you can combine ANY and ALL of them--Also, this is mostly self-explanatory so I will only explain minimallyLOCATION_DECKLOCATION_HANDLOCATION_MZONELOCATION_SZONELOCATION_GRAVELOCATION_REMOVED --now called the banished zone.LOCATION_EXTRALOCATION_OVERLAY --This is not yet tested so it's not ensured to work.LOCATION_ONFIELD --This is literally the combination of LOCATION_MZONE and LOCATION_SZONELOCATION_DECKBOT --I included this since it's in constants.lua, this is NOT used for Ranges but for effects like SEND_REDIRECT, this means DECK BOTTOM LOCATION_DECKSHF --Same with the last one, it's NOT to be used for SetRange, which means DECK SHUFFLELOCATION_FZONE --Field Spell ZoneLOCATION_PZONE --Pendulum Zone--You may notice that beside each of them in the constants.lua, there are hex values right? Sometimes if you're effect applies in many places like
HAND,
DECK and
GRAVE, it's better to add their hex codes indtead of adding them one by one.
SetRange combinations example:
LOCATION_HAND+LOCATION_GRAVE
0x0f --LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD, but see the point that ranges become way shorter if you use the values instead? 1 or 2 ranges won't be a big deal but imagine having 3 or 4 or more
--Now the REDIRECT will explained way further but if you're already wondering how about DECK TOP when redirecting, it's just LOCATION_DECK
e1:
SetTargetRange(Your range,Your opponent's range) - used to know which player/ side is affected by the card effect. There are also a few so I'll include my explanation here.
All the target ranges are explained within the spoiler.
e1:
SetTargetRange(Your range,Your opponent's range) --I had to repeat a lot of things to ensure you guys understood. (yeah this is copy-pasted.) [:lol:] --e1 is the effect as usual, underlined
--Highlighted part is the Locations or player(s). Found in constant.lua/ or if player(s), just 1 and 0s.
--Also, this effect is usually used in combination of SetCodes like EFFECT_CANNOT_ATTACK or EFFECT_CANNOT_SUMMON (There is no assurance this exact code is correct, just check constants.lua)
Examples:
e1:
SetTargetRange(LOCATION_MZONE,0) --this effect affects those in YOUR Monster Card Zonee1:
SetTargetRange(0,1) --this effect affects your opponent
The target ranges are the same with SetRange
The following constants cannot be used: LOCATION_OVERLAY, LOCATION_DECKBOT, LOCATION_DECKSHF, LOCATION_FZONE, LOCATION_PZONE
The only simple rule is you can only use Ranges or player and not a combination.
Left is yours while Right is your opponent's.
You can use any number of ranges and 0 is unaffected.
e1:
SetCountLimit(Number) - used to know how many times you can use an effect.
There are also a few so I'll include my explanation here.
All the count limit formats are explained within the spoiler.
e1:
SetCountLimit(Number) --I had to repeat a lot of things to ensure you guys understood. (yeah this is copy-pasted.) [:lol:] --e1 is the effect as usual, underlined
--Highlighted part is the number(s).
Examples:
e1:
SetCountLimit(3) --You can activate each card's effect up to thrice per turn. Volcanic Slicer is a good example, but only activatable once per turn, per card while in the proper LOCATIONe1:
SetCountLimit(2,82114013) --Same with above except this applies that this card number can only be used that number of times for each turn. Gimmick Puppet Twilight Joker is a good example here. This effect can only be used once per turn.e1:
SetCountLimit(1,917796+EFFECT_COUNT_CODE_OATH) --Now this time, it's used for Spell/Trap Activations. Gagagatag is the used example here.e1:
SetCountLimit(1,14785765+EFFECT_COUNT_CODE_DUEL) --This works as "number" times per duel but I haven't tested this on Spell/Trap plain Activations. Blackwing - Zephyros the Elite is the used example here
These "Once per turn" effects don't just apply for effect activations, triggers and quick activations. They also applies for Card Effects like the current Temple of the Kings or Pierce effects.
I've added an extension to this tutorial.
Hardcoded Stuff
Edited by user
2017-11-08T03:13:33Z
|
Reason: Update