• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Solved General programming question

Wiw3K

New Member
Joined
Apr 16, 2008
Messages
371
Reaction score
3
Hello, last time on forum i was long time ago. Since that i have learnt some C++/C# and now after i returned i was like ok easy lets code some scripts... but after a while few questions came up.

How do you get those functions for lua scripting so easly, how you know what it returns and what methods example player class have :eek: is there any special editor with intellisence or something ?
 
Once you get used to the patterns they resemble it's pretty easy to guess the functions and it's parameter(s)
There are also a few good documentations about it around here, the one in my scripting thread is outdated but covers most of the usefull functions http://otland.net/threads/scripting-guide.74030/#post-758231
If you have further questions feel free to ask :)
 
I found Your Tutorial, it gave me a bit of knowledge :) but still i miss any info about what function returns and what method, parameters it has, so if there is none special editors for Lua OTS programming then i have to learn by reading other's scripts.
 
well most things go by logic I'd say
example:
Code:
isPlayer(cid) <-- returns either true or false
Here it is a bit more tricky, if I didn't have any knowledge about the functions.
Code:
getPlayerWeaponType(cid) <-- this could return either string ex: "sword" or a number value ex: 1, by logical reasoning
But yea, checking other peoples scripts is the best way, there you can learn a lot of things and see how the patterns work.

Another good and easy way to test the returnvalue of a function is to use the print function
example:
Code:
print(getCreatureHealth(cid))
You can do that with every function aslong as you use it in the right way and see the outcome.
 
Thanks for helping me but i found it! :)
Thing i was looking for is a file called "LUA_FUNCTIONS" in "doc" directory of my server.
Thanks again. :)
 
Back
Top