Facepunch/garrysmod-requests

Add a lua binding to reload world materials

Opened this issue · 4 comments

Details

Currently, reloading world-based materials (e.g. on brushes) requires a client to receive the material and then reconnect, either manually or using the retry command. This is useful when a user lacks specific materials, such as with CS maps for users who don't own CS content and wouldn't see the correct textures. In these cases, we can provide our own materials (via steamworks.DownloadUGC and game.MountGMA) and have the client reload.

While this is currently possible with the retry command, the proposed changes with asset unloading (gmod_unload_test) would make this method ineffective. This would limit our ability to improve the player experience by shipping content effectively. Therefore, having some sort of binding to reload world materials would be useful and could enhance the average player's experience by not having to reload and having the potential to actually see the world (even if it is in a lower resolution / simplistic fashion).

mat_reloadmaterial ?

mat_reloadmaterial ?

Doesn't seem to function from the few ways I've tried it.

I've tried using mat_reloadallmaterials and mat_reloadtextures (with cheats enabled) which doesn't seem to have the intended effect either.

If you want a workshop addon to test against - https://steamcommunity.com/sharedfiles/filedetails/?id=2047014701

Well people are doing it somehow, perhaps ask on Discord?

So far from the discussions as we've both seen it seems to be suggested that the above doesn't work on world materials that aren't already present, although someone may have a solution but they don't seem to be willing to share it yet (or at all depending on their outcomes), so can this please be something which is looked at?

Alternatively if there is already a process that achieves what I'm after minus some sort of custom lua binding, I'm entirely happy to go down that path, however I'm at bit of a loss at this point as I've tried a number of times over the years, with the closest outcome being that I was able to replace all missing materials with the same material - but understandably this isn't exactly ideal.