• How to create a class?
    4 replies, posted
I'm trying to make a variety of classes/loadouts for a gamemode I'm planning, but I'm unsure on one detail. Where does the code for it go? I know the code, but do I put it in the shared.lua, or do I give it it's own .lua file? If so, what CSFiles do I need to add/include?
If a file is needed only on the CLIENT (vgui stuff mainly): - Put it in a cl_xx.lua file (not necessary but helps keep organization) - In a SERVERside file (most likely init.lua), AddCSLuaFile() it - In a CLIENTside file (most likely cl_init.lua), include() it If a file is needed only on the SERVER: - Put it in a sv_xx.lua file (not necessary but helps keep organization) - In a SERVERside file (most likely init.lua), include() it If a file is SHARED (needed on both CLIENT and SERVER): - Put it in a sh_xx.lua file (not necessary but helps keep organization) - In a SERVERside file (most likely init.lua), include() it - In a SERVERside file (most likely init.lua), AddCSLuaFile() it - In a CLIENTside file (most likely cl_init.lua), include() it
Make a simple loading system or something. By using file.Find(...), you can get all files, then by using string.sub you can check if the two first letters are cl, sv or sh, then AddCSLuaFile and include the different files intended to.
Acecool does ^ in his dev_base which you can check out here: Bitbucket
cool, thx for the help! It looks like it's working now!
Sorry, you need to Log In to post a reply to this thread.