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

OTClient Module creation resources

Gnufoo

New Member
Joined
May 8, 2024
Messages
2
Reaction score
0
GitHub
ncerroneumich
Hello, I am trying to write my first OTClient module but I am not finding many resources on the topic. I found the BeniS module tutorial, but that only covers basic module setup. Additionally, I cannot figure out how to use the tutorial module beyond loading it in OTClient. Is there a resource I can go to that explains the API that OTClient offers? What do other people do to learn how to create modules?

I have experience with Lua / C++ so writing to code isn't the issue, but I'm trying to learn the actual process of making an OTClient module. Any help/guidance is appreciated, thank you!

edit:
found this and will explore
 
If you want to see how the connection between server and otc works, you can either read yourself through sources:
forgottenserver/src/protocolgame.cpp at master · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/src/protocolgame.cpp#L513) starting from here onwards.
If you want to directly implement everything in lua then I advise getting familiar with this (sending bytes and data to client) https://github.com/otland/forgottenserver/blob/master/src/luascript.cpp#L2377-L2405
Then we have this place it's where the bytes are parsed by the server (send from client to server) forgottenserver/data/events/scripts/player.lua at master · otland/forgottenserver (https://github.com/otland/forgottenserver/blob/master/data/events/scripts/player.lua#L278-L286)

Put in easy words
client sends a uint8_t byte (to identify what function this belongs to)
followed by either bytes/strings
server receives those and needs to parse them in the correct order, from there you can drag all the data from you need on your server side and send back whatever the client expects.
Hope this helped to make it a bit easier getting started with.
 
Back
Top Bottom