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

Where should people start on knowning how to script better

Read the 1st page until you see a button called next page and then you click it, rinse and repeat :)
 
I think I'm also going to read all of those tutorials, I really need to learn it too. (After LoL Worlds finals :p)

I really liked this tutorial tho and CodexNG's "Lua broken down"
 
Last edited by a moderator:
For "OT-Lua," I've found the best place to start is not online at some website, but rather within the distribution you plan to begin coding.

Going over already existing scripts, reading them, going through functions, etc. all helped me understand how OT-Lua worked. My first goal was to learn what the functions do. If you do not know what they do before you begin coding, you may be lost as to what you need to use and how to use it. The "how" part comes with tutorials.

Reading through a script and understanding how it works - finding its purpose - is what allowed me to learn Lua.

Good luck! ;)
 
I think I'm also going to read all of those tutorials, I really need to learn it too.

Well I think tutorial points better to look at then go to scripting guide again and relook but so far as I been learning Npcs createing are more common for any server and any scripter can solve. Im going to make a npc with exchangeing gear if i can but I want to see how long I can not post for help for any scripts only problem I struggle on is the stuff that need ( * if elseif which tutorialspoint will tell me what i can use which also I think after u learn tfs 1.2 scripting u can do it all from any other version basically im starting at hard version of learning scripting a little in a way.But in my head im always thinking scripts take 2-5 mins to be make honestly still trying to figure what take people so long scripting when u can copy or paste and edit the stuff you want to do.I never made a event but someone who makes em I would love to see how many people makes em and takes 1-4 hours to make I doubt i be able to do but more likely i thought event makeing scripts were like 5-10mins to make to me.
 
Well I think tutorial points better to look at then go to scripting guide again and relook but so far as I been learning Npcs createing are more common for any server and any scripter can solve. Im going to make a npc with exchangeing gear if i can but I want to see how long I can not post for help for any scripts only problem I struggle on is the stuff that need ( * if elseif which tutorialspoint will tell me what i can use which also I think after u learn tfs 1.2 scripting u can do it all from any other version basically im starting at hard version of learning scripting a little in a way.But in my head im always thinking scripts take 2-5 mins to be make honestly still trying to figure what take people so long scripting when u can copy or paste and edit the stuff you want to do.I never made a event but someone who makes em I would love to see how many people makes em and takes 1-4 hours to make I doubt i be able to do but more likely i thought event makeing scripts were like 5-10mins to make to me.
Use smaller sentences.
If your going to build a server and want to have custom scripts then you or anyone else on otland that claims to be a scripter needs to learn the core language, there is no way around it.
 
Use smaller sentences.
If your going to build a server and want to have custom scripts then you or anyone else on otland that claims to be a scripter needs to learn the core language, there is no way around it.

I always try to make it short at possible & if it long or can be shorten then I would like to be told can be shorten & which as long the script works the way it should idc if it long or not but i think it better for short from what u say since the server aint executeing long scripts & run better or it just run the same with any other script heck idk im start off making a working script first if it long and works I got something going & i can later on shorten it.
 
Do you know the basics of LUA?
It sounds like you want to learn, but starting with a huge (& messy) script might not be the best idea.
Once again, I don't know how much you already know about LUA, but the best way to start is to study some simple scripts that come packed in TFS by default - such as:
  • 6 sided dice roll & how it transforms the item and sends that effect to the position of the dice
  • Study the machete script to learn a bit about arrays and how you can use and draw information from them.
  • preventWalk / pushback in movement scripts that pushes the player back to the tile where he came from
  • etc.
You can then go into the documentation and open the file called LUA_FUNCTIONS that is very helpful for beginners. It contains 90% of the functions in TFS and a lot of descriptions and small code snippets that describe how to use those functions.

The next step would be to take a look at which options you have to trigger your functions.
You have actions (when something with an attached aid/uid is used), creaturescripts (when something dies, logs in, logs out, advances in skill, prepares to die, etc.), movements (when something moves, either an item or a player from a position/slot to another position/slot), spells (when someone casts a spell configured in spells.xml), talkactions (when someone says a configured word or command), globalevents (when the server is starting, closing, when time passes while the server is running, etc.).

Now when you know all the different kinds of triggers for your scripts, you can imagine something. For example, a doll that gives you an addon when you use it, and start creating such a simple script by looking at the functions in LUA_FUNCTIONS and modifying them to fit your requirements in your action script for the doll.

Here is a great website where you can read up on anything lua related if you're looking to learn some new tricks (now we're talking about the language, syntax and mechanics), for example how to use tables/arrays, how to use loops, conditions and whatnot:

http://www.lua.org/pil/contents.html#P1

Here are some neat posts by OTLand users that can help you learn more about scripting in lua:

https://otland.net/threads/list-of-tutorials.180156/
https://otland.net/threads/beginner-scripters-dummy-proof.233921/
https://otland.net/threads/lua-understanding-storages.189075/
https://otland.net/threads/how-to-using-addevent.225292/

Take note, various server engines operate with slightly different versions of these same functions.
In TFS 1.0, some things are written a bit different from TFS 0.2.x or TFS 0.3.x.

Once you learn more, you can even make your own functions and use them in your server.

If you're already experienced, then, I suppose, you may disregard what I said as you probably know all of that, but eh, leaving this out here for anyone who might find it helpful.

https://otland.net/threads/im-here-to-learn-not-steal-and-leave-please-teach-me-masters.234226/
 
Literally one of the best out there.
A shame they didn't add LUA...yet :( Anyway it really is great because you see results of what you are doing directly and can experiment and such^^ Pretty damn cool if you ask me :p
I also have alot of books but I use them for reference rather. They don't motivate me tbh.
 
honestly just try to make scripts for ur server, look at other scripts for examples etc and try to understand how scripts work. everytime some scripts get released i look at it and try to learn things from it.
use stuff like this https://otland.net/threads/sublime-text-3-lua-tfs-autocomplete.236543 it will make ur life 10x easier
i've never used some website that teaches u programming, i've just learned from looking otland threads/making my own stuff/asking questions here and these days i can make pretty much everything i want.

but yes if u want deeper understanding and want to program someone else than ots then sure u should learn at some other website that has good tutorials
 
A shame they didn't add LUA...yet :( Anyway it really is great because you see results of what you are doing directly and can experiment and such^^ Pretty damn cool if you ask me :p
I also have alot of books but I use them for reference rather. They don't motivate me tbh.
I really like the website, http://codecademy.com.
 
DAAAAMN, DO YOU KNOW A DIFFERENCE BETWEEN A CHEESE BURGER?????

tumblr_nskbtkv9SB1uxv83oo1_400.jpg
 
Back
Top