• Gmod server won't bother to include my library
    9 replies, posted
So I was dividing my tool in 3 files, just it can be red better, then I experienced the following error: [img]http://oi61.tinypic.com/a102uf.jpg[/img] The file is there. I used many methods to include it's still a bummer. I made it via "include" couse so far this is the best option that works for the database. It wrote with white text ( the server maybe) that Database is OK as it is included as it is, the when I join it crashes. Any Ideas ?
Post the code?
[QUOTE=Author.;47053508]Post the code?[/QUOTE] addons/TA/lua/autorun/trackassembly_load.lua [code] -- Shared include include("autorun/trackassembly/trackasmlib.lua") -- INITIALIZE DB trackasmlib.SQLCreateTable("PIECES",{{1},{2},{3},{1,4},{1,2},{2,4},{1,2,3}},true,true) trackasmlib.SQLCreateTable("ADDITIONS",{{1},{2},{3},{4},{1,2},{1,3},{1,4}},true,true) trackasmlib.SQLCreateTable("PHYSPROPERTIES",{{1},{2},{3},{1,2}},true,true) [/code] trackasmlib.lua - My library file the code is too long Tried to use this method: [url]https://github.com/wiremod/wire/blob/master/lua/autorun/wire_load.lua[/url]
Did you AddCSLuaFile'd your clientside and shared files? [editline]1st February 2015[/editline] From serverside file?
[QUOTE=Robotboy655;47053575]Did you AddCSLuaFile'd your clientside and shared files? [editline]1st February 2015[/editline] From serverside file?[/QUOTE] Thanks I will be sure to try that. [editline]1st February 2015[/editline] [code] -- Shared include if(SERVER) then AddCSLuaFile("trackassembly/trackasmlib.lua") end include("trackassembly/trackasmlib.lua") -- INITIALIZE DB trackasmlib.SQLCreateTable("PIECES",{{1},{2},{3},{1,4},{1,2},{2,4},{1,2,3}},true,true) trackasmlib.SQLCreateTable("ADDITIONS",{{1},{2},{3},{4},{1,2},{1,3},{1,4}},true,true) trackasmlib.SQLCreateTable("PHYSPROPERTIES",{{1},{2},{3},{1,2}},true,true) [/code] WORKS Cheers !
Cheers! Just so you know, you don't have to bother to seclude AddCSLuaFile only for the server. The client knows to ignore it.
[IMG]http://i.imgur.com/ylqmXE4.png[/IMG] :downs:
[QUOTE=zerf;47055081][IMG]http://i.imgur.com/ylqmXE4.png[/IMG] :downs:[/QUOTE] What's the advantage of that, again?
If an expensive global function/variable is used a lot, localizing it will make it a tiny tiny bit faster. Nothing noticable.
[QUOTE=Neat-Nit;47054424]Cheers! Just so you know, you don't have to bother to seclude AddCSLuaFile only for the server. The client knows to ignore it.[/QUOTE] Yep, but just to be sure :) xD Paranoia LoL
Sorry, you need to Log In to post a reply to this thread.