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

Looking for OT documentation so I can write LUA scripts

Pteryx

Member
Joined
Mar 5, 2014
Messages
196
Reaction score
20
I'm setting up to do some OT LUA coding "real soon now". If there's any documentation available about OT components I'd like to find it.

BTW if this is the wrong place for this question, just let me know where it should be and I'll move it.

I have TFS 1.0 downloaded (but not running yet) and I've scanned through a lot of the LUA code, XML documents, and some of the C++ code. There's a lot of information there, but also a lot of gaps and/or things that are hard to track down. I'll probably be able to fill some of the gaps when I have a server running and a map editor (which I hope will display things like item types and attributes) ...

... but I'd still like to read the docs if there are any :)

Right now I'm looking for:
  • Object definitions
    • Major Object types and attributes (like Item, Creature, etc) - I have the names, but few details
    • Major Object subtypes (e.g. Item subtypes) and attributes by subtype - I have the names but no details
    • Common minor objects (like Position, Combat, Condition) and their attributes
  • OT's LUA functions
    • Purpose (I have the names, but the names are all the docs I can find)
    • Call signatures for LUA functions (I can find these in the C++, but I can't always see what the parameters mean)
    • Standard parameters (like cid, itemEx, fromPosition, etc) and their object type and meaning
    • Timer/delay support for features like healing over time and decaying
  • C++ support for the XML documents
    • I just started looking at the C++ code - it looks like e.g. items.cpp might use the corresponding XML document to override attribute values for some/all items on sartup, but I can't read C++ so well :(
  • Event architecture
    • This looks very powerful, but it's also a bit hard to figure out just from reading other people's scripts :)
  • Relationships between items (where there is one) and how they are controlled
    • I first bumped into this tracing a snow script: there seem to be a lot of different snow tiles, with some "decay chains" defined from e.g. "footprint snow" back to normal snow. This is a very nice feature of course, but it means there are relationships between the item numbers, their graphics, the XML document that defines the decay chains, and (perhaps) the way the C++ LUA functions that implement decay work.
    • I haven't looked closely at teleports, doors and keys, etc, but there seem to be plenty more inter-connected items.
 
Last edited:
I'd already seen most of that material, but your post motivated me to look at a few more tutorials, so it's helped already :)

Here's an example of one of the problems I'm having, in this case with objects and attributes:
http://otland.net/threads/xml-how-to-make-a-monster-fully-explained.104962/

This will be very helpful for me, because it explains a lot of creature attributes as well as where the definitions should be added. Unfortunately it's the only object definition it's kind I've found so far.

On the other hand there are a bunch of criticisms:
  • Some from people who (incorrectly) think it's too simple, and it won't help anyone.
  • At least one that explains some gaps in the set of attributes
  • A short unresolved discussion about the meaning of some of the attributes
If I can't get that kind of thing via tutorials or documentation, maybe there's something that explains how the C++ code and LUA interact? BTW I don't mean the function definitions - I found those already. But I can't read C++ well enough to figure everything out.
I'm a Java programmer - C and C++ look weird to me - so if the C++ modules are the "master copy" I'm in trouble :)
 
This is still an open issue in TFS 1.0 (see https://github.com/otland/forgottenserver/issues/51). The reason why I haven't written any documentation yet other than instructions on Compiling is because TFS 1.0 is work in progress and there may still be breaking changes. This is also why I haven't pushed any release yet.
 
Thanks for the info.

I agree it's (much) more efficient to put the public docs together after the technical environment stabilizes :)

I'll do the best I can with what's available.

Unfortunately my project leader is a merciless slave-driver ... if he gets too aggressive I may have to direct him to you :)
 
Back
Top