Scripting an Xyz Monster

Working on somehing? Share your progress and ask/offer help.

Scripting an Xyz Monster

Postby Superancient » 09 May 2012, 11:37

Hello. I am sorry for making a second thread, but I felt the topic was different enough to warrant one.

I am attempting to add in a custom Xyz monster, as shown below:

Image

I feel this shouldn't be too hard a task, since I'm a bit experienced with programming and should know how to make scripts. On top of that, I can make its effects by just copying the effects of Alien Hypno and/or Big Eye for the first part, and then combine Wind-Up Zenmaister's condition for gaining attack per material with Wind-Up Zenmaines's condition of it being in the end phase to execute Alien Dog's effect to place counters.

Before I even get to that part, though, I want to see if I can even summon the card first. So, to keep things simple, I copied Gem-Knight Pearl's summon condition and came up with this:

Code: Select all
Cosmic Guardian - Gial'Fir

function c27552.initial_effect(c)
   
   --xyz summon
   
   aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,4),2)

   c:EnableReviveLimit()

end


This is all saved in a .lua file with the same name as the primary key used to store its information in the cards.cdb file (c27552.lua).

Now, I went in to a duel and tested it, and, while I CAN see it in my Extra Deck during a duel, I cannot seem to summon it. I can only summon Gem-Knight Pearl.

Did I do something wrong? Why isn't it working?

If it helps, here's what I have saved in the "datas" table in cards.cdb:

Image

Sorry for making so many threads, and thank you in advance.
Superancient
 
Posts: 6
Joined: 08 May 2012, 07:55

Re: Scripting an Xyz Monster

Postby Percival18 » 09 May 2012, 16:31

Are you familiar with lua? You should add a double hyphen in front of the card name:

Code: Select all
--Cosmic Guardian - Gial'Fir

That is how you add a comment in lua. Otherwise it would think the first line is part of the code.
Percival18
 
Posts: 43
Joined: 26 Jan 2012, 13:57

Re: Scripting an Xyz Monster

Postby YuGiOhMoDDeR » 09 May 2012, 17:12

first tell us are u sure u kno what u doin? are u really "lil bit" experienced programmer? i dont mean to be rude, no hard feelings..first mistake, like percival said, ur not familiar with LUA..2nd..are u really sure tht values from datas match with ur card..n 3rd lookin at ur script..it doesnt do much..u made a "summon", but u didnt made n put conditions how to summon ur monster (special summon, normal summon)..explore lil bit more how database funcionate, how script works...cheers ;)

EDIT: values from data match to ur mosnter....my bad ^^'
Image
Image
User avatar
YuGiOhMoDDeR
 
Posts: 93
Joined: 11 Jan 2012, 17:12
Location: Travnik, Bosnia&Herzegovina

Re: Scripting an Xyz Monster

Postby Superancient » 10 May 2012, 13:05

Percival18 wrote:Are you familiar with lua? You should add a double hyphen in front of the card name:

Code: Select all
--Cosmic Guardian - Gial'Fir

That is how you add a comment in lua. Otherwise it would think the first line is part of the code.


I'm not that familiar, no, but I do know some other languages, and it looks similar enough. I did not know that you needed to comment the card name; all the other scripts I have have the name in Japanese, and the two dashes looked more like Japanese symbols than hyphens for comments. I tried this, and it fixed it. Thank you again!

YuGiOhMoDDeR wrote:first tell us are u sure u kno what u doin? are u really "lil bit" experienced programmer? i dont mean to be rude, no hard feelings..first mistake, like percival said, ur not familiar with LUA..2nd..are u really sure tht values from datas match with ur card..n 3rd lookin at ur script..it doesnt do much..u made a "summon", but u didnt made n put conditions how to summon ur monster (special summon, normal summon)..explore lil bit more how database funcionate, how script works...cheers ;)

EDIT: values from data match to ur mosnter....my bad ^^'


