Advertisement

Yu-Gi-Oh! Card Game

Started by April 13, 2015 06:52 AM
3 comments, last by Orymus3 9 years, 9 months ago

Hello! happy.png

I am planning to program a Yu-Gi-Oh! card game for Windows Operating System. See this link for more info about Yu-Gi-Oh!: http://en.wikipedia.org/wiki/Yu-Gi-Oh!_Trading_Card_Game

I'd like to start with the game YGOPRO. See this link about the game: http://ygopro.co. I have the game installed on my PC and enjoys playing it! laugh.png I'm really trying to learn how the game was programmed by checking each files from the game source, viewing them on a text editor, so on...

Starting with card scripting.

Images of the game:

85ukzPl.png

1228Jde.png

DvkZWKc.png

4J2vGOs.png

L0AJxiS.png

The card's database, where the names and information of the cards are saved, and their scripts, the actions performed based on the card's description when it's triggered. I don't have an idea how they were executed and performed when the cards are used within the game.

I picked up a card to be an example named The Gates of Dark World.

Here's the file and image for the card's database (cards.cdb): https://www.dropbox.com/s/2uow819ay7zl11g/cards.cdb?dl=0

8yuRUov.png

tqMOXGz.png

Within the game:

l1o9II6.png

File for the card's scripts (c33017655.lua): https://www.dropbox.com/s/4nru2mtufe9c75f/c33017655.lua?dl=0


--?????
function c33017655.initial_effect(c)
	--Activate
	local e1=Effect.CreateEffect(c)
	e1:SetType(EFFECT_TYPE_ACTIVATE)
	e1:SetCode(EVENT_FREE_CHAIN)
	c:RegisterEffect(e1)
	--atkup
	local e2=Effect.CreateEffect(c)
	e2:SetType(EFFECT_TYPE_FIELD)
	e2:SetCode(EFFECT_UPDATE_ATTACK)
	e2:SetRange(LOCATION_SZONE)
	e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
	e2:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_FIEND))
	e2:SetValue(300)
	c:RegisterEffect(e2)
	--defup
	local e3=Effect.CreateEffect(c)
	e3:SetType(EFFECT_TYPE_FIELD)
	e3:SetCode(EFFECT_UPDATE_DEFENCE)
	e3:SetRange(LOCATION_SZONE)
	e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
	e3:SetTarget(aux.TargetBoolFunction(Card.IsRace,RACE_FIEND))
	e3:SetValue(300)
	c:RegisterEffect(e3)
	--discard & draw
	local e4=Effect.CreateEffect(c)
	e4:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
	e4:SetDescription(aux.Stringid(33017655,1))
	e4:SetType(EFFECT_TYPE_IGNITION)
	e4:SetRange(LOCATION_SZONE)
	e4:SetCountLimit(1)
	e4:SetCost(c33017655.cost)
	e4:SetTarget(c33017655.target)
	e4:SetOperation(c33017655.operation)
	c:RegisterEffect(e4)
end
function c33017655.costfilter(c)
	return c:IsRace(RACE_FIEND) and c:IsAbleToRemoveAsCost()
end
function c33017655.cost(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.IsExistingMatchingCard(c33017655.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
	local g=Duel.SelectMatchingCard(tp,c33017655.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
	Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c33017655.target(e,tp,eg,ep,ev,re,r,rp,chk)
	if chk==0 then return Duel.IsExistingMatchingCard(Card.IsRace,tp,LOCATION_HAND,0,1,nil,RACE_FIEND)
		and Duel.IsPlayerCanDraw(tp,1) end
	Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
	Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c33017655.operation(e,tp,eg,ep,ev,re,r,rp,chk)
	if not e:GetHandler():IsRelateToEffect(e) then return end
	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
	local g=Duel.SelectMatchingCard(tp,Card.IsRace,tp,LOCATION_HAND,0,1,1,nil,RACE_FIEND)
	if g:GetCount()>0 then
		Duel.SendtoGrave(g,REASON_EFFECT+REASON_DISCARD)
		Duel.BreakEffect()
		Duel.Draw(tp,1,REASON_EFFECT)
	end
end

Here are the other files from the game source:

(lflist.conf) - https://www.dropbox.com/s/ivdbyy11ql5vg17/lflist.conf?dl=0

(strings.conf) - https://www.dropbox.com/s/bcl7ymeyf8hy33k/strings.conf?dl=0

(system.conf) - https://www.dropbox.com/s/er3ay621jvn0qrn/system.conf?dl=0

I want to know how the two files work; the cads.cdb & c33017655.lua

And what programming language is a .lua file?!

Anyone who knows?

I need more explanations!

Thanks ~ ! biggrin.png

And what programming language is a .lua file?!

Lua.

I want to know how the two files work

Then study them and figure it out.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Advertisement

You might already know this, but just to make sure:

What you plan to do is infringing other peoples IP. That is against the law in most countries, and depending on how you distribute the finished product, and if the original IP's owner finds out, you can be sued for it.

There is only one defense against it: don't make a Yu-gi-oh game. Your game can be inspired by yu-gi-oh, your cards can resemble some cards from yu-gi-oh, you could even try to "steal" part of the yu-gi-oh rules.

Just DON'T call it Yu-Gi-Oh, and make sure your game is different enough that the Yu-Gi-Oh IP owner cannot create a case out of it that will hold before a judge.

Ideally, you start with your inspiration, but then pour in as much of your own ideas as possible. That makes sure the end product, while maybe still resembling parts of the inspiration, will be suitably different to not infringe any IP.

Also be aware, apart of names or symbols being protected by copyright, some companies went as far as patenting parts of their rulesets. Wizards of the coast did that for some Magic the gathring rules AFAIK. Might be less of a problem than just blatantly stealing names and images, as patent protection is AFAIK harder to enforce than IP, still, something to keep in mind.

Now, from your OP I cannot know if you intended this game you want to "reverse engineer" from an existing Yu-Gi-Oh game (I hope the game you are looking into is open source) to be meant solely as a training exercise that will never leave your PC, or if you wanted to distribute it, be it as freeware or commercial.

In the first case you will be pretty safe from being sued over IP infringement (While you still break laws, be aware of that. Not boasting about it online would be a wise decision, as would be not putting it into any portfolio of yours... would make you look highly unprofessional to your potential future employer).

In the second case you are really risking getting sued. You might get away with it because your game will stay under the radar because of low interest... the IP holder might not act on it even if he becomes aware as he deems it to be not damaging enough... you might get away with a simple "cease and desist order" (or however such a takedown notice is called in your part of the world), basically the IP owner telling you to stop infringing on their IP and taking down all downloadable sources of your game.

But in the worst case, you might get entangled into a huge jurisdical mess, that could have been avoided if you simply exchanged names, images and maybe some rules of your game before making it public.

Just keep that in mind if you continue with your game and, one day, want it to leave your harddisk.

I know off topic, but I'm completely surprised that YGOPRO game is even up still to begin with. Apparently they been up for years now, went on the forums for no longer than 3 minutes and found out they got an Android app, IPhone App, and discussions on torrenting TV shows.

Hm, if your intent is to work on a Yu-Gi-Oh product RECREATIVELY, I might recommend looking into the now defunct Yu-Gi-Oh BAM Facebook game (perhaps still exists on Kongregate and/or iOS).

Good source of info on how to proceed.

Otherwise, avoid licensed content at all costs.

And LUA is a scripting language used by a number of engines or game development environments as a high-level scripting solution for large amount of contents to be developed by, generally, design-centric resources.

This topic is closed to new replies.

Advertisement