Is your feature request related to a problem? Please describe.
There is no documentation for modules or is really poor
Describe the solution you'd like
Make one
Describe alternatives you've considered
Github wiki
Additional context
I think that modules can be really game-changers but no one knows how to write ones. Ok, meybe there are some people who knows but they probably made ones with tries and failures. It would be cool if modules could have some page on wiki or here with examples etc.
Just want to point out that #680 will deprecated the use of modules and encourage standard Lua packages instead.
All I can say is that if you need modules and figure out useful information, any documentation you write will be appreciated. (And if another developer knows anything or has useful tips, please do dump it here or somewhere.)
_Personally_ I don't use modules or the sdk, so I wouldn't go through the effort of investigating and documenting this, considering that the time I spend learning about it will have a short lifetime.
With the examples given (like the MySQL module) and enough C++ knowledge you can easily figure this out. Perhaps I could write a user guide about it sometime.
I was thinking about making some module for WebSockets. I will try to make it on my own :)
Just want to point out that #680 will deprecated the use of modules and encourage standard Lua packages instead.
I understand the rationale for deprecating modules, because they are a kind of obscure feature that might complicate maintenance (I remember that MTA 1.4 caused a bit of havoc with modules due to OOP).
However, I'm curious about whether there are plans to remove them or not: although Lua packages replace them to a certain extent, they are still not C modules, and thus do not have nor the same performance or direct access to the underlying OS API, meaning that some things are either more difficult to achieve or outright impossible. Therefore, I ask: C modules are something that will stay in MTA for a long time, right? Even if they are underused, they open so cool possibilities... For people which knows how to use them.
Lua modules can be written in C, http://lua-users.org/wiki/BuildingModules.
(Only modules written in Lua can be loaded on the client, though.)
Nice one, then! I hope for #680 to be ready to merge soon :+1:
I think sooner I will prepare Haxe for MTA which also has something similar to LuaRocks (called Haxelib) and doesn't need to be integrated with core modules.
One quick question: where can I find all definitions of server-side and client-side functions (which file in this repo)?
One quick question: where can I find all definitions of server-side and client-side functions (which file in this repo)?
Client: https://github.com/multitheftauto/mtasa-blue/tree/master/Client/mods/deathmatch/logic/luadefs
Server: https://github.com/multitheftauto/mtasa-blue/tree/master/Server/mods/deathmatch/logic/luadefs
Shared: https://github.com/multitheftauto/mtasa-blue/tree/master/Shared/mods/deathmatch/logic/luadefs
(Client/Server may contain copy-pasted functinos, instead of being in the Shared folder.)
Thanks :)
Most helpful comment
Nice one, then! I hope for #680 to be ready to merge soon :+1: