I am not sure what the Lua community calls them, but I will refer to them as files I guess.
I am coding a gamemode and would like to know the most efficient way to create the project. I have programming experience, but I am brand new to Lua so I thought I would get out of my usual shell and pride of not asking questions to just asking questions when I have them.
I know you need 3 basic files when created a game mode (actual Lua code files), the cl_init, init, and shared. I believe they are called. I also know you can have more files in your game mode as most game modes don’t cram everything into these 3 files.
When I create more files and add them as includes does that mean the file I included it in, I can use the functions in it? Or how does that work out? I guess what I am asking is if I have cl_init, and inside cl_init I include shared. What advantage or properties does that now give me with the 2 files?
I guess my final question for the time being would be, is it better to create specific files for different game modes systems rather than fewer files?
So say I want to create a money system within my gamemode would it be beneficial to create a new lua file to just handle the Money so as not to clutter up the rest of the project with it.
My natural instinct is telling me to create separate files for everything so it is easier to read and change specific parts, without having money and team spawning and weapons and everything crammed all next to each other.
I guess I lied, one more question!
The cl_ is a client file, does Lua see file names or is this strictly for human readability? How would I know when to go about using cl_ instead of server files or shared? When do I use shared, when do I use cl_ when do I use just plain server?
I am assuming cl_ would be used to display stuff to the users, such as a HUD, and team selections and the likes, and server would be used for handling the basic workings of the game mode, such as suiting characters with equipment and having a money system. But when would I use shared opposed to just server or just cl_ ?
Thanks for the help guys.