Jackmoonward
2012-12-15T04:05:04Z
Now before we begin you are going to need to optionally download 1 program:
Lua Edit 2010 
If you don't want to download it, make sure you have a text editing program like Notepad that will allow you to make Lua script files.

Now on to the tutorial. Open your blank text program, preferably Lua Edit as your first choice.
Now on the first line, paste this onto it;
--NAME
Debug.SetAIName("OPPONENT")
Debug.ReloadFieldBegin(DUEL_ATTACK_FIRST_TURN+DUEL_SIMPLE_AI)
Debug.SetPlayerInfo(0,YOURLP,0,0)
Debug.SetPlayerInfo(1,OPPONENTLP,0,0)
Debug.ReloadFieldEnd()
Debug.ShowHint("Win in this turn!")
aux.BeginPuzzle()

Now let me explain what each of these lines means.

--NAME is what the name of the Duel Puzzle will be, don't confuse this with the name of the file.
You can change this from --NAME to --TROLOL or --DuelPuzzleTest

Debug.SetAIName("OPPONENT") will be the name of your opponent, just change the OPPONENT to whatever you want. Make sure the name has quotes before and after it, it has to look like this: "Bob" not Bob.
It can be "Jack" or "Chuck Norris" or even "Bilbo Baggins".

Debug.ReloadFieldBegin(DUEL_ATTACK_FIRST_TURN+DUEL_SIMPLE_AI) is the properties of the Duel Puzzle. No need to change anything here.

Debug.SetPlayerInfo(0,YOURLP,0,0) is the amount of life points you will start off with. Replace the YOURLP with any number of like points you want to start with in the Duel Puzzle.

Debug.SetPlayerInfo(1,OPPONENTLP,0,0) is the amount of life points your opponent will start off. Replace the OPPONENTLP with any number of life points you want the opponent to start with in the Duel Puzzle.

Debug.ReloadFieldEnd()
Do not change this at all.

Debug.ShowHint("Win in this turn!") This is the message that shows up in a a dialog box when the Duel Puzzle starts, you can change the WIN IN THIS TURN to whatever you want. It has to be a in quotes like this: "WIN" not WIN.

aux.BeginPuzzle()
Do not change this at all.

Now we are done with the easy part.

Now think of all cards you want used in this Duel Puzzle.
Type one of these per card you want to add:
Debug.AddCard(A,0,0,LOCATION_B,0,C)
Replace the A with the card's ID number, the 8 digit number in the bottom left of Yu-gi-oh cards, if you don't know the ID number, look for the card in the Ygopro deck constructor and it's ID number will appear in the section above where the effect would normally be on the left, like this:


Replace the B with the location of the card. You can change this to GRAVE or DECK or HAND or EXTRA or REMOVED or MZONE or SZONE. GRAVE is the Graveyard, DECK is the deck, HAND is the hand, EXTRA is the extra deck, MZONE is for Monster Cards on the field, SZONE is for Spell and Traps on the field.

Replace the C with the position. You can replace it with FACEUP_ATTACK, FACEUP_DEFENCE, FACEDOWN_DEFENCE, POS_FACEDOWN, POS_FACEUP.

If a Monster is in the MZONE, it can be POS_FACEUP_ATTACK or POS_FACE_UP DEFENCE or POS_FACEDOWN_DEFENCE.
If a card is in the GRAVE, it can be POS_FACEUP or POS_FACEDOWN
If a card is in the EXTRA, it can be POS_FACEDOWN
If a card is in the DECK, it can be POS_FACEDOWN
If a card is in the HAND, it can be POS_FACEDOWN
If a Monster is in the REMOVED, it can be POS_FACEUP_ATTACK

Be careful when putting a card in the deck. The order you put the cards in the Deck location will be reverse in the puzzle.
For example, the first you card you put in the deck will be the bottom card of the deck.

