Alistering
2012-12-05T13:57:06Z
Okay everyone, I need a explanation about this. I want to add these card:
- Cosmic Blast
- Wisel attack 5
- Granel Attack 3
- Granel Guard 3
- Grannel Top 5
Jackmoonward
2012-12-09T04:47:43Z
Originally Posted by: Alistering 

Okay everyone, I need a explanation about this. I want to add these card:
- Cosmic Blast
- Wisel attack 5
- Granel Attack 3
- Granel Guard 3
- Grannel Top 5



PART 1.

To answer your question you will need 2 programs but the second is optional.
Sqlite Expert Personal 
and
Lua Edit 2010 
if you don't want Lua Edit you can use Notepad or any basic text editor program.

Open the cards.cdb in your Ygopro folder with Sqlite and 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.
Double Click on one of the null areas that appear from pressing that and type in the info.
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*
and the name is the name of the card, the description is everything it says on it's effect. Change all the strings 1-16 to blank by pressing space so they aren't null, if you don't then Ygopro will never open and crash.

Press ok and change from "texts" to "datas" on the left and 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.." otherwise leave this as 0, Setcode is the archetype number, *For example 66 is Nordic and 88 is Wind-up* otherwise leave this as 0, Type is the type of card, *For example 33 is Effect Monster, 17 is Norma Monster, 2 is Normal Spell, etc., ATK DEF and Level should be obvious, race is the type of monster, *For example 256 is Rock and 1 is Warrior*, Attribute is obvious as well, and category can be left at 0 without worries. Now the card should be in the game once you click ok and save.
Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
Jackmoonward
2012-12-09T04:56:55Z
PART 2.

Now that you have added the card to the cdb and made sure you can see it in the Ygopro deck edit you want to add a picture. Get the card picture you want to use in card form like this:

Example Picture

Now open the picture in a picture editing program that can resize pictures. Resize it to 177x254 pixels and name the picture the same name as the Card Id of the card your adding in .JPG form. So 11111111.jpg and save it in the pics folder of your Ygopro folder. Then after its saved resize it again to 44x64 with the same name and save it as a jpg in the thumbnail folder of your pics folder in your Ygopro folder. If your making a field spell then you will need to open a field spell image in the field folder in your pics folder and make it look exactly the same as all the field spells in there look and make sure you save it in the field folder.
Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
Jackmoonward
2012-12-09T05:24:03Z
PART 3

Disclaimer; If the card your adding is a Normal Monster you can skip this step as they do not have Lua files.
Now Lua scripting is the hardest part. Open Lua Edit 2010, go to file in the top right < New < File and make a new Lua Script, or if your using Notepad or some other program just start with a blank file.

Now type -- and then the card name right after that on the first line.
Press space and type: function cXXXXXXXX.initial_effect(c) and all 8 Xs are what the Id number.
It should now look like this:
--Wisel Attack 5
function c11111111.initial_effect(c)

Press space and now type --X where the X is the type of effect it is;
Examples- defup, atkup, remove, spsummon, etc
You may want to compare other Lua files from other cards to see what you might need to put here.

So it will not look like
--Wisel Attack 5
function c11111111.initial_effect(c)
c:EnableReviveLimit()
--special summon

The c:EnableReviveLimit() is there because it has a specific Special Summon condition.
For every effect line it has we will need to put another --X.

Now press space and type:
local e1=Effect.CreateEffect(c)

This is what we type everytime we want to input a new effect, order of effects go by the eS, For example e1, e2, e3.
Now press space and type:
e1:SetType(X)

The X is the type of area it will be affecting, you can open the constant.lua file in your script folder in your Ygopro folder to see types of effects.
Since this effect will be tributing a monster from the field this will be;
e1:SetType(EFFECT_TYPE_FIELD)

Then press space and type:
e1:SetCode(X)
The X is basically the procedure this effect will follow so since it's based on how it's summon it's:
e1:SetCode(EFFECT_SPSUMMON_PROC)

Press space and type:
e1:SetProperty(X)
This is the property the effect follows, since we don't want copied for ruling issues it's:
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)

Press space and type:
e1:SetRange(X)
This is where the effect is being activated from, since you have to tribute a Wisel Attack 3 and summmon it from your hand it's:
e1:SetRange(LOCATION_HAND)

Press Space and type:
e1:SetCondition(cXXXXXXXX.spcon)
e1:SetOperation(cXXXXXXXX.spop)

These are the strings that say what the condition is and the operation that follows, so you have to control a Wisel Attack 3 and it's tributable and if that happens the operation is it's summoned from the set range being zone.
The Xs are the id number so the condition and operation aren't confused with other cards.

Now press Space and type:
c:RegisterEffect(e1)

This is to end an effect or the period that seperates effects, remember if it's e2 or e3 then the (eX) will be whatever number of effect that is.
Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
Jackmoonward
2012-12-09T05:37:56Z
PART 4

Now after you have added all of the "e" effects, "e1, e2, e3" we can move on to conditions, targets, operations, and so on.

If you have an effect that has something like:
e1:SetOperation(cXXXXXXXX.spop) or e3:SetOperation(cXXXXXXXX.operation) or e2:SetTarget(cXXXXXXXX.tg)
or something along those lines you need to add peripherals for these strings. If you don't have a card with something like this you can skip this part.

After the last "e" you need to type the magic work "end".
Like this:
--direct attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_DIRECT_ATTACK)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c100000043.tg)
c:RegisterEffect(e3)
end

Then press space and type this:
function cXXXXXXXX.S(E)
Where X is the Id Number for the card, S is the string like .operation or .sdop, and E is the extracurriculars added in the card effect; e=Effect, c=Card (I think), and tp=Targetplayer, that is as far as I know but compare other effect to what they have here until best results.

Then press space and type whatever follows up with the effect.
Let's try an example as a filter effect, I will use Barrier Statue of the Torrent's lua file for this.

function c10963799.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return c:IsAttribute(0xff-ATTRIBUTE_WATER)

The ID number replaces the Xs, the .sumlimit replaces the S as it has e1:SetTarget(c10963799.sumlimit) in e1 of ti's effect, and the Es are replaced by the extracurriculars, and after that is the filter that it's effect will be focused on water monsters.

After you finish with one function make sure you type end after it so the database knows it's finished otherwise this can lead to function errors or the "RED LETTERS OF DEATH" as I call them in a duel.

Once your done with the lua, save it as cXXXXXXXX.lua in your script folder in your Ygopro folder and the Xs are the ID number.

Not everyone can Lua an effect on their first try and the more complex the effect it is, the harder it is to lua so don't worry about failing but just keep trying. Hope I helped.

~Jack
Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
Alistering
2012-12-09T12:01:51Z
Thank you guys so much, I will never forget this.
ZONE7
2012-12-11T04:22:03Z
Not sure if I should create a new topic, but I'm trying to add the original version of Z-ONE's cards (i.e., more powerful effects, but you need Zero Machine Ain to summon them without Tribute). One card in and I'm already stuck; anyone know what's going on?



I need to add the restriction that e2 only works for level 10 monsters, but this is already buggy, anyone know why?
Jackmoonward
2012-12-11T19:21:10Z
Originally Posted by: ZONE7 

Not sure if I should create a new topic, but I'm trying to add the original version of Z-ONE's cards (i.e., more powerful effects, but you need Zero Machine Ain to summon them without Tribute). One card in and I'm already stuck; anyone know what's going on?



I need to add the restriction that e2 only works for level 10 monsters, but this is already buggy, anyone know why?



Hi, normally I'd say compare lua files to lua files. First to clarify, have you added this card to the cdb and tested it shows up in the deck constructor? This is important.

Now assuming you have done this, so far your doing this right.
I noticed something a bit odd though. In e2 you have the value set to "0x2" which as a decimal is 2 which means Normal Spells. No idea why you did that but it should be "0x20004" which is continuous trap as which Big Evolution Pill uses "0x20002" for continuous spell.
As for the filter you wish to use, this may help;
c11110000.filter(c)
return c:GetLevel()==10 and c:GetOwner()~=Duel.GetTurnPlayer()
end

