Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify gmod of file change #1

Open
UltraBlackLinux opened this issue May 15, 2022 · 5 comments
Open

Notify gmod of file change #1

UltraBlackLinux opened this issue May 15, 2022 · 5 comments

Comments

@UltraBlackLinux
Copy link

Hey there,
It turns out, that gmod can load lua files, that changed by observing the filesystem events, in this case the save-file event (no clue, how it's called)

I would be really pleased, if this addon could somehow call that event, so gmod recognizes the change and doesn't force me to always reload the map when I make changes ;)
Thanks!

@BadgerCode
Copy link
Owner

Hey!
Yeah I've always wanted changes made to my projects to automatically refresh/update in-game.

The way I've gotten this to work is using symbolic links (../garrysmod/addons/myaddon -> ../My Projects/gmod/myaddon).
This allows me to keep my projects in a more convenient location, while also having the files available to garry's mod.

But this isn't very user friendly and it's quite manual.

I would like to make this VS Code extension take care of this.
I've considered a few approaches (synchronising files, symbolic links, publish button, ...) but I need to spend some time actually trying something out.

@UltraBlackLinux
Copy link
Author

@BadgerCode Yeah I attempted that too, but I was somewhat unsuccessful at linking that. I might try again, but ln just created an invalid link file. Might be related to the fact that it's on a different drive...

@BadgerCode
Copy link
Owner

Here's an example of making a symbolic link on PC in command prompt

mklink /J "C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\addons\myaddon" "C:\Users\mike-\Documents\Projects\gmod\myaddon"

This should work for other drives too

@UltraBlackLinux
Copy link
Author

Here's an example of making a symbolic link on PC in command prompt

mklink /J "C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\addons\myaddon" "C:\Users\mike-\Documents\Projects\gmod\myaddon"

This should work for other drives too

I got it to work in the end, and btw, I am on Linux ;)
Seems like I just managed to mess it up the first time, I have no clue how

@BadgerCode
Copy link
Owner

Yeah it's easy enough to mess up making a symbolic link.
More reason why this extension should take care of it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants