• A quick question regarding how lua files load
    3 replies, posted
No idea how I could word this better so sorry if this is a bit confusing. Example: garrysmod/gamemodes/sandbox/lua/myfile.lua The file above creates a red derma panel when a player joins the server We are currently using a gamemode called simplerp derrived from sandbox I create a file called: garrysmod/gamemodes/simplerp/lua/myfile.lua This file creates a blue derma panel when a player joins the server Which derma panel will load?
None since none of them is in autorun If both ARE in autorun both will load Its really not that hard to think of..
I'm no expert, but I believe the red derma panel will load, then the blue one. My thought process is that since the gamemode is derived from sandbox, it'll load the sandbox file then the gamemode's file. Correct me if I'm wrong though...
Whichever one happened to load after. What I suggest is that after lua you place another folder that uses the same name as your addon/gamemode. So: gamemode_name/lua/gamemode_name/all_your_files_and_folders so that you don't have to keep them unique outside of autorun. The problem is(based on some tests) is that when gmod loads lua folders, it takes them all and combined them so you have to keep the files unique, so by adding an additional "identifier" to the file path, you avoid that.
Sorry, you need to Log In to post a reply to this thread.