If I am going to use 1 card, it is going to look like this:
--NAME
Debug.SetAIName("OPPONENT")
Debug.ReloadFieldBegin(DUEL_ATTACK_FIRST_TURN+DUEL_SIMPLE_AI)
Debug.SetPlayerInfo(0,YOURLP,0,0)
Debug.SetPlayerInfo(1,OPPONENTLP,0,0)
Debug.AddCard(11112222,0,0,LOCATION_MZONE,0,POS_FACEUP_ATTACK)
Debug.ReloadFieldEnd()
Debug.ShowHint("Win in this turn!")
aux.BeginPuzzle()
And for 2 cards:
--NAME
Debug.SetAIName("OPPONENT")
Debug.ReloadFieldBegin(DUEL_ATTACK_FIRST_TURN+DUEL_SIMPLE_AI)
Debug.SetPlayerInfo(0,YOURLP,0,0)
Debug.SetPlayerInfo(1,OPPONENTLP,0,0)
Debug.AddCard(11112222,0,0,LOCATION_MZONE,0,POS_FACEUP_ATTACK)
Debug.AddCard(22221111,0,0,LOCATION_SZONE,0,POS_FACEDOWN)
Debug.ReloadFieldEnd()
Debug.ShowHint("Win in this turn!")
aux.BeginPuzzle()

If you want to make one of these cards to be on your opponent's side, change the ,0,0, to ,1,1 After you put the ID number of the card and before the Location.

So I would change Debug.AddCard(11112222,0,0,LOCATION_MZONE,0,POS_FACEUP_ATTACK) to Debug.AddCard(11112222,1,1,LOCATION_MZONE,0,POS_FACEUP_ATTACK)

Now to change the Field Zone it shows up in, we change the ,0, after the Location and before the Position to the number of the zone. So if I change the 0 to 1 the card will show up like this:


And if I change the 0 to 2 or 1 to 2 it will look like this:


The Zones are numbered like this:
UserPostedImage
5 Is the Field Spell Zone.
0-4 is the Numbes for the MZONE and SZONE. For cards in locations other than MZONE and SZONE, you can leave the Field Zone number as 0.
Everything in the black square would be 0,0 or my side of the field.
Everything in the blue circle is 1,1 or the opponent's side of the field.


Now you have just made your first Duel Puzzle! Once your done with the Duel Puzzle, name it whatever you wish but make sure it's a Lua file and not any other kind of file. Make sure to save it in the single folder in your Ygopro folder.

Hope I explained this simple enough for people wanting to make their own Puzzles. Credit to Tea82  for information.

~Jack

Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
Tea82
2012-12-15T08:48:21Z
Thanks Jack!! With your tutorial too i bet that now there are not people who can't make puzzle duels!! If you discover more about puzzle duels or custom cards script lua please not forget to update your tutorials!!
FLASH
2012-12-16T23:05:53Z
Nice work jack ^^

your tutorial and tea's tutorial make it very easy for anyone to make Duel Puzzles

thank you
UserPostedImage
see you all soon , time for my military service 😃
2013-04-26T10:24:10Z
Sorry for bad english....

I have done a duel puzzle, savage colosseum is faceup on the field and i have an attack position morphtronic monster that has not attacked this turn. i equip it with morphtronic rusty engine. during end phase colosseum's eff activates and so morphtronic monster is destroyed ....now eff of rusty engine should activate but duel puzzle ends and i lose....why? o.O

ytterbite
2013-05-06T02:16:42Z
Originally Posted by: Super Squirrel 

Sorry for bad english....

I have done a duel puzzle, savage colosseum is faceup on the field and i have an attack position morphtronic monster that has not attacked this turn. i equip it with morphtronic rusty engine. during end phase colosseum's eff activates and so morphtronic monster is destroyed ....now eff of rusty engine should activate but duel puzzle ends and i lose....why? o.O



It seems to be a bug with Morphtronic Rusty Engine. I tried recreating your puzzle, adding Dark Hole to destroy the Morphtronic monster and Engine still didn't activate.
salvadorc17
2013-05-09T22:00:11Z
Can you explain me how to add a message when yo do some action between duel, not at start.
RaiZZZ19
2013-08-14T21:40:16Z
Is there a way to prolong it instead of 1 turn only? And how do you equip an equip spell/trap/monster to a monster?
Jackmoonward
2013-08-14T23:02:02Z
Originally Posted by: RaiZZZ19 

Is there a way to prolong it instead of 1 turn only? And how do you equip an equip spell/trap/monster to a monster?



Go in to the script folder, look for a file called utility.lua and open it with Lua edit.

Now look for something that looks like this:

function Auxiliary.BeginPuzzle(effect)
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(Auxiliary.PuzzleOp)
Duel.RegisterEffect(e1,0)
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_SKIP_DP)
e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,0)
local e3=Effect.GlobalEffect()
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_SKIP_SP)
e3:SetTargetRange(1,0)
Duel.RegisterEffect(e3,0)
end
function Auxiliary.PuzzleOp(e,tp)
Duel.SetLP(0,0)
end



