General > Off-Topic
Making a gamemode
iViscosity:
Ok so I wanna clarify, you have your init.lua, cl_init.lua, and shared.lua all in the 'gamemode' folder, and the rest on the 'modules' folder, is that correct?
EDIT: Also, have you given Sublime Text 3 a try? You can get a gLua syntax highlighter and I just like how it looks a lot better than Notepad++, just my opinion though :D
MrPresident:
That is correct, it's mostly just to keep it clean and organized. By default, only init and cl_init load. Everything else, including shared.lua has to be included. The reason I have my other files in a gamemode/modules folder is so that I can have that for loop I showed you automatically iterate and include/AddCSLuaFile all of my additional files and I don't have to include/AddCSLuaFile each one of them separately.
You could have everything right in your gamemode folder if you wanted, you would just need to include/AddCSLuaFile each one in the respective init/cl_init file as needed. My method just makes that easier for adding or removing new files. I just drop it in the folder it needs to be in and the gamemode handles everything else.
And, yes: I've tried Sublime. I don't like it. I have a GLua syntax highlighter for notepad++ and it works great.
iViscosity:
Quick question, if a file is added to the client, they really don't need to be included in other clientside files because they have the code on their system, is that correct?
MrPresident:
It still needs to be included in the cl_init file. Just because a client has a file doesn't mean it gets run.
The gamemode folder is like the top level lua folder when handling non gamemode stuff.. Scripts don't get run in that folder, but can be accessed. In a gamemode, there is no 'autorun' folder like in the lua folder, so the only files that get 'autorun' are the 2. init and cl_init. You need to include any other files you wish to execute.
iViscosity:
Makes sense. Thanks
Sent from Tapatalk. Owner of iViscosity Gaming.
Navigation
[0] Message Index
[*] Previous page
Go to full version