YGOPRO Forum

Welcome Guest! To enable all features please try to register or login.
2 Pages12>
Options
Go to last post Go to first unread
Jackmoonward  
#1 Posted : Saturday, December 15, 2012 4:05:04 AM(UTC)
Jackmoonward

Rank: Advanced Member

Joined: 12/7/2012(UTC)
Posts: 648

Thanks: 13 times
Was thanked: 281 time(s) in 161 post(s)
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

Edited by moderator Sunday, January 20, 2013 1:07:54 PM(UTC)  | Reason: Extra information

Go here to vote for the next cards in Jackpro 1.5:
http://www.tehmadhouse.tk
Youtube:
http://www.youtube.com/user/jackmoonward
thanks 13 users thanked Jackmoonward for this useful post.
Tea82  
#2 Posted : Saturday, December 15, 2012 8:48:21 AM(UTC)
Tea82

Rank: Advanced Member

Joined: 12/4/2012(UTC)
Posts: 1,437

Thanks: 3355 times
Was thanked: 325 time(s) in 246 post(s)
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!!
thanks 1 user thanked Tea82 for this useful post.
FLASH  
#3 Posted : Sunday, December 16, 2012 11:05:53 PM(UTC)
FLASH

Rank: Advanced Member

Joined: 12/5/2012(UTC)
Posts: 701

Thanks: 217 times
Was thanked: 1088 time(s) in 315 post(s)
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 :D
thanks 1 user thanked FLASH for this useful post.
Super Squirrel  
#4 Posted : Friday, April 26, 2013 10:24:10 AM(UTC)
Super Squirrel

Rank: Newbie

Joined: 4/26/2013(UTC)
Posts: 14

Was thanked: 1 time(s) in 1 post(s)
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

thanks 1 user thanked Super Squirrel for this useful post.
ytterbite  
#5 Posted : Monday, May 06, 2013 2:16:42 AM(UTC)
ytterbite

Rank: Advanced Member

Joined: 12/18/2012(UTC)
Posts: 269

Thanks: 170 times
Was thanked: 252 time(s) in 69 post(s)
Originally Posted by: Super Squirrel Go to Quoted Post
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.

Edited by user Monday, May 06, 2013 2:32:15 AM(UTC)  | Reason: Not specified

salvadorc17  
#6 Posted : Thursday, May 09, 2013 10:00:11 PM(UTC)
salvadorc17

Rank: Advanced Member

Joined: 2/27/2013(UTC)
Posts: 537

Thanks: 6 times
Was thanked: 164 time(s) in 98 post(s)
Can you explain me how to add a message when yo do some action between duel, not at start.
RaiZZZ19  
#7 Posted : Wednesday, August 14, 2013 9:40:16 PM(UTC)
RaiZZZ19

Rank: Advanced Member

Joined: 5/30/2013(UTC)
Posts: 758

Thanks: 78 times
Was thanked: 27 time(s) in 26 post(s)
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?

Edited by user Wednesday, August 14, 2013 9:43:03 PM(UTC)  | Reason: Not specified

Jackmoonward  
#8 Posted : Wednesday, August 14, 2013 11:02:02 PM(UTC)
Jackmoonward

Rank: Advanced Member

Joined: 12/7/2012(UTC)
Posts: 648

Thanks: 13 times
Was thanked: 281 time(s) in 161 post(s)
Originally Posted by: RaiZZZ19 Go to Quoted Post
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
thanks 2 users thanked Jackmoonward for this useful post.
RaiZZZ19  
#9 Posted : Thursday, August 15, 2013 12:12:45 AM(UTC)
RaiZZZ19

Rank: Advanced Member

Joined: 5/30/2013(UTC)
Posts: 758

Thanks: 78 times
Was thanked: 27 time(s) in 26 post(s)
Originally Posted by: Jackmoonward Go to Quoted Post
Originally Posted by: RaiZZZ19 Go to Quoted Post
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  
#10 Posted : Thursday, August 15, 2013 12:19:55 AM(UTC)
Jackmoonward

Rank: Advanced Member

Joined: 12/7/2012(UTC)
Posts: 648

Thanks: 13 times
Was thanked: 281 time(s) in 161 post(s)
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  
#11 Posted : Thursday, August 15, 2013 12:39:06 AM(UTC)
RaiZZZ19

Rank: Advanced Member

Joined: 5/30/2013(UTC)
Posts: 758

Thanks: 78 times
Was thanked: 27 time(s) in 26 post(s)
Originally Posted by: Jackmoonward Go to Quoted Post
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  
#12 Posted : Thursday, August 29, 2013 2:31:27 AM(UTC)
serebiisean

Rank: Newbie

Joined: 8/27/2013(UTC)
Posts: 5

Was thanked: 8 time(s) in 4 post(s)
Originally Posted by: RaiZZZ19 Go to Quoted Post
Originally Posted by: Jackmoonward Go to Quoted Post
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)
thanks 1 user thanked serebiisean for this useful post.
ProjectLeviamon  
#13 Posted : Monday, September 02, 2013 7:18:33 PM(UTC)
ProjectLeviamon

Rank: Advanced Member

Joined: 7/25/2013(UTC)
Posts: 58

Thanks: 8 times
Was thanked: 2 time(s) in 2 post(s)
can you make Xyz materials already be attached to a face up monster?
Jackmoonward  
#14 Posted : Monday, September 02, 2013 8:04:14 PM(UTC)
Jackmoonward

Rank: Advanced Member

Joined: 12/7/2012(UTC)
Posts: 648

Thanks: 13 times
Was thanked: 281 time(s) in 161 post(s)
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
thanks 1 user thanked Jackmoonward for this useful post.
ProjectLeviamon  
#15 Posted : Wednesday, September 04, 2013 4:57:18 PM(UTC)
ProjectLeviamon

Rank: Advanced Member

Joined: 7/25/2013(UTC)
Posts: 58

Thanks: 8 times
Was thanked: 2 time(s) in 2 post(s)
thanks Jack
Juan-K  
#16 Posted : Saturday, September 28, 2013 3:27:46 PM(UTC)
Juan-K

Rank: Advanced Member

Joined: 5/26/2013(UTC)
Posts: 109

Thanks: 80 times
Was thanked: 4 time(s) in 4 post(s)
Thanks :) in the Devpro page is a puzzle maker but is in deutsch
seabottom  
#17 Posted : Tuesday, November 19, 2013 9:54:59 AM(UTC)
seabottom

Rank: Advanced Member

Joined: 3/24/2013(UTC)
Posts: 294

Thanks: 10 times
Was thanked: 12 time(s) in 11 post(s)
How do you alter the ATK and DEF?
UserPostedImage
FTON  
#18 Posted : Sunday, January 26, 2014 2:23:23 PM(UTC)
FTON

Rank: Advanced Member

Joined: 1/11/2014(UTC)
Posts: 2,232

Thanks: 607 times
Was thanked: 341 time(s) in 291 post(s)
Nice, i have made a simple attacking strategy :)
wrrho  
#19 Posted : Friday, May 23, 2014 11:34:39 AM(UTC)
wrrho

Rank: Newbie

Joined: 5/14/2014(UTC)
Posts: 1

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  
#20 Posted : Friday, May 23, 2014 5:54:25 PM(UTC)
Naz Zuki

Rank: Advanced Member

Joined: 12/23/2013(UTC)
Posts: 294

Thanks: 34 times
Was thanked: 36 time(s) in 32 post(s)
I hope u can make video for this tutorial!:thup
Look the fluffy!
Users browsing this topic
2 Pages12>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error