• AddCSLuaFile seems to have stopped working
    12 replies, posted
I'm developing with a plain Gmod install [no addons] and a dedicated Gmod server installed as described in the wiki section. Everything works fine, however I now had to add two more files which are used by the client. I added the extra AddCSLuaFile functions for them in my init.lua, yet when including them in cl_init.lua I get the "file not found" errors. - What is going on? I have already tried reinstalling Garrysmod and restarting and reinstalling the dedicated server - nothing works. - Is this a known bug? Edit: The same happens when I host a server directly in Garry's mod.
Well are you sure you're using the right path? You should always post the code to save time. Remember that a computer does exactly as told, no more, no less, so the problem has to come from you.
[QUOTE=Crazy Quebec;22440659]Well are you sure you're using the right path? You should always post the code to save time. Remember that a computer does exactly as told, no more, no less, so the problem has to come from you.[/QUOTE] The problem doesn't come from me. It is foolish to think that Garry's mod is bug-free, isn't it? So if the Garry's mod developers told "the computer" something wrong by accident, this might have caused the problem as well, or? And computers actually don't always do as they're told - RAM and CPU can have single bits flipped from, e.g.: 0 to 1 by accident, which means the output can become unpredictable. I think there is some problem with the new Lua cache which packs all lua's in one file and sends them over. My friends have the same problem, so I'm not alone either
2 people isn't everyone, and you'll notice there are quite a few servers using that function around. So once again you're the one not doing things properly. Don't take it as an insult, it's just a bad habit to blame the game/computer for your problems. If you're using FastDL are you sure you're caching the datapack? If not are you sure your server is not configured to use FastDL? You know, all the usual stuff. If you can't get it to work at all and are sure your problems come from the recent updates then you should start following/reading this thread : [url]http://www.facepunch.com/showthread.php?t=929591[/url]
Considering that the other thousand servers have no issues with this, it's your path. Post your code.
If you post your code, we can probably fix it.
You'll have to post the code. Remember that there's a lot of coders here.. They can't help you only from that.. But as a pointer init.lua "AddCSLuaFile" cl_init.lua "include".
you can "include" in both init and cl_init
init.lua: [CODE]AddCSLuaFile( 'shared.lua' ) AddCSLuaFile( 'item.lua' ) AddCSLuaFile( 'cl_item.lua' ) AddCSLuaFile( 'cl_init.lua' ) AddCSLuaFile( 'cl_scoreboard.lua' ) AddCSLuaFile( 'cl_postprocess.lua' ) AddCSLuaFile( 'cl_inventory.lua' ) AddCSLuaFile( 'cl_hud.lua' )[/CODE]cl_init.lua: [CODE]include( 'shared.lua' ) include( 'item.lua' ) include( 'cl_item.lua' ) include( 'cl_scoreboard.lua' ) include( 'cl_postprocess.lua' ) include( 'cl_charmenu.lua' ) include( 'cl_inventory.lua' ) include( 'cl_hud.lua' )[/CODE]Clientside output: [CODE] Couldn't include file 'item.lua' (File not found) Couldn't include file 'cl_item.lua' (File not found) Couldn't include file 'cl_scoreboard.lua' (File not found) Couldn't include file 'cl_postprocess.lua' (File not found) Couldn't include file 'cl_charmenu.lua' (File not found) Couldn't include file 'cl_inventory.lua' (File not found) Couldn't include file 'cl_hud.lua' (File not found) [/CODE]Upon joining a lua cache file is downloaded. Even if it says the includes for all files have failed[B] some seem to actually work[/B]. They seem to be included anyways, even if I remove the include statements from cl_init.lua What the heck is going on? No there's nothing wrong with my HDD | OS | Filesystem! I'm neither an idiot or a programmer or Windows noob. You don't need to ask me things like "do these files actually exist in their folder?" - they do
I would assume you're making a gamemode, so can you do these steps: 1) Verify that the .dua cache file is being generated on the server in the cache/ folder. 2) Verify that the client is downloading the .dua cache file from the server into the client's cache/ folder. This means turn on sv_allowdownload or make sure the cache file is copied into your fastdownload. 3) Run dump_luafiles on both the server and client to verify the files are there. 4) Check the cache/ folder on the server for a .txt file, which may signify there was an error creating the datapack. 5) Check the lua_temp folder on the client to verify the structure of the files being downloaded
1) Yes; There are several DUA files in the server's cache folder. I tried removing them several times - didn't solve the problem 2) The lua cache is downloaded. Everytime I change a file and restart the server, the client redownloads it (Downloading LUA cache file...) 3) Server: [CODE] Record 177: testgamemode\gamemode\shared.lua Record 178: testgamemode\gamemode\item.lua Record 179: testgamemode\gamemode\cl_init.lua Record 180: testgamemode\gamemode\cl_scoreboard.lua Record 181: testgamemode\gamemode\cl_postprocess.lua Record 183: testgamemode\gamemode\cl_inventory.lua Record 184: testgamemode\gamemode\cl_hud.lua[/CODE] Client: [CODE] Record 177: testgamemode\gamemode\shared.lua Record 178: testgamemode\gamemode\item.lua Record 179: testgamemode\gamemode\cl_init.lua Record 180: testgamemode\gamemode\cl_scoreboard.lua Record 181: testgamemode\gamemode\cl_postprocess.lua Record 183: testgamemode\gamemode\cl_inventory.lua Record 184: testgamemode\gamemode\cl_hud.lua [/CODE]4) There is no sign of a text file in the server's cache folder 5) The files and folder structure in the lua_temp folder is right. All the files added with AddCSLuaFile are present; But: [B]They all are 0kB in size, is that normal[/B]? And even if, they exist and it shouldnt matter if they are 0kb - it shouldnt trigger a file not found error, or?
lua_temp only preserves the folder structure so all files in there should be 0 bytes in size.
[QUOTE=DarKSunrise;22504756]lua_temp only preserves the folder structure so all files in there should be 0 bytes in size.[/QUOTE] Okay, but my problem still isn't fixed. :( I have no idea what is going on: - All files seem to be sent - Files I try to include in cl_init.lua trigger the file not found error as stated above - Files which actually triggered the include error are mostly still included - New files I add to AddCSLuaFile and try to include are completely ignored. They trigger the file not found error in cl_init.lua and aren't included
Sorry, you need to Log In to post a reply to this thread.