Let me know if this doesn't work as I'm willing to help. Remember not everyone gets lua files right the first time as I still haven't mastered it.

~Jack
Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
ZONE7
2012-12-11T20:12:22Z
Originally Posted by: Jackmoonward 

Originally Posted by: ZONE7 

Not sure if I should create a new topic, but I'm trying to add the original version of Z-ONE's cards (i.e., more powerful effects, but you need Zero Machine Ain to summon them without Tribute). One card in and I'm already stuck; anyone know what's going on?



I need to add the restriction that e2 only works for level 10 monsters, but this is already buggy, anyone know why?



Hi, normally I'd say compare lua files to lua files. First to clarify, have you added this card to the cdb and tested it shows up in the deck constructor? This is important. Yes, shows up in the deck normally.

Now assuming you have done this, so far your doing this right.
I noticed something a bit odd though. In e2 you have the value set to "0x2" which as a decimal is 2 which means Normal Spells. No idea why you did that but it should be "0x20004" which is continuous trap as which Big Evolution Pill uses "0x20002" for continuous spell. Taken from Haze Pillar, when it was 0x1; I took a shot in the dark that this would make it 2 fewer Tributes.
As for the filter you wish to use, this may help;
c11110000.filter(c)
return c:GetLevel()==10 and c:GetOwner()~=Duel.GetTurnPlayer()
end

Let me know if this doesn't work as I'm willing to help. Remember not everyone gets lua files right the first time as I still haven't mastered it.

~Jack



