What is the order of lua directories being loaded by the client?
6 replies, posted
Hi, I'm developing a script which must load before any other script is loaded.
Does anybody know the order or the first lua directory loaded by Garrsmod?
I believe it's garrysmod/lua/autorun. Does anyone have any idea how I could change the load order?
This seems like an xy problem to me but if it isn't you can achieve loading before everything by making your own includes/init.lua.
[code]--[[---------------------------------------------------------
Non-Module includes
-----------------------------------------------------------]]
-- Loads before everything but doesn't have access to Lua functions without recreating them.
if (CLIENT) then
-- include your files here.
elseif (SERVER) then
-- AddCSLuaFile your files here.
end
include("util.lua") -- Misc Utilities
include("util/sql.lua") -- Include sql here so it's
-- available at loadtime to modules.
include("extensions/net.lua")
--[[---------------------------------------------------------
Shared Modules
-----------------------------------------------------------]]
require("baseclass")
require("concommand") -- Console Commands
require("saverestore") -- Save/Restore
require("hook") -- Gamemode hooks
require("gamemode") -- Gamemode manager
require("weapons") -- SWEP manager
require("scripted_ents") -- Scripted Entities
require("player_manager") -- Player models/class manager
require("numpad")
require("team")
require("undo")
require("cleanup")
require("duplicator")
require("constraint")
require("construct")
require("usermessage")
require("list")
require("cvars")
require("http")
require("properties")
require("widget")
require("cookie")
require("utf8")
require("drive")
include("drive/drive_base.lua")
include("drive/drive_noclip.lua")
--[[---------------------------------------------------------
Serverside only modules
-----------------------------------------------------------]]
if (SERVER) then
require("ai_task")
require("ai_schedule")
end
--[[---------------------------------------------------------
Clientside only modules
-----------------------------------------------------------]]
if (CLIENT) then
require("draw") -- 2D Draw library
require("markup") -- Text markup library
require("effects")
require("halo")
require("killicon")
require("spawnmenu")
require("controlpanel")
require("presets")
require("menubar")
require("matproxy")
include("util/model_database.lua") -- Store information on models as they're loaded
include("util/vgui_showlayout.lua") -- VGUI Performance Debug
include("util/tooltips.lua")
include("util/client.lua")
include("util/javascript_util.lua")
include("util/workshop_files.lua")
include("gui/icon_progress.lua")
end
--[[---------------------------------------------------------
Shared modules
-----------------------------------------------------------]]
include("gmsave.lua")
--[[---------------------------------------------------------
Extensions
Load extensions that we specifically need for the menu,
to reduce the chances of loading something that might
cause errors.
-----------------------------------------------------------]]
include("extensions/file.lua")
include("extensions/angle.lua")
include("extensions/debug.lua")
include("extensions/entity.lua")
include("extensions/ents.lua")
include("extensions/math.lua")
include("extensions/player.lua")
include("extensions/player_auth.lua")
include("extensions/string.lua")
include("extensions/table.lua")
include("extensions/util.lua")
include("extensions/vector.lua")
include("extensions/game.lua")
include("extensions/motionsensor.lua")
include("extensions/weapon.lua")
include("extensions/coroutine.lua")
if (CLIENT) then
include("extensions/client/entity.lua")
include("extensions/client/globals.lua")
include("extensions/client/panel.lua")
include("extensions/client/player.lua")
include("extensions/client/render.lua")
require("search")
end
-- Runs before addons and has access to Lua functions.
if (CLIENT) then
-- include your files here.
elseif (SERVER) then
-- AddCSLuaFile your files here.
end
[/code]
It's no problem, just a requirement with obfuscating code. I'm replacing all table key names. I'm also doing it for another reason too, I'm being ambiguous.
Thank you by the way.
I don't see why you'd need to load before everything to do that.
[QUOTE=Sean Bean;52362954]I don't see why you'd need to load before everything to do that.[/QUOTE]
You do when you're completely replacing the name of every single function in glua.
[QUOTE=Kris101;52364836]You do when you're completely replacing the name of every single function in glua.[/QUOTE]
but why
[QUOTE=Luni;52364908]but why[/QUOTE]
Obfuscation, what's with people's 5 second memories on here. Think outside of the box people. Locking thread.
People really don't think these days..
Sorry, you need to Log In to post a reply to this thread.