• Lightweight gamemode base
    7 replies, posted
Hey, I've released a small gamemode base on Github that I use for all of my gamemodes, it's pretty nice to base off as it has a good folder structure and saves time by automatically including clientside/serverside/shared files for you. It can of course be expanded to include configs, libraries, etc. [IMG]https://static.alydus.net/images/filestructure_update1.png[/IMG] Features: . Appropriately includes all lua files in the server/shared/client folders . Support for folders inside of the server/shared/client folders . A auto folder, which includes lua files according to the prefix (sh_, cl_ or sv_) . Basic HUD starter to save time . Very lightweight Feel free to use it, if you have any suggestions feel free to post them here to help others. [URL="https://github.com/Alydus/alydus-gamemode-base"]Alydus's Gamemode Base (Github)[/URL]
Maybe support sub-folders inside client/server/shared folders?
[QUOTE=code_gs;51781191]Maybe support sub-folders inside client/server/shared folders?[/QUOTE] Great idea, I'll look into doing this soon.
Is there support for breaking the client/server/shared structure to do darkrp-ish auto-include? ie I have sv_whatever.lua cl_whatever.lua ect.?
[QUOTE=Apickx;51782507]Is there support for breaking the client/server/shared structure to do darkrp-ish auto-include? ie I have sv_whatever.lua cl_whatever.lua ect.?[/QUOTE] Kind of pointless to support if he chose to separate it by folder.
The problem I can see with automatically including all serverside/shared files is that if you create a function in one file and call it in another it might not work since the file where the function was originally created might end up being included after the file where it's being called. This doesn't really matter for clientside files, though. Also, since there's currently not a whole lot to this base other than a folder structure, perhaps you could try expanding upon it with some useful functions and libraries. I get that you want to keep it lightweight, but some general things such as built in MySQL support could be neat.
[QUOTE=Jocken300;51784504]The problem I can see with automatically including all serverside/shared files is that if you create a function in one file and call it in another it might not work since the file where the function was originally created might end up being included after the file where it's being called. This doesn't really matter for clientside files, though. Also, since there's currently not a whole lot to this base other than a folder structure, perhaps you could try expanding upon it with some useful functions and libraries. I get that you want to keep it lightweight, but some general things such as built in MySQL support could be neat.[/QUOTE] I understand, I was thinking about making a certain extension for files that it would detect to load last, which would probably fix the problem. Also, what exactly do you mean by MySQL support? A wrapper for MySQLoo or something? EDIT: In later thought, the file extension idea could potentially have a number in it so it loads it in that particular order to make it so you can have things load when you want.
Update #1: Added support for folders within the server/shared/client folders. Added a new auto folder, which includes files correctly depending on cl_, sh_ or sv_. Console messages can be turned on/off Console messages are now generally easier to read [IMG]https://static.alydus.net/images/filestructure_update1.png[/IMG] Still lightweight! Let me know if you have any other ideas, I'm probably going to implement the loading order somehow soon. [URL="https://github.com/Alydus/alydus-gamemode-base/commit/f3ab1b4548f91ad7184e291dac69e5a055b410a2"]Commit[/URL] EDIT: Quick hotfix, gamemodeFolderName now uses engine.ActiveGamemode, was looking for a function that returned the gamemode folder name.
Sorry, you need to Log In to post a reply to this thread.