Hello,
Recently, I reinstalled my steam on my faster hard drive, and now all of a sudden none of my lua autorefreshes. I have a print in hudpaint that currently prints "b". it prints b to the console. when I change it to print "a", nothing happens, until i restart game (yes, i'm using 2 player local server)
What's happening???
What operating system are you running?
Windows 8.1 x64
Which text editor are you using?
Sublime text 3.
There is a special mode it uses when editing which saves the file to a temp area, then copies the file over to overwrite the file that was changed. It has been found to cause issues.
I'd recommend writing an autoloader where you can type "loadgm" in console to force auto-refresh, disable the special save-mode, or change editors.
Here's the info on my dev-base I'm adding to:
If you want something to make development easier use this: [url]https://bitbucket.org/Acecool/acecooldev_base/src/[/url]
rename the folder, the txt file, and the name at the top of the txt file in quotes. Then, drag and drop files.
You can create the folder structure by typing install in console; or download and extract this in the gm folder: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_redistributable/acecooldev_base_folder_struct.rar[/url]
Folder structure: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_redistributable/acecooldev_base/documentation/folder_structure_and_how_to_use_it.txt[/url]
File loading options: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_redistributable/acecooldev_base/documentation/file_recursive_inclusions.txt[/url]
Basically, client/ server/ and shared/ folders update the realm state in the recursive loading function meaning when one of those folders is opened, they will load in the relevant realm unless the filename contains information telling it to load into a different realm or not at all ( x_*.lua, _x_*.lua and _x.lua )..
maps/ folders load maps/<map_name>/* on OnReloaded and InitPostEntity so that if you spawn entities, it won't change the EntIndex value of map entities so that a hash-map can be used to remove existing entities with this: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/entities/entity_getid_mapping_system.lua.html[/url]
This is my game-mode and how files are loaded: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_file_structure/files_order.txt[/url]
Take note as to what was said above and look at files changing the realm they're loaded in on the fly in a shared/ folder.
[code][32] = [SHARED] :: gamemode/shared/classes/elevator/_sh_elevator.lua
[33] = [CLIENT] :: gamemode/shared/classes/elevator/cl_elevator.lua
[34] = [SERVER] :: gamemode/shared/classes/elevator/sv_elevator.lua
[35] = [SHARED] :: gamemode/shared/classes/jobs/_class_jobs.lua
[36] = [SERVER] :: gamemode/shared/classes/jobs/_sv_class_jobs.lua
[37] = [SHARED] :: gamemode/shared/classes/networking/_sh_networking.lua
[38] = [CLIENT] :: gamemode/shared/classes/networking/cl_networking.lua
[39] = [SERVER] :: gamemode/shared/classes/networking/sv_networking.lua
[40] = [SHARED] :: gamemode/shared/classes/npc/_sh_npc.lua
[41] = [CLIENT] :: gamemode/shared/classes/npc/cl_npc.lua
[42] = [SERVER] :: gamemode/shared/classes/npc/sv_npc.lua
[43] = [SHARED] :: gamemode/shared/classes/class_bullets.lua
[44] = [SHARED] :: gamemode/shared/classes/class_card.lua
[45] = [SHARED] :: gamemode/shared/classes/class_cards.lua[/code]
It just makes it easier to group like files together and load it into a specific realm.
Unlimited folder nesting is supported.. It is as easy and dragging and dropping files into folders.
Also, you can disable auto-refresh with the autoloader; just type loadgm to refresh the game-mode. If you add a new file, type loadgm and save the new file once to have it detected ( with autorefresh on ). It works in Linux too, without autorefresh! I'll be adding a lot of things to the bitbucket such as helper-functions, wrappers, metatable objects / "classes", etc... Basically, it makes it easy to make a new game-mode by providing a lot of the building blocks, or with the simple system ( just using the auto-loader ) to make file-loading easy without having to mess with AddCSLuaFile or include functions.
Odd. The problem exists within Sublime, i'm gonna attempt a reinstall of it.
There's a feature with Sublime that doesn't play well with GMods autorefresh. I don't remember what it is exactly, something to do with saving files.
I reinstalled, didn't really help. I guess i'll have to stick with notepad++ for now though, but I like sublime more :/
[QUOTE=sackcreator54;45583979]I reinstalled, didn't really help. I guess i'll have to stick with notepad++ for now though, but I like sublime more :/[/QUOTE]
I've experienced similar issues with st3, even with atomic save turned off. I've installed gmod on another hdd as well. Upon save (where it should reload) it doesn't really say anything in the client console (cs files) but it seems to produce a permission issue error in my server console. Np++ works fine though.
ms333 may be right, the name eluded me but it may be the "atomic" saving.... It is the system that saves to a temp file, then overwrites the original ( as said above )... If you turn that off, Sub should work fine.
The GM thing I was referring to was this: [url]https://bitbucket.org/Acecool/acecooldev_base/src/809f306f2c2d444b89361f1b99909e0c1c3f5ea1/gamemode/sh_init.lua?at=master[/url]
namely ( where loader:LoadGameMode( ) is the function which runs through all includes ):
[code]//
// Fake Auto-Refresh to get by the annoyance of saving multiple files for new files to show up...
//
if ( SERVER ) then
concommand.Add( "loadgm", function( _p, _cmd, _args )
// Make sure Player is NULL or IsSuperAdmin, otherwise STOP. NULL player is RCON user...
if ( _p != NULL && !_p:IsSuperAdmin( ) ) then return; end
// Server-Side refresh
GM = GAMEMODE;
loader:LoadGameMode( );
hook.Call( "OnReloaded", GAMEMODE );
// Client-Side refresh
BroadcastLua( "GM = GAMEMODE; loader:LoadGameMode( ); hook.Call( \"OnReloaded\", GAMEMODE );" );
end );
end[/code]
It works well for me.
[url]https://dl.dropboxusercontent.com/u/26074909/_dev_tools/notepadpp_highlighting/installing_gmod_lua_text_highlighting.lua.html[/url]
Robot may have a newer one, this is my version:
[url]https://dl.dropboxusercontent.com/u/26074909/_dev_tools/notepadpp_highlighting/GmodLua.xml[/url]
If you want other nice features, replace these in the %appdata%\notepad++ config or plugin dir:
This adds DarkRP wiki search, Old and new Garry's Mod Wiki search, and a macro called Trim trailing and save ( removes blank space at end of line and saves file; super useful )
[url]https://dl.dropboxusercontent.com/u/26074909/_dev_tools/shortcuts.xml[/url]
This edits to add default Lua syntax highlighting built-in
[url]https://dl.dropboxusercontent.com/u/26074909/_dev_tools/functionList.xml[/url]
This changes the right-click menu to be useful ( for my purpose, but it is easy to change )..
[url]https://dl.dropboxusercontent.com/u/26074909/_dev_tools/contextMenu.xml[/url]
> denotes sub-menu / menu open with tab-indent to show contents and de-dent to go back to parent
[code]Right click >
Save [ Trim Trailing ]
Export to HTML
--------------------
Reload File
Open Current Files' Folder
--------------------
Garry's Mod Wiki Search
Garry's Mod Old Wiki Search
Garry's Mod DarkRP Wiki Search
Search Google
--------------------
Edit >
Cut
Copy
Paste
Delete
--------------------
Select ALL
--------------------
UPPERCASE
lowercase
--------------------
Hide Lines
--------------------
Text Highlighting >
Clear All Styles
--------------------
Using 1st Style
Using 2nd Style
Using 3rd Style
Using 4th Style
Using 5th Style
--------------------
Clear 1st Style
Clear 2nd Style
Clear 3rd Style
Clear 4th Style
Clear 5th Style
--------------------
Plugin Commands >
Open Color Picker
--------------------
Base64 Encode
Base64 Decode
--------------------
ASCII -> HEX
HEX -> ASCII
--------------------
Open Plugin Manager
--------------------
[/code]
[QUOTE=Acecool;45584222]:words:[/QUOTE]
So.. Acecooldev_Base ... serious :l? You should have called it "Bacecool" or something. Also whats with the copyright?
[quote]
Acecool Company: AcecoolDev Base for Garry's Mod
* Josh 'Acecool' Moser :: CEO & Sole Proprietor of Acecool Company
* Skeleton++ Game-Mode with many useful helper-functions and algorithms
*
* Copyright Š 2001-2014 Acecool Company in Name & Josh 'Acecool' Moser
* as Intellectual Property Rights Owner & Sole Proprietor of Acecool Company in name.
*
* RELEASED Under the ACL ( Acecool Company License )
[/quote]
Not sure about the USA, but in Australia you have to pay for copyright and trademarks, so if thats the case in America, then your copyright means nothing. Oh god :l Your Bitbucket name is "Josh 'Acecool' Moser" D:
I own my own company, and copyright is automatic. You don't need to "pay" for a copyright because a copyright exists on any work you create as soon as it is created. The only thing that needs to be done is to have proof of copyright for legal proceedings. Proof can be you mailing yourself a copy of the work and never opening it, registering the copyright ( which does cost, but it isn't required for a copyright to exist ), etc...
An example of what I was talking about the issue I have at least. I don't know if it's the same case for the OP. Upon saving an edited file, this happens (path is the edited file):
[IMG]http://i.imgur.com/vwaniMO.png[/IMG]
[editline]4th August 2014[/editline]
Atomic save is off.
Is the file by chance empty? Empty files typically return "file not found" errors.
Automatic loading for addons works like this where no include / AddCSLuaFile is required:
addons/<addon_name>/lua/autorun/ -- is shared
addons/<addon_name>/lua/autorun/server/ -- is serverside
addons/<addon_name>/lua/autorun/client/ -- is clientside
garrysmod/lua/autorun/ -- is shared
garrysmod/lua/autorun/server/ -- is serverside
garrysmod/lua/autorun/client/ -- is clientside
Anything outside of those needs to be included / AddCSLuaFile'd from a file in one of those directories; is it being included ( it should be since it is showing, but improperly included files may show that error... Make sure AddCSLuaFile is called BEFORE include if it is shared / client file )?
It is loaded correctly (and working). The files are not empty, it happens with all files I edit with ST3. Works fine with np++. The issue occur upon file save. Meaning I have to restart every time I make a change..
That is odd. To avoid reloading use the loadgm command I posted above. Except put your loader into it ( the thing that loads all your gm files )..
If you're creating VGUI, use this: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_utilities/concommand_clearvgui.lua[/url]
Make sure when you call you recreate because clearvgui will delete all vgui elements ( unless bound to HUD, that is still broken if I recall correctly )..
If you make your own spoofed auto-refresh then you shouldn't have any issue; you'd just need to type a command in console each time.
Sorry, you need to Log In to post a reply to this thread.