Hey Facepunch!
My question is, how i use AddCSLua and include to load files?
If there is others, how i use them too?
Is there difference, in autorun or client server?
If i update the code in loaded file, will it refresh? If not can i make concommand for it?
I feel stupid :( I know many stuff but not this.
-snip- that was an example of tired coding. Yes, its a thing.
AddCSLuaFile will actually just tell the client to download it. You'll still need to run include on the client after the AddCSLuaFile...
If you want something that automates includes, take a look at my dev-base and these tuts on making it "easier":
Includes across realms: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/loading_files_across_realms.lua.html[/url]
Includes across realms with helper-function which evolves to reduce repeats in code: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/loading_files_across_realms_simple.lua.html[/url]
Skeleton game-mode which uses a helper-function to include files in proper realm in shared file to prevent needing to add includes twice for shared and to ensure good load order: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/includes/gm_name.rar[/url]
Acecool Dev Base Skeletonized Base Game-Mode ( Never worry about Include or AddCSLuaFile ever again; comes with New Hooks, Console Commands, Meta-Table Objects, Helper Functions, Extended Functionality, and more! )
[url]https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_acecooldev_base_gamemode_info.lua.html[/url]
acecooldev_base Addon - All of the features above, but packaged as an addon. [ COMING SOON ]
Also, yes.. Autorun will run in the realm where you update the file as long as you're on Windows. If not, you'll need to create a console command which includes all your files ( in AcecoolDev_Base the concommand is loadgm at the bottom of the sh_init file. It basically calls the loader function which calls the autoloader for several base folders )...
-snip-
[QUOTE=Acecool;46700818]AddCSLuaFile will actually just tell the client to download it. You'll still need to run include on the client after the AddCSLuaFile...
If you want something that automates includes, take a look at my dev-base and these tuts on making it "easier":
Includes across realms: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/loading_files_across_realms.lua.html[/url]
Includes across realms with helper-function which evolves to reduce repeats in code: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/loading_files_across_realms_simple.lua.html[/url]
Skeleton game-mode which uses a helper-function to include files in proper realm in shared file to prevent needing to add includes twice for shared and to ensure good load order: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/includes/gm_name.rar[/url]
Acecool Dev Base Skeletonized Base Game-Mode ( Never worry about Include or AddCSLuaFile ever again; comes with New Hooks, Console Commands, Meta-Table Objects, Helper Functions, Extended Functionality, and more! )
[url]https://dl.dropboxusercontent.com/u/26074909/tutoring/___welcome_docs/_welcome_acecooldev_base_gamemode_info.lua.html[/url]
acecooldev_base Addon - All of the features above, but packaged as an addon. [ COMING SOON ]
Also, yes.. Autorun will run in the realm where you update the file as long as you're on Windows. If not, you'll need to create a console command which includes all your files ( in AcecoolDev_Base the concommand is loadgm at the bottom of the sh_init file. It basically calls the loader function which calls the autoloader for several base folders )...[/QUOTE]
Well, can i update somehow file which is included like for clientside scoreboard, it is just so annoying to go to my autorun file make --, save and then everything updates.
With my dev base you can save the file you updated. If you add a new file you need to type loadgm in console, then save the new file once.
Although, if you're running Windows, you should have no trouble auto-refreshing any file without re-saving the autorun file... If it is doing that with you, there may be a different problem. Feel free to add me on Steam and I'll see if I can help you.
[QUOTE=Acecool;46703496]With my dev base you can save the file you updated. If you add a new file you need to type loadgm in console, then save the new file once.
Although, if you're running Windows, you should have no trouble auto-refreshing any file without re-saving the autorun file... If it is doing that with you, there may be a different problem. Feel free to add me on Steam and I'll see if I can help you.[/QUOTE]
Added you. My name is EliteGalaxy in steam
Sorry, you need to Log In to post a reply to this thread.