Hey guys,
This error is really ticking me off, and I know it's probably something so small it's stupid.
[I]Couldn't include file 'database\items.lua' (File not found) (@gamemodes/crystal/gamemode/cl_init.lua (line 3))[/I]
Here is line 3 of my cl_init.lua:
[I]include("database/items.lua")[/I]
If anyone can help, I thank you so much.
Have a nice day.
That means that the file "items.lua" in the folder "database" does not exist. I don't see why you'd want a database clientside anyway, but that's just me.
The problem is it does...
[IMG]http://i44.tinypic.com/2ljt1z6.jpg[/IMG]
"Include" is either relative to the file it's being called in, or the "lua/" directory. Right now it's searching for "items.lua" in "gamemode/database/database/" and "gamemode/lua/". You just want to do "include( "items.lua" )"
[editline]8th August 2013[/editline]
Wait disregard that I just saw your cl_init.lua is in the base gamemode directory.
[editline]8th August 2013[/editline]
Are you running this on singleplayer, a listen server or a dedicated server?
[QUOTE=EvacX;41761885]"Include" is either relative to the file it's being called in, or the "lua/" directory. Right now it's searching for "items.lua" in "gamemode/database/database/" and "gamemode/lua/". You just want to do "include( "items.lua" )"
[editline]8th August 2013[/editline]
Wait disregard that I just saw your cl_init.lua is in the base gamemode directory.
[editline]8th August 2013[/editline]
Are you running this on singleplayer, a listen server or a dedicated server?[/QUOTE]
This is part of a gamemode I am working on, but to playtest it, I am in single player.
[editline]8th August 2013[/editline]
bump, need help with this ASAP. I hate humping the bump button, but I need to fix this.
You need to AddCSLuaFile the file on the SERVER side or it will not be sent to the client. If it's not sent to the client, it will not exist.
[QUOTE=Acecool;41762787]You need to AddCSLuaFile the file on the SERVER side or it will not be sent to the client. If it's not sent to the client, it will not exist.[/QUOTE]
So essentially in layman's terms, I would add the following in the init file:
AddCSLuaFile("database/items.lua")
Just tried it, didn't seem to work.
[I][AddCSLuaFile] Couldn't find 'items.lua' (@gamemodes/crystal/entities/entities/item_basic/init.lua (line 3))[/I]
I added what I said before, and that was the result. Any thoughts?
the paths you have to feed to AddCSLuaFile() and include() are [i]relative to the location of the file you call them in[/i]
so if you want to include [b]gamemode/database/cl_derp.lua[/b], in [b]gamemode/init.lua[/b] you use
[lua]-- somewhere in gamemode/init.lua
AddCSLuaFile("database/cl_derp.lua")[/lua]
to tell the client to download the file, and in [b]gamemode/cl_init.lua[/b] you call
[lua]-- somewhere in gamemode/cl_init.lua
include("database/cl_derp.lua")[/lua]
[QUOTE=Luni;41763227]the paths you have to feed to AddCSLuaFile() and include() are [i]relative to the location of the file you call them in[/i]
so if you want to include [b]gamemode/database/cl_derp.lua[/b], in [b]gamemode/init.lua[/b] you use
[lua]-- somewhere in gamemode/init.lua
AddCSLuaFile("database/cl_derp.lua")[/lua]
to tell the client to download the file, and in [b]gamemode/cl_init.lua[/b] you call
[lua]-- somewhere in gamemode/cl_init.lua
include("database/cl_derp.lua")[/lua][/QUOTE]
Didn't seem to work, as it is still claiming it cannot find it.
[I][AddCSLuaFile] Couldn't find 'database/items.lua' [/I][I](@gamemodes/crystal/entities/entities/item_basic/init.lua (line 3))[/I]
That's because you're supposed to call it from a file that's in the root gamemode folder.
[QUOTE=EvacX;41764007]That's because you're supposed to call it from a file that's in the root gamemode folder.[/QUOTE]
I am, but the error is continuing to contradict that. These are the two files referencing what Luni said:
[IMG]http://i42.tinypic.com/2hyxezl.jpg[/IMG]
Well, the file "gamemodes/crystal/entities/entities/item_basic/init.lua" doesn't just create itself.
[QUOTE=EvacX;41764388]Well, the file "gamemodes/crystal/entities/entities/item_basic/init.lua" doesn't just create itself.[/QUOTE]
Stupid mistake! Fixed it!
Thanks for the help.
Sorry, you need to Log In to post a reply to this thread.