Facepunch / garrysmod-issues

Garry's Mod issue tracker
144 stars 56 forks source link

file library doesn't check addons data folder #4587

Open Ramalayha opened 4 years ago

Ramalayha commented 4 years ago

If you have a file path like "garrysmod/addons/my_addon/data/foobar.txt" then file.Find("foobar.txt", "DATA") won't return anything but file.Find("data/foobar.txt","GAME") will.

thegrb93 commented 4 years ago

Idk where the other is, but I'm pretty sure this is a duplicate issue

viral32111 commented 4 years ago

This is probably for the better though, so that when file.Find() is called with the DATA location, it doesn't have to recursively search through every workshop & legacy addon's data folders. I imagine on servers & clients where people have hundreds or even thousands of addons, this would have a noticible performance impact.

Edit: Never mind, misread.

ShadowBonnieRUS commented 4 years ago

https://wiki.facepunch.com/gmod/File_Search_Paths image It shouldn't return data from addons. Only garrysmod/data

thegrb93 commented 4 years ago

I think the goal here is to be able to publish things to workshop like "Advdupe2 vehicle pack" or "E2 script pack", but since the those addons read from DATA, it's impossible.

AppleVegas commented 4 years ago

I think the goal here is to be able to publish things to workshop like "Advdupe2 vehicle pack" or "E2 script pack", but since the those addons read from DATA, it's impossible.

It is possible by manually copying each file to data folder using lua

thegrb93 commented 4 years ago

Yea, that's the best solution probably.

ZenkakuHiragana commented 4 years ago

gmad.exe can't pack files in data folder, but I think it should be fixed for legacy addons.

robotboy655 commented 4 years ago

We probably don't want to fix this, because addons cannot edit files in addons/, and will not be allowed to do so, so fixing this would lead to uneditable files, and since addons take precedence over the root folder, "fixing" this would cause addon data files to always be found/read over the written files in the root data folder.