I'm still getting a problem:
[Script error 🙂 "CallCardFunction"(c11110000.initial_effect): attempt to call an error function

Same thing I was having before, though I'm not sure why there would be a problem that early in the script.

Jackmoonward
2012-12-11T23:27:43Z
Originally Posted by: ZONE7 

Originally Posted by: Jackmoonward 

Originally Posted by: ZONE7 

Not sure if I should create a new topic, but I'm trying to add the original version of Z-ONE's cards (i.e., more powerful effects, but you need Zero Machine Ain to summon them without Tribute). One card in and I'm already stuck; anyone know what's going on?



I need to add the restriction that e2 only works for level 10 monsters, but this is already buggy, anyone know why?



Hi, normally I'd say compare lua files to lua files. First to clarify, have you added this card to the cdb and tested it shows up in the deck constructor? This is important. Yes, shows up in the deck normally.

Now assuming you have done this, so far your doing this right.
I noticed something a bit odd though. In e2 you have the value set to "0x2" which as a decimal is 2 which means Normal Spells. No idea why you did that but it should be "0x20004" which is continuous trap as which Big Evolution Pill uses "0x20002" for continuous spell. Taken from Haze Pillar, when it was 0x1; I took a shot in the dark that this would make it 2 fewer Tributes.
As for the filter you wish to use, this may help;
function c11110000.filter(c)
return c:GetLevel()==10 and c:GetOwner()~=Duel.GetTurnPlayer()
end

Let me know if this doesn't work as I'm willing to help. Remember not everyone gets lua files right the first time as I still haven't mastered it.

~Jack



I'm still getting a problem:
[Script error 🙂 "CallCardFunction"(c11110000.initial_effect): attempt to call an error function

Same thing I was having before, though I'm not sure why there would be a problem that early in the script.



Oh if only you specified the error before hand.
e2 is not the problem but e3 is.
e3:SetValue(c11110000.val)
Since you put the .val, you need a function c11110000.val()
Afterwards.
Whenever it says "attempt to call an error function" in red letters, this mean something is missing with the "e"s.
You have 2 "e3:SetValue" strings in e3, e3:SetValue(c11110000.val) and e3:SetValue(0) so just remove the .val one and it should work.

~Jack
Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
ZONE7
2012-12-12T01:52:52Z
Originally Posted by: Jackmoonward 

Originally Posted by: ZONE7 

Originally Posted by: Jackmoonward 

Originally Posted by: ZONE7 

Not sure if I should create a new topic, but I'm trying to add the original version of Z-ONE's cards (i.e., more powerful effects, but you need Zero Machine Ain to summon them without Tribute). One card in and I'm already stuck; anyone know what's going on?



I need to add the restriction that e2 only works for level 10 monsters, but this is already buggy, anyone know why?



Hi, normally I'd say compare lua files to lua files. First to clarify, have you added this card to the cdb and tested it shows up in the deck constructor? This is important. Yes, shows up in the deck normally.

Now assuming you have done this, so far your doing this right.
I noticed something a bit odd though. In e2 you have the value set to "0x2" which as a decimal is 2 which means Normal Spells. No idea why you did that but it should be "0x20004" which is continuous trap as which Big Evolution Pill uses "0x20002" for continuous spell. Taken from Haze Pillar, when it was 0x1; I took a shot in the dark that this would make it 2 fewer Tributes.
As for the filter you wish to use, this may help;
function c11110000.filter(c)
return c:GetLevel()==10 and c:GetOwner()~=Duel.GetTurnPlayer()
end

Let me know if this doesn't work as I'm willing to help. Remember not everyone gets lua files right the first time as I still haven't mastered it.

~Jack



I'm still getting a problem:
[Script error 🙂 "CallCardFunction"(c11110000.initial_effect): attempt to call an error function

Same thing I was having before, though I'm not sure why there would be a problem that early in the script.



Oh if only you specified the error before hand.
e2 is not the problem but e3 is.
e3:SetValue(c11110000.val)
Since you put the .val, you need a function c11110000.val()
Afterwards.
Whenever it says "attempt to call an error function" in red letters, this mean something is missing with the "e"s.
You have 2 "e3:SetValue" strings in e3, e3:SetValue(c11110000.val) and e3:SetValue(0) so just remove the .val one and it should work.

~Jack



Works perfectly, thank you!

Jackmoonward
2012-12-12T03:08:52Z
Originally Posted by: ZONE7 

Originally Posted by: Jackmoonward 

Originally Posted by: ZONE7 

Originally Posted by: Jackmoonward 

Originally Posted by: ZONE7 

Not sure if I should create a new topic, but I'm trying to add the original version of Z-ONE's cards (i.e., more powerful effects, but you need Zero Machine Ain to summon them without Tribute). One card in and I'm already stuck; anyone know what's going on?



I need to add the restriction that e2 only works for level 10 monsters, but this is already buggy, anyone know why?



Hi, normally I'd say compare lua files to lua files. First to clarify, have you added this card to the cdb and tested it shows up in the deck constructor? This is important. Yes, shows up in the deck normally.

Now assuming you have done this, so far your doing this right.
I noticed something a bit odd though. In e2 you have the value set to "0x2" which as a decimal is 2 which means Normal Spells. No idea why you did that but it should be "0x20004" which is continuous trap as which Big Evolution Pill uses "0x20002" for continuous spell. Taken from Haze Pillar, when it was 0x1; I took a shot in the dark that this would make it 2 fewer Tributes.
As for the filter you wish to use, this may help;
function c11110000.filter(c)
return c:GetLevel()==10 and c:GetOwner()~=Duel.GetTurnPlayer()
end

Let me know if this doesn't work as I'm willing to help. Remember not everyone gets lua files right the first time as I still haven't mastered it.

~Jack



I'm still getting a problem:
[Script error 🙂 "CallCardFunction"(c11110000.initial_effect): attempt to call an error function

Same thing I was having before, though I'm not sure why there would be a problem that early in the script.



Oh if only you specified the error before hand.
e2 is not the problem but e3 is.
e3:SetValue(c11110000.val)
Since you put the .val, you need a function c11110000.val()
Afterwards.
Whenever it says "attempt to call an error function" in red letters, this mean something is missing with the "e"s.
You have 2 "e3:SetValue" strings in e3, e3:SetValue(c11110000.val) and e3:SetValue(0) so just remove the .val one and it should work.

~Jack



Works perfectly, thank you!


No problem, glad to have known I helped, contact me if you ever need help again.

~Jack

Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward