• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Initiating in OTserv programming

rickgv

Member
Joined
Oct 22, 2007
Messages
44
Reaction score
17
Hey, guys,

I'd like to apologize in advance for my bad english cuz I'm brazilian, and our public schools barely teach portuguese itself.

I used to play Tibia ages ago, then, recently, I got back invited by some old folks.
Back in 2004, things were completely different, we weren't worried about leveling, getting stronger, getting better items. We just wanted to have fun.

And we did, until now, when I created my account and saw what the game has become - a game made for powergamers.

I'm not like that, I just wanna have fun.

I had a conversation with a friend of mine for hours about what we believe are good things for a game like Tibia.
I wanna develop an OTServ with the things we believe are nice, so we can play and have fun together.
We have some ideas, which, for the sake of understanding, I'd like to share with you:
-Profession system: blacksmithing, enchanting, cooking, gathering, alchemy (like WoW);
-Crafting system: you know the recipe for a special food or equipment?, then you can create it, if you have the required mats;
-Several new classes and races;
-Faction system: depending on your faction, you are not supposed to attack a mate;
-Reputation system: you can, with you choose to, work on reputation to a certain faction;
-Puzzles/quests: we think the puzzle mission would be great.

Those are just some of the ideas.

So, I'm a systems analist, I know a lil of Java, SQL, PHP.
I'm wondering what it takes to come from almost zero knowledge of programming to have my own server designed and programmed.

What steps should I take?

You guys have any tips of where I should start?

Maybe studying C++, LUA?

Thanks.
 
Hello rickgv. I think you can just start with Lua because most of things you can do with events. Just try it, and keep learning about. If you find yourself in really painful doubt just jump in C++ sources looking for the name. Will be good to learn some of TFS core logic, but isn't necessary to create really nice things with Lua. Lua is very cool and easy, and the lua libraries that came with TFS will help you alot. Just look there to find types, enumerators and functions.

Grab the TFS 1.3 from repo, put it to run, and start creating something like an action to print WOW when using some item. Print every element to know what they are, and use some LUA help on the web. lua-users.org is nice. Good lucky and have fun

#Edit: As lua is a language born in Brazil you can access the reference manual here: Manual de Referência de Lua 5.2 - índice
Or if you understand english well, and learn better by examples you can look here: Learn Lua in Y Minutes
 
Lua if you want to write scripts, you can check out this thread, look at the Tutorials & Learning Resources sections, this will give you some idea on how to go about things
My Scripts & Source edits
 
Hey, Ratazana,

Thanks for you reply.

What you mean with "If you find yourself in really painful doubt just jump in C++ sources looking for the name."?
Regarding TFS, as someone who knows a little of Java, I download the source code and tried to understand the C++ code, but it seems to complex to me. Is there any specific file to start from?
You think with TFS 1.3 I'm able to implement the features I intend to?
Should I study LUA 5.2 or 5.3? Which one does TFS 1.2+ supports?
I just added both web sites you suggested me to bookmark to use as reference.

Thanks!


Hello rickgv. I think you can just start with Lua because most of things you can do with events. Just try it, and keep learning about. If you find yourself in really painful doubt just jump in C++ sources looking for the name. Will be good to learn some of TFS core logic, but isn't necessary to create really nice things with Lua. Lua is very cool and easy, and the lua libraries that came with TFS will help you alot. Just look there to find types, enumerators and functions.

Grab the TFS 1.3 from repo, put it to run, and start creating something like an action to print WOW when using some item. Print every element to know what they are, and use some LUA help on the web. lua-users.org is nice. Good lucky and have fun

#Edit: As lua is a language born in Brazil you can access the reference manual here: Manual de Referência de Lua 5.2 - índice
Or if you understand english well, and learn better by examples you can look here: Learn Lua in Y Minutes

Hey, bayview,

I thank you for pointing to your post. It's very rich in knowledge, and I'll definately give the scripts a try. I add'em to bookmark as well.

It seems you know a lot about script. You mind if I ask a question?
Do you think it's possible to implement a profession system in which, for instance, the player gathers wood from trees (then the tree 'dies'), and the player uses that wood along with other materials to create some furniture or weapon? It would be awesome. If I could do that, I'd spend hours doing it because I think it's so cool.

Thanks, man!


Lua if you want to write scripts, you can check out this thread, look at the Tutorials & Learning Resources sections, this will give you some idea on how to go about things
My Scripts & Source edits
 
Last edited by a moderator:
Do you think it's possible to implement a profession system in which, for instance, the player gathers wood from trees (then the tree 'dies'), and the player uses that wood along with other materials to create some furniture or weapon? It would be awesome. If I could do that, I'd spend hours doing it because I think it's so cool.

Thanks, man!
Action - Herblore / Mining Skill [TFS 1.1]

Just use the search box on the forum you should be able to find pretty much anything already made even code which resembles things you think you could expand upon. ;)
 
What you mean with "If you find yourself in really painful doubt just jump in C++ sources looking for the name."?

Well, if you can't understand how some things are going in the backstage. Like what some event ocurrs, then try to search for it on source to see how it happens.
As I said before, you can just use Lua pretty well for a lot of things.

You think with TFS 1.3 I'm able to implement the features I intend to?

For sure. If something is missing, you can just do as bayview said and use the search box to find some really nice things, like lua examples, lua systems, or c++ implementations.

Should I study LUA 5.2 or 5.3? Which one does TFS 1.2+ supports?

You can study 5.1/5.2. This are the ones TFS 1.2+ support. I would say to stick with 5.1, because, if you want to use LuaJIT, it's only fully compatible with 5.1.

So, the first thing is to have a running TFS. Then you can just try to create a action to when using an Tree item, print "Lumberjack". After, try to add some item to player, and last remove the Tree item.

If you are motivated, and want to learn. Just try. If you spend so much time with, what is better, what should I learn, where I start from, instead of learning by trying, you will be wasting knowledge time.

Regarding TFS, as someone who knows a little of Java, I download the source code and tried to understand the C++ code, but it seems to complex to me. Is there any specific file to start from?

Don't be afraid. If you thinks is complex, you don't need to do this, just keep on the script side. As you keeping coding in LUA, more and more you will create a familiarity with how the script system works, and how it's implemented in sources.

If you have more questions, or don't understand something pretty well. PM me, and I will help you with the basics.

Good luck, and enjoy the learn
 
Nice to see new people arround here and even better people with the motivation to help the new ones :D!!
 
Also im new and beginner too. I started with 0 knowledge, now working on my project and i can tell you one thing...
If you want to make a new/nice self stuff, you need c++, you can get alot of help from other otland users about this(Like me).
But, lua scripts do not solve everything, soo you need both, lua and c++ :p Without this and real "self" ideas(not like WoW) you will make just copy of others servers.
Just work hard, if you have plan then do it and dont give up. Do not be discouraged if something will take you alot of time, this is how gaining experience, knowledge works and it will turn to you and creation will come to you more and more easily.
Good Luck and Welcome on Board!
 
Action - Herblore / Mining Skill [TFS 1.1]

Just use the search box on the forum you should be able to find pretty much anything already made even code which resembles things you think you could expand upon. ;)
Hey, bayview,