I'm new to Lua, yes, but this isn't that hard. The values are correct in the table (I checked, and they appear as correct in the card editor). The conditions for summoning are in fact correct, since I literally copied and pasted it from Gem-Knight Pearl's. For reference, here's what I wrote (now with the name commented):

Code: Select all
--Cosmic Guardian - Gial'Fir
function c27552.initial_effect(c)
   --xyz summon
   aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,4),2)
   c:EnableReviveLimit()
end


And here is the full, complete, unedited script for Gem-Knight Pearl:

Code: Select all
--ジェムナイト·パール
function c71594310.initial_effect(c)
   --xyz summon
   aux.AddXyzProcedure(c,aux.FilterEqualFunction(Card.GetLevel,4),2)
   c:EnableReviveLimit()
end


I'm pretty sure the game engine itself knows how to handle a monster based on the value you put in for "type" in the "datas" table, or, if not, then the function .AddXyzProcedure() knows how to handle the summoning of the card by itself. Just having that tiny block of code is more than sufficient and tells the game how to summon it. I'm not sure what EnableReviveLimit() does, but I assume it's necessary since every Xyz monster I've looked at has that included. Maybe it sets the card as a semi-nomi so you can revive it after it's been special summoned properly? Probably.



Just a quick question: is it alright if I post the full code with all the effects here and ask for a bit of help? Since I'm just starting with Lua, I only have a general concept of what I'm doing (the only tutorial I found for it was completely in Chinese or Japanese and didn't translate very well with Google). I feel that once I completely understand how to make one card, then I could easily apply what I've learned to everything else. So, can I post and ask for help, or is that frowned upon here? I don't want to be too much of a burden, especially since this forum has helped me with two relatively simple problems already.
Superancient
 
Posts: 6
Joined: 08 May 2012, 07:55

Re: Scripting an Xyz Monster

Postby Percival18 » 11 May 2012, 17:39

Well I don't think anyone here really knows how the scripts work exactly. You are pretty much on your own.
Check out this post for some explanation: http://tieba.baidu.com/p/1498183366. The part about -debug should come in handy.

For now all you can do is copy code from other cards (which you were already going to do) and test it in the game until it works.
Percival18
 
Posts: 43
Joined: 26 Jan 2012, 13:57

Re: Scripting an Xyz Monster

Postby demeitri1 » 11 Jun 2012, 10:04

i code sheet tht is used by the lua script system would be nice.... on the other hand tht guide is totally useless to people like me percival18 simply caz we need specific instructions in "CLEAR" English to know what to do. :(
demeitri1
 
Posts: 6
Joined: 10 Jun 2012, 14:52

Re: Scripting an Xyz Monster

Postby yangping55 » 27 Aug 2017, 22:17

nike outlet online
ugg boots outlet
nfl jerseys
cheap ray ban sunglasses
red bottoms
cheap ugg boots
oakley sunglasses outlet
adidas outlet store
ugg boots
nike shoes
louis vuitton outlet store
longchamp bags
adidas nmd runner
mlb jerseys
coach outlet store online
canada goose jackets
canada goose outlet
adidas superstar shoes
adidas nmd runner
air jordan shoes
cheap ray ban sunglasses
adidas yeezy boost
polo ralph lauren outlet online
coach factory outlet online
cheap uggs
kate spade outlet online
coach outlet online
moncler
pandora jewelry
canada goose coats
moncler outlet online
birkenstock shoes
mlb jerseys whgolesale
uggs
canada goose
canada goose sale
coach handbags outlet
nike sneakers
longchamp
fitflop sandals
pandora uk
ralph lauren sale
ralph lauren outlet
ugg boots outlet
cheap ugg sale
longchamps
harden shoes
canada goose coats
pandora
coach outlet store online clearance
canada goose jackets
superdry sale
cheap air jordans
adidas yeezy boost 350
christian louboutin sale
kate spade outlet
ralph lauren
cheap jordan shoes
adidas nmd r1
canada goose parka
kate spade outlet
uggs outlet
birkenstock outlet
toms outlet
ray bans
tory burch outlet online
hermes bags
nike outlet store
canada goose coats
canada goose
ray bans
birkenstock outlet store
yeezy shoes
red bottom
valentino
coach outlet online
canada goose jackets
michael kors outlet clearance
mbt
coach factory outlet online
ugg outlet online
birkenstock shoes
burberry uk
coach outlet online
mulberry handbags
pandora charms
moncler jackets
mulberry uk
adidas outlet online
bottes ugg
coach outlet online
kate spade outlet online
coach outlet store
pandora charms sale clearance
yeezy boost 350
fitflops sale clearance
coach outlet online
coach outlet online
coach factory outlet online
michael kors outlet online
beats wireless headphones
ugg boots
coach outlet online
pandora charms
coach outlet canada
burberry handbags
cheap uggs
ralph lauren sale clearance uk
nfl jerseys cheap
cheap jordans for sale
cheap ray ban sunglasses
caterpillar boots
uggs on sale
hermes bags
ugg
michael kors
adidas sneakers
air jordan retro
ralph lauren outlet online
coach factory outlet online
cheap ugg boots
michael kors outlet online
cheap oakley sunglasses
pandora charms sale clearance
pandora charms sale
cheap jordan shoes
pandora charms sale clearance
ralph lauren outlet
mulberry
ralph lauren outlet online
canada goose jackets
coach factory outlet
valentino outlet
coach factory outlet online
ugg shoes
uggs outlet
discount oakley sunglasses
ugg boots
jordans
north face jackets
gucci outlet online
toms
oakley sunglasses outlet
louis vuitton outlet online
mlb jerseys
coach factory outlet
yeezy boost
michael kors outlet canada
ugg boots
michael kors outlet online
birkenstocks
canada goose jackets uk
adidas nmd r1
ray ban sunglasses outlet
michael kors
michael kors outlet online
ugg outlet
retro 11
pandora jewelry outlet
yeezy boost
discount oakley sunglasses
timberland outlet store
michael kors outlet online
supreme clothing
ray bans
canada goose jackets
birkenstock outlet
oakley sunglasses outlet
coach outlet online
ray ban sunglasses discount
michael kors bags
cheap ugg boots
cheap nfl jerseys wholesale
louis vuitton outlet online
coach outlet store
ray ban sunglasses discount
ugg boots outlet
ralph lauren
coach outlet online
ugg slippers
ralph lauren uk
polo ralph lauren outlet
coach outlet online
ugg outlet
yeezy shoes
the north face outlet
nmd adidas
burberry outlet
hermes bag
coach outlet online
toms
pandora charms outlet
michael kors outlet store
adidas ultra boost
adidas outlet online
uggs outlet
ralph lauren
ralph lauren sale
michael kors outlet canada
coach factory outlet online
harden vol 1
louboutin shoes
coach outlet canada
ralph lauren uk
coach outlet online
coach factory outlet online
cheap oakley sunglasses
coach outlet store online
coach factory outlet online
coach outlet online
uggs outlet
michael kors outlet clearance
mulberry outlet uk
adidas yeezy boost
louis vuitton factory outlet
coach purses
pandora outlet
michael kors outlet online
uggs outlet
michael kors handbags outlet
uggs outlet
cheap nike shoes
michael kors outlet store
michael kors
pandora jewelry store
hermes outlet
kate spade handbags
cheap ugg boots
christian louboutin shoes
louboutin outlet
louboutin outlet
michael kors outlet store
pandora charms outlet
michael kors bags
polo ralph lauren
pandora charms sale
burberry outlet
adidas outlet store
michael kors outlet store
ugg sale
ray ban glasses
coach factory outlet online
coach outlet online
moncler pas cher
canada goose jackets
nike outlet store
birkin handbags
canada goose jacket
kate spade handbags
nike air max 2018
polo ralph lauren outlet
cheap jerseys
yeezy boost 350
michael kors
polo ralph lauren outlet online
christian louboutin shoes
coach outlet store
canada goose outlet
pandora charms sale clearance
ugg boots
nike outlet store online
pandora charms sale clearance
yeezy boost 350
uggs outlet
toms outlet
moncler coats
ray ban glasses
ray ban sunglasses cheap
moncler jackets
michael kors outlet store
longchamp handbags
pandora charms outlet
cheap jordan shoes
coach outlet online
supreme london
uggs outlet
ugg outlet online
coach factory outlet
nike huarache shoes
nike outlet
ugg outlet online
birkenstock
ugg on sale
adidas nmd r1
nfl jerseys wholesale
christian louboutin shoes
longchamp bags
coach outlet store online
kate spade handbags
michael kors uk
yeezy shoes
nike sneakers
cheap jordan shoes
beats headphones
christian louboutin sale
canada goose clothing
ralph lauren outlet online
christian louboutin shoes
ray ban sunglasses sale
ugg boots women
pandora charms outlet
moncler outlet online
polo ralph lauren outlet online
red bottom heels
air max
coach factory outlet online
canada goose jackets
adidas store
toms
coach outlet online
ray ban sunglasses outlet
uggs outlet
pandora jewelry
christian louboutin shoes
nike cortez classic
ralph lauren outlet
kate spade outlet online
pandora charms
ugg outlet
ugg boots
coach factory outlet online
coach factory outlet
michael kors outlet clearance
adidas nmd runner
longchamp sale
superdry outlet
mlb jerseys
adidas yeezy shoes
birkenstock uk
coach outlet online
uggs outlet
ralph lauren sale
pandora jewelry outlet
ugg canada
ralph lauren sale clearance uk
tory burch shoes
moncler outlet online
burberry outlet online
2017.8.28yangping
yangping55
 
Posts: 159
Joined: 27 Aug 2017, 21:50

20170914caihuali

Postby yangping55 » 14 Sep 2017, 04:02

kobe shoes
coach outlet
kevin durant shoes
ray ban sunglasses
michael kors handbags
canada goose
air max 1
coach outlet online
longchamp outlet
longchamp handbags
ugg boots
true religion jeans
michael kors outlet
fitflops shoes
michael kors outlet online
ugg boots
ugg outlet
lakers jerseys
ugg cyber monday
burberry outlet
fitflops outlet
polo outlet
mulberry handbags
nike shoes
oakley sunglasses
oakley sunglasses
canada goose outlet
canada goose outlet
chicago blackhawks jerseys
reebok trainers
christian louboutin outlet
mulberry outlet
yeezy boost 350
michael kors bags
montblanc pens
nike store uk
michael kors outlet
nike air max
pandora charms
canada goose outlet
adidas wings
pandora jewelry
asics shoes
coach outlet online
canada goose outlet
true religion outlet
longchamp handbags
chrome hearts
ysl outlet
nfl jersey wholesale
ferragamo outlet
coach factory outlet
coach outlet
canada goose outlet
ray ban sunglasses
polo ralph lauren
oakley sunglasses
mulberry handbags
michael kors outlet
canada goose jackets
oakley sunglasses
michael kors factory outlet
ray ban sunglasses
ugg boots
cheap mlb jerseys
canada goose jackets
michael kors outlet
tory burch shoes
tory burch outlet
canada goose jackets
coach outlet online
air max 90
christian louboutin outlet
michael kors handbags
fitflops shoes
canada goose jackets
mont blanc pens
mac cosmetics
coach outlet
michael kors outlet
ugg outlet
christian louboutin shoes
canada goose outlet
oakley sunglasses
nike store
cheap jordans
birkenstock sandals
ugg boots
canada goose jackets
ugg outlet
kate spade outlet
coach handbags
polo ralph lauren
jordan shoes
ugg outlet
michael kors black friday
lebron james shoes
canada goose uk
coach outlet
canada goose outlet
coach outlet online
kate spade outlet
coach outlet
true religion jeans
herve leger outlet
cheap jordans
ugg boots
ray ban sunglasses
coach factory outlet
canada goose jackets
michael kors outlet online
mulberry sale
ugg boots
longchamp solde
kate spade handbags
hermes belt
nike outlet store
true religion jeans
adidas nmd
soccer jerseys
kobe 9
cheap snapbacks
air max trainers
cheap snapbacks
christian louboutin online
mulberry bags
michael kors outlet
coach handbags
air max 90
fitflops
canada goose outlet
michael kors outlet online
canada goose jackets
ralph lauren polo
canada goose jackets
michael kors outlet
hermes outlet
ugg outlet
christian louboutin uk
coach outlet
coach factory outlet
coach outlet
fitflops sale clearance
coach factory outlet
longchamp solde
oakley sunglasses
nfl jersey wholesale
polo ralph lauren
canada goose coats
canada goose black friday
ugg boots
coach factory outlet
supra shoes
christian louboutin shoes
ugg boots
polo ralph lauren
cheap ugg boots
oakley sunglasses
coach outlet online
mulberry bags
kate spade outlet
ray ban sunglasses
pandora charms
nba jerseys
tods outlet
nike trainers
valentino outlet
ed hardy clothing
pandora charms sale clearance
marc jacobs outlet
jordan shoes
coach outlet online
michael kors outlet
vans shoes
michael kors
ugg boots
adidas outlet store
ugg boots
coach outlet
ferragamo shoes
fitflops
nhl jerseys
louboutin shoes
ray ban sunglasses
lebron james shoes
ugg boots
polo ralph lauren
birkenstock outlet
tory burch outlet
coach outlet online
true religion outlet
pandora jewelry
ray bans
michael kors outlet
prada shoes
ugg outlet
ugg boots
canada goose coats
ralph lauren outlet
mulberry handbags
polo outlet
swarovski crystal
canada goose coats
ralph lauren polo
coach outlet
true religion jeans
ugg outlet
kate spade outlet
christian louboutin outlet
michael kors outlet
cheap jordans
michael kors outlet
ray ban sunglasses
coach outlet online
coach outlet
air max 90
ecco shoes
canada goose outlet
canada goose coats
michael kors
michael kors handbags
michael kors outlet
ferragamo shoes
air jordan 4
cheap ray bans
ralph lauren polo
canada goose outlet
ray ban sunglasses
true religion jeans
ray ban sunglasses
mlb jerseys wholesale
nike huarache
ferragamo shoes
longchamp pliage
true religion jeans
fitflops sale
coach outlet
longchamp outlet
coach outlet
tory burch outlet
cheap nhl jerseys
oakley sunglasses
michael kors outlet
cheap jordans
coach outlet
canada goose jackets
air max uk
coach factory outlet
nike shoes
ferragamo outlet
salomon shoes
prada outlet
canada goose uk
canada goose outlet
chrome hearts outlet
oakley sunglasses
soccer shoes
adidas uk
ugg outlet
tory burch outlet
canada goose uk
ugg outlet
giuseppe zanotti outlet
nike factory outlet
michael kors outlet
uggs outlet
ugg outlet
canada goose outlet
polo outlet
canada goose outlet
michael kors outlet clearance
adidas nmd
oakley sunglasses
true religion jeans
coach outlet
michael kors outlet online
polo ralph lauren
canada goose outlet
ralph lauren polo shirts
michael kors outlet clearance
coach outlet
bottega veneta outlet
mbt shoes
michael kors handbags
canada goose jackets
basketball shoes
new balance shoes
ugg outlet
oakley sunglasses
cheap jerseys
michael kors outlet
mcm outlet
christian louboutin shoes
coach outlet online
canada goose outlet
adidas trainers
coach outlet store online
true religion jeans
nfl jerseys wholesale
longchamp outlet
true religion outlet
nike outlet
ray ban sunglasses
polo ralph lauren
ralph lauren polo
cleveland cavaliers jersey
coach outlet
burberry outlet
michael kors cyber monday
ray ban sunglasses
michael kors wallets
ugg outlet
longchamp bags
canada goose jackets
cartier outlet
coach factory outlet
uggs outlet
canada goose outlet
michael kors outlet
burberry outlet
christian louboutin outlet
canada goose jackets
nike roshe run
ferragamo shoes
air max 90
michael kors outlet
burberry outlet
canada goose uk
longchamp bags
canada goose outlet
polo ralph lauren
coach outlet
ray bans
futbol baratas
ray ban sunglasses
ray ban sunglasses
coach outlet canada
tory burch outlet
canada goose jackets
michael kors outlet online
ugg black friday
swarovski outlet
ugg outlet
coach outlet online
mulberry handbags
ugg boots
michael kors
swarovski crystal
swarovski crystal
true religion outlet
nike air force 1
michael kors outlet
converse shoes
pandora jewelry
canada goose outlet
nike air max 2015
polo outlet
canada goose coats
canada goose uk
coach handbags
cheap uggs
true religion jeans
michael kors handbags
ugg boots
canada goose outlet
coach factory outlet
coach outlet online
michael kors
yeezy boost
ray ban sunglasses
canada goose outlet
ray-ban sunglasses
coach outlet online
cheap uggs
uggs outlet
michael kors outlet online
christian louboutin outlet
michael kors outlet online
nike roshe
[url=http://www.pumaoutlet-online.com ]puma outlet[/url]
oakley sunglasses wholesale
ugg boots
ralph lauren uk
lacoste polo shirts
swarovski crystal
michael kors outlet
air max uk
canada goose outlet
ugg outlet
coach outlet online
soccer jerseys
ray ban sunglasses
polo shirts
swarovski outlet
fitflops sale clearance
fitflops sale clearance
canada goose outlet
oakley sunglasses
football shirts
ugg outlet
nike roshe one
michael kors handbags
ferragamo outlet
canada goose jackets
coach outlet online
michael kors outlet
coach outlet
tory burch outlet
nike free 5
cazal sunglasses
oakley sunglasses
ralph lauren outlet
links of london
michael kors
nike shoes
longchamp pas cher
kobe bryant shoes
canada goose outlet
canada goose coats
canada goose coats
ugg outlet
canada goose outlet
coach factory outlet
michael kors outlet
canada goose outlet
lacoste soldes
nike trainers
coach factory outlet
kate spade outlet
oakley sunglasses
tory burch outlet
canada goose outlet
nike foamposite
michael kors outlet clearance
michael kors outlet
mulberry outlet store
coach outlet online
canada goose cyber monday
hermes outlet
christian louboutin outlet
nike huarache
canada goose jackets
ralph lauren polo
ralph lauren sale
ugg outlet
hermes birkin
michael kors factory outlet
kate spade handbags
ugg outlet
kate spade outlet
oakley sunglasses
michael kors handbags
coach outlet
canada goose outlet
true religion jeans
prada handbags
michael kors outlet
true religion jeans
nike blazer pas cher
ugg outlet
nba jerseys
michael kors outlet
fred perry polo shirts
ugg outlet
ugg boots
moncler jackets
thomas sabo
oakley sunglasses
polo outlet
coach outlet
longchamp handbags
jordan shoes
michael kors outlet online
oakley sunglasses
ugg outlet
ugg outlet
michael kors outlet
oakley sunglasses wholesale
oakley sunglasses
true religion uk
reebok outlet store
prada sunglasses
ralph lauren uk
oakley sunglasses
ralph lauren pas cher
20170914caihuali
yangping55
 
Posts: 159
Joined: 27 Aug 2017, 21:50


Return to Projects

Who is online

Users browsing this forum: No registered users and 1 guest

cron