Erase that entire part and click save, the puzzles should now continue like a normal duel.

~Jack
Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
RaiZZZ19
2013-08-15T00:12:45Z
Originally Posted by: Jackmoonward 

Originally Posted by: RaiZZZ19 

Is there a way to prolong it instead of 1 turn only? And how do you equip an equip spell/trap/monster to a monster?



Go in to the script folder, look for a file called utility.lua and open it with Lua edit.

Now look for something that looks like this:

function Auxiliary.BeginPuzzle(effect)
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(Auxiliary.PuzzleOp)
Duel.RegisterEffect(e1,0)
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_SKIP_DP)
e2:SetTargetRange(1,0)
Duel.RegisterEffect(e2,0)
local e3=Effect.GlobalEffect()
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_SKIP_SP)
e3:SetTargetRange(1,0)
Duel.RegisterEffect(e3,0)
end
function Auxiliary.PuzzleOp(e,tp)
Duel.SetLP(0,0)
end



Erase that entire part and click save, the puzzles should now continue like a normal duel.

~Jack



So how would I equip a m/s/t to a monster. There's a different code for this right?

Jackmoonward
2013-08-15T00:19:55Z
You mean prematurely before the puzzle starts? That is not possible.

~Jack
Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
RaiZZZ19
2013-08-15T00:39:06Z
Originally Posted by: Jackmoonward 

You mean prematurely before the puzzle starts? That is not possible.

~Jack



no. the other way around. because only coding it to be faceup is not really equipping.
serebiisean
2013-08-29T02:31:27Z
Originally Posted by: RaiZZZ19 

Originally Posted by: Jackmoonward 

You mean prematurely before the puzzle starts? That is not possible.

~Jack



no. the other way around. because only coding it to be faceup is not really equipping.



In front of the equip spell card, type e1=
In front of the equipped monster, type c1=
At the bottom of the card section, but before the Debug.ReloadFieldEnd(), type Debug.PreEquip(e1,c1)

Example:
c1=Debug.AddCard(99212922,1,1,LOCATION_MZONE,3,POS_FACEUP_ATTACK)
e1=Debug.AddCard(83584898,0,0,LOCATION_SZONE,3,POS_FACEUP)
Debug.PreEquip(e1,c1)
ProjectLeviamon
2013-09-02T19:18:33Z
can you make Xyz materials already be attached to a face up monster?
Jackmoonward
2013-09-02T20:04:14Z
Yes. Just have them be on the same MZONE location and the first one in corresponding order will be on top. Like this:

Debug.AddCard(86170989,0,0,LOCATION_MZONE,2,POS_FACEUP_ATTACK)
Debug.AddCard(73776643,0,0,LOCATION_MZONE,2,POS_FACEUP_ATTACK)

So this would make Falchion B the top monster with Papa Corn as the xyz material. And it doesn't need to be an Xyz monster to have xyz material.

~Jack
Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk 
Youtube:
http://www.youtube.com/user/jackmoonward
ProjectLeviamon
2013-09-04T16:57:18Z
Juan-K
2013-09-28T15:27:46Z
Thanks 🙂 in the Devpro page is a puzzle maker but is in deutsch
seabottom
2013-11-19T09:54:59Z
How do you alter the ATK and DEF?
UserPostedImage
FTON
  • FTON
  • Advanced Member
2014-01-26T14:23:23Z
Nice, i have made a simple attacking strategy :)

wrrho
2014-05-23T11:34:39Z
I am working on puzzle using the effect of Number 101: Silent Honor ARK

I added Red Nova Dragon(Synchro Monster, so must be special summoned) to opponent's field with Lua script, but S.H.Ark cannot target Red Nova
so I looked at at S.H.Ark's script file and found out this code

...bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL

I guess bit.band is some bitwise operation to make all kinds of special summons into SUMMON_TYPE_SPECIAL and all monsters have attribute called SummonType
apparently, my Red Nova's SummonType is something other than SUMMON_TYPE_SPECIAL


Here is my question,

How can I make that Red Nova Dragon SPECIAL SUMMONED in puzzle duel script file?
Naz Zuki
2014-05-23T17:54:25Z
I hope u can make video for this tutorial![:thumbu:]
Look the fluffy!