Thanks for pointing to that thread. I had found some similar systems, but I couldn't really understand them all, so instead of just copying, I'm studying the LUA basics (just downloaded 'Programming in Lua).
I also added a lot of threads to bookmark so that I can come back to them later when I have enough skills to fully understand and learn from them.

Also im new and beginner too. I started with 0 knowledge, now working on my project and i can tell you one thing...
If you want to make a new/nice self stuff, you need c++, you can get alot of help from other otland users about this(Like me).
But, lua scripts do not solve everything, soo you need both, lua and c++ :p Without this and real "self" ideas(not like WoW) you will make just copy of others servers.
Just work hard, if you have plan then do it and dont give up. Do not be discouraged if something will take you alot of time, this is how gaining experience, knowledge works and it will turn to you and creation will come to you more and more easily.
Good Luck and Welcome on Board!
Hey, man,
I'm still studying LUA so that I can implement simple things, like profession and crafting systems, and once I'm at least 'ok' with LUA, I intend to move on and get to understand C++ better. I believe C++ will help me making the changes I need, like a completely new UI, spells, etc.
Even tho sometimes it's hard to find the strength to go on, I keep doing in cuz I know that knowledge can't be taken, can't be stolen, and I eventually will get things done. I wanna make my own game and nothing gonna stop me xD

Nice to see new people arround here and even better people with the motivation to help the new ones :D!!
I found this community amazing and very rich in knowledge, knowledge which can be applied not only to games but everything in general.
Once I learn enough to teach, I intend to stick here and help other people.

Well, if you can't understand how some things are going in the backstage. Like what some event ocurrs, then try to search for it on source to see how it happens.
As I said before, you can just use Lua pretty well for a lot of things.



For sure. If something is missing, you can just do as bayview said and use the search box to find some really nice things, like lua examples, lua systems, or c++ implementations.



You can study 5.1/5.2. This are the ones TFS 1.2+ support. I would say to stick with 5.1, because, if you want to use LuaJIT, it's only fully compatible with 5.1.

So, the first thing is to have a running TFS. Then you can just try to create a action to when using an Tree item, print "Lumberjack". After, try to add some item to player, and last remove the Tree item.

If you are motivated, and want to learn. Just try. If you spend so much time with, what is better, what should I learn, where I start from, instead of learning by trying, you will be wasting knowledge time.



Don't be afraid. If you thinks is complex, you don't need to do this, just keep on the script side. As you keeping coding in LUA, more and more you will create a familiarity with how the script system works, and how it's implemented in sources.

If you have more questions, or don't understand something pretty well. PM me, and I will help you with the basics.

Good luck, and enjoy the learn

Hey, Ratazana,
Thanks for your reply. I'm very curious and since the beggining I've been trying to sniff around the source code, tho I couldn't get much. I, like I said, used to make some simples applications in Java, using OOP, and that's how I imagine most applications: OOP software connected to a SQL software. I think I need to change this paradigma.
I feel like if I was told how the whole picture works I'd understand things better and everything would make sense.
Right now, I'm studying LUA enough to be 'ok', then it'll be C++ turn, then I'll try to get deeper in each one and create amazing new things to share with the community, cuz I don't wanna live off the game. If possible, would u talk to me in Discord? I'm Puppozao#7278.

Thanks, man.
 
Last edited by a moderator:
the c++ source codes include lua functions. Using the lua functions is quite easy but limits your work to the existing lua functions in the c++ source code. To learn lua check some tutorials on websites f.e otland. To learn c++ i suggest reading a book from the c++ author himself.
 
the c++ source codes include lua functions. Using the lua functions is quite easy but limits your work to the existing lua functions in the c++ source code. To learn lua check some tutorials on websites f.e otland. To learn c++ i suggest reading a book from the c++ author himself.
Hi, Drinc(k), how u doing?

I'm reading a book of the author of the LUA language, and it's been nice cuz I'm learning a new paradigma. I'm kinda struggling in metatables cuz that concept is weird, but I'll for sure succeed. Learning is so exciting, and feeling that again is so awesome. Makes us feel alive, u know?
Once I feel confident enough in LUA, I'll for sure give C++ a try given its importance not only to OTServ, but gaming industry in general, right?
I'll download the book you told me right now (if I manage to find it).
I've also added some threads from OTLand to bookmark so that I can read'em later when I know enough.

I'm looking forward to be able to contribute to the community. Soon it'll be.

Thanks.
 
Hi, Drinc(k), how u doing?

I'm reading a book of the author of the LUA language, and it's been nice cuz I'm learning a new paradigma. I'm kinda struggling in metatables cuz that concept is weird, but I'll for sure succeed. Learning is so exciting, and feeling that again is so awesome. Makes us feel alive, u know?
Once I feel confident enough in LUA, I'll for sure give C++ a try given its importance not only to OTServ, but gaming industry in general, right?
I'll download the book you told me right now (if I manage to find it).
I've also added some threads from OTLand to bookmark so that I can read'em later when I know enough.

I'm looking forward to be able to contribute to the community. Soon it'll be.

Thanks.
You shouldn't rush into things, both lua & c++ can be tough subjects to wrap your head around. Don't worry about contributing to the community, what is important is for you to have a good understanding of at least lua once you have the general concepts then you should start messing around with the TFS framework and build simple things or edit existing scripts/systems to get yourself familiar with what methods/functions/interfaces do what.

After you have gotten your hands a little dirty then you can start writing your own scripts, C++ is not something you want to dive into right away, neither is editing the source unless you have been working in the framework for a decent amount of time.
 
You shouldn't rush into things, both lua & c++ can be tough subjects to wrap your head around. Don't worry about contributing to the community, what is important is for you to have a good understanding of at least lua once you have the general concepts then you should start messing around with the TFS framework and build simple things or edit existing scripts/systems to get yourself familiar with what methods/functions/interfaces do what.

After you have gotten your hands a little dirty then you can start writing your own scripts, C++ is not something you want to dive into right away, neither is editing the source unless you have been working in the framework for a decent amount of time.
Thanks for your inputs, bayview,

Right now, I'm studying Lua basic concepts a little longer than usual because I wanna make sure I understand the basics before moving forward.
It'll take much longer to get to C++, but It's a dream I keep alive.
This weekend I intend to modify some scripts to see some magic. It'll be fun, I'm sure. The help of you all is being awesome. Thanks.
 
Back
Top