• Script Auto Refresh is not working, possible causes?
    9 replies, posted
Title thread says it all. Whatever I do, I can't get auto refresh to work properly for some reason anymore. This is really quite a let down, since at certain times it's very useful to have around. -disableluarefresh is not in the command line and I am entirely confused. I'm trying to reinstall gmod meanwhile, but nonetheless, does anyone have any clue what may be the cause? Even scripts in autorun/ and those included from autorun files won't get refresh. Is it possible that I'm doing something wrong? This is really weird, since it used to work before.
linux, mac or windows?
First cause it's being a linux user
Second cause modifying base entities or using symlinks.
If you're not running Windows you'll need to create your own auto-refresh system in Lua ( basically put all of your include/AddCSLuaFile calls in one file and put them in a function... After the function is defined call the function and add a console command too to execute the function; then you just run the console command to execute ) Example [code]function IncludeGamemodeFiles( ) // SHARED FILES FIRST -- .. -- .. -- .. // CLIENT / SERVER FILES NEXT if ( SERVER ) then -- .. -- .. -- .. else -- .. -- .. -- .. end // ADDONS NEXT -- .. -- .. -- .. // CONTENT NEXT -- .. -- .. -- .. end IncludeGamemodeFiles( ); concommand.Add( "loadgm", IncludeGamemodeFiles );[/code] If you modify an entity with auto-refresh enabled, then you need to spawn a new copy of the entity to see the new code ( weapons, npcs, etc... ) unless you redirect all code to a non ENT: / SWEP: / etc... function call inside those functions.. Example: [code]function ENT:Blah( ... ) MyFunction( ... ); end[/code] Although that isn't recommended unless you want a different way to debug code ( not needing to respawn the ent to test new code, although autorefreshing entities is quicker that autorefreshing the entire game-mode .. less files .. ) If you're writing your own game-mode and you don't want to deal with include/AddCSLuaFile commands ever again, take a look at my dev-base. It has an autoloader which adjusts the realm the files will be loaded in based on the folder and lastly by the file-name. Folders can be client/ shared/ or server/ and they'll update realm ( with unlimited nested folder support so you can have a client folder that also has a server folder in it and it'll update properly ), and files support various prefixes and postfixes to update the realm for that particular file. Link to links: 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]
I am running windows, so it's weird it's not working. Thanks for the cool tips tho, ace.
The entity ones aren't too obvious and trips people up when something newly added isn't "working". Now, you're on Windows, but are you running an SRCDS? If not, a local dedicated server is much better to test code than by starting one via the client ( whereby listen-servers execute both client and server code which causes some issues in itself ): [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_a_server_with_steamcmd.lua.html[/url] Show us your server autoexec.cfg, server.cfg, etc... Make sure no auto-refresh vars are in any of the configs. There used to be a convar that could be changed.. not quite sure what happened with that, but if it was set as disabled then maybe it cached it somewhere?? Not sure.
[QUOTE=Acecool;46374883]The entity ones aren't too obvious and trips people up when something newly added isn't "working". Now, you're on Windows, but are you running an SRCDS? If not, a local dedicated server is much better to test code than by starting one via the client ( whereby listen-servers execute both client and server code which causes some issues in itself ): [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/server_srcds_steamcmd/setting_up_a_server_with_steamcmd.lua.html[/url] Show us your server autoexec.cfg, server.cfg, etc... Make sure no auto-refresh vars are in any of the configs. There used to be a convar that could be changed.. not quite sure what happened with that, but if it was set as disabled then maybe it cached it somewhere?? Not sure.[/QUOTE] No clue... The old autorefresh convar is gone, though. It's been replaced by -disableluarefresh cmd line option. I'm running a listen server and it doesn't refresh even the simplest scripts. I'll post the cfg files later, though it doesn't seem like anything is there. I'll try running from a SRCDS later as well, when I get home
[QUOTE=typedef state;46375250]No clue... The old autorefresh convar is gone, though. It's been replaced by -disableluarefresh cmd line option. I'm running a listen server and it doesn't refresh even the simplest scripts. I'll post the cfg files later, though it doesn't seem like anything is there. I'll try running from a SRCDS later as well, when I get home[/QUOTE] Check your console for any auto refresh messages. Tell us which files are you trying to edit. ( File paths, are the entity files? etc)
[QUOTE=Robotboy655;46375457]Check your console for any auto refresh messages. Tell us which files are you trying to edit. ( File paths, are the entity files? etc)[/QUOTE] There's nothing in the console so far, except for generic guff that's always there. I tried creating a simple script in lua/autorun that prints a few strings and defines a function. When I edit it, it doesn't get refreshed whatsoever. No errors, no messages, no nothing. The function that is defined in it stays the same. And the config files are void of anything referencing lua or autorefresh. [editline]1st November 2014[/editline] Alright, I managed to pin down the culprit. Apparently this is caused by the fact that GMod isn't installed into the default Steam library (where the rest of Steam resides), but rather on a different drive. So in my case, Steam was installed in C:/Program Files (x86)/Steam/ And GMod was installed in D:/steamlib/SteamApps/common/Garry's Mod/ C being an SSD and my system drive, and D being a classic HDD with everything else When GMod was installed on a non-default Steam library, it wasn't being refreshed, but when I moved it to the default Steam library, autorefresh started working. Weird bug.
Sorry, you need to Log In to post a reply to this thread.