• 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!

okay, I want to learn to script!

cake

Banned User
Joined
Jul 24, 2010
Messages
838
Reaction score
58
Location
good or bad,
really ^_^
never thought I would, but I really want to make unique systems in me, collz' & hawars' upcoming server.

First of all, I know absolutely nothing about scripting.
Is there any tutorials explaining the basics?
Also I saw in tutorials something about C/C++, is that what Tibia-scripting uses?

Thanks!
 
Open Tibia uses LUA as scripting language (Maybe Python too in future. :p).
Use following link to know basics of LUA Lua 5.1 Reference Manual - contents, then learn functions from DOC/LUA_FUNCTION in TFS to know Open Tibia LUA.
Also, I'd recommend you to open existing scripts and play with it, it's the way how I was learning scripting. When you will be able to do simple scripts, go to LUA & XML Request section for more practice, just help newbs. And no, C/C++ isn't scripting language, it's programming language. It's used to create .dlls, applications and such.
 
Open Tibia uses LUA as scripting language (Maybe Python too in future. :p).
Use following link to know basics of LUA Lua 5.1 Reference Manual - contents, then learn functions from DOC/LUA_FUNCTION in TFS to know Open Tibia LUA.
Also, I'd recommend you to open existing scripts and play with it, it's the way how I was learning scripting. When you will be able to do simple scripts, go to LUA & XML Request section for more practice, just help newbs. And no, C/C++ isn't scripting language, it's programming language. It's used to create .dlls, applications and such.

Thanks I'll read the link :p
 
Um also, most important functions (or most used) are those starting with math., string. and table.. Also these are usefull:
Code:
_G
_VERSION
assert
collectgarbage
dofile
error
getfenv
getmetatable
ipairs
load
loadfile
loadstring
module
next
pairs
pcall
print
rawequal
rawget
rawset
require
select
setfenv
setmetatable
tonumber
tostring
type
unpack
xpcall

I don't recommend you to learn file, debug, coroutines, io and os if you want to use LUA only in OpenTibia (Ofc. learn these too if you have too much time.) :p.

After knowing functions, learn syntax and simple statements, then you are done with basics.
 
Um also, most important functions (or most used) are those starting with math., string. and table.. Also these are usefull:
Code:
_G
_VERSION
assert
collectgarbage
dofile
error
getfenv
getmetatable
ipairs
load
loadfile
loadstring
module
next
pairs
pcall
print
rawequal
rawget
rawset
require
select
setfenv
setmetatable
tonumber
tostring
type
unpack
xpcall

I don't recommend you to learn file, debug, coroutines, io and os if you want to use LUA only in OpenTibia (Ofc. learn these too if you have too much time.) :p.

After knowing functions, learn syntax and simple statements, then you are done with basics.

Is there any specific guide for OT scripting (Lua)?
Because the one I'm reading now is boring haha =p
 
A lill tips from me, how i started;
I was change spells on server..
*Edited mana for the spell.
*Spell word.
*Spell dmg.
*And how it should looks like.
*(spell script)*
pretty easy, i think u'll made it in some minutes :)
 
A lill tips from me, how i started;
I was change spells on server..
*Edited mana for the spell.
*Spell word.
*Spell dmg.
*And how it should looks like.
*(spell script)*
pretty easy, i think u'll made it in some minutes :)

But wouldn't that require I had a server?
Or is it possible I can host a very small map (50x50 sqm) only for myself, so I could test such things? :D
 
Ah, is there any place I can dl .lua things? :p

Resources

Just get any script from that board and play with it, try editing something, adding some line from other script or sometihng or even use default TFS scripts, like shovel. Shovel.lua was my first script I edited tho, changed "Scarab" to "Demon" and I was able to get demon from sand, haha. But first, learn syntax, like how to end statement, how use strings and integers etc.

A lill tips from me, how i started;
I was change spells on server..
*Edited mana for the spell.
*Spell word.
*Spell dmg.
*And how it should looks like.
*(spell script)*
pretty easy, i think u'll made it in some minutes :)

Actually these things are less than basics and almost every dumb can make it, but yeah, still something.

@EDIT:

But wouldn't that require I had a server?
Or is it possible I can host a very small map (50x50 sqm) only for myself, so I could test such things? :D

Lol ofc, just setup TFS with small map (or even TFS default map) and test everything there, if you will use non-existing function or you'll miss something in syntax you will see error in TFS console, you will understand errors by the time so you'll know how to fix them.
 
Yepp, it's rly easy...
And yes, It's work to host by your self and check the spells etc :)
It's the best way you can do it on.
Well, only ask if you need somthing :) I'll help if u need it.
Good luck!
 
make a map (1x1) to test in it, if you are going to test ot lua in it,
or download lua compiler for testing what you learned from sites ,
me myself have leraned and refrence to this book

Programming in lua 2nd edition

With 'lua compiler' she/he wouldn't be able to test OpenTibia scripts -.-'.

oki, sorry to keep asking but I'm rly noob here.
How can I host a server, only for my PC?

You need to download any distro (I preffer 0.3.6, best free imho.) from here Distributions and some MySQL server, I recommend you to use XAMPP apache friends - xampp for windows. Then you have to setup config.lua in server (MySQL connection is most important thing.). You can find better tips how to setup server there Basic. :p

@Edit:
Keep asking, I'll keep answering = more posts. Next goal = 5k GET :p
 
Yes you MUST have a server to test in. You don't need to make a script from scratch. Just use any script you find, not too complicated and then start messing around with it. There are tutorials here: Programming & Scripting

I recommend those in my signature after you've learned the basics. I don't quite fancy the current beginner tutorials in the scripting section but there are some there. I might attempt to write my own ones right now! :D
 
okay thanks! fyi. I'm a she, girl, named Sara =p
I don't like being mentioned as he/she xD
anyway, I'll eat then come back & look here.

Thanks for help everybody, it's appreciated, :)
 
With 'lua compiler' she/he wouldn't be able to test OpenTibia scripts -.-'.



You need to download any distro (I preffer 0.3.6, best free imho.) from here Distributions and some MySQL server, I recommend you to use XAMPP apache friends - xampp for windows. Then you have to setup config.lua in server (MySQL connection is most important thing.). You can find better tips how to setup server there Basic. :p

@Edit:
Keep asking, I'll keep answering = more posts. Next goal = 5k GET :p

Read my post....
I said creat a map [obviosly a map mean a server] to test the ot serv lua in it,
and i said if you want to test the learned lua from sites use compiler.........
 
Read my post....
I said creat a map [obviosly a map mean a server] to test the ot serv lua in it,
and i said if you want to test the learned lua from sites use compiler.........

I know what you wrote, but seriously it's better to test scripts @ OTS because she wants to learn LUA related to OT.
 
Back
Top