General > Developers Corner
Include Issue?
Decicus:
So here's the story: I was working on the scoreboard again, and I was attempting to add a specific part by removing it from the main file, making a new one, and doing the whole "include("filename.lua")" thing.
I made a file called "custom_ranks.lua", added an "include("custom_ranks.lua")" in the main "sb_row.lua" file and then tried to join, but it kicked me saying that the file didn't exist.
What I have done:
- Made sure that the filename/directory is correct. The filename + include + placement was correct, because the custom_ranks.lua file was inside the same folder as the sb_row.lua.
- Made sure everything was correct, then reloading the map using "changelevel".
- Did a full restart by doing "exit" in the server, then starting it back up.
My error is this:
--- Code: ---Couldn't include file 'custom_ranks.lua' (File not found) (@gamemodes/terrortown/gamemode/vgui/sb_row.lua (line 7))
--- End code ---
I have no clue why it's doing this, because I've double checked everything. And all of it seems to be correct. And that is the only error I'm getting. Any of you guys know of this problem?
JamminR:
Tried a AddCSLuaFile before the include anywhere?
It's possible your original file is known/on the server, and shared automatically.
Your additional file would need to be known by the server to include it on the client (even if you've already copied it to your client)
(This is my educated guessing. I've no experience with scoreboards/gamemodes)
Decicus:
So I tried adding a "AddCSLuaFile("custom_ranks.lua")" before the include. No luck. (same error)
I tried only having AddCSLuaFile, the scoreboard didn't have the rank section.
I also tried removing the include + AddCSLuaFile completely. Scoreboard didn't have the rank section.
Thanks for giving me suggestions, but none of them worked.
iSnipeu:
You only need to add AddCSLuaFile() to the top of the file you want sent, as calling it without an arg will add the current file.
Decicus:
I shouldn't need to use AddCSLuaFile. The only thing I'm doing is to try and move a specific part out of the main file, into another one and still make it possible for the main file to be able to load it from the other file. I'm pretty sure I shouldn't need to use AddCSLuaFile, because if it needs to be loaded clientside, it should already have been done.
Navigation
[0] Message Index
[#] Next page
Go to full version