1. Post #1
    r 1
    r 1's Avatar
    January 2012
    92 Posts
    I've had issues with uploading an add-on to the Workshop. I've made a previous post about this, but I don't think I made things clear. This might be my own misunderstanding of Workshop add-ons; if that's the case, I'd like some clarification.

    The add-on appears to work perfectly fine if I put it directly into the garrysmodbeta folder. However, it doesn't if I upload then download it from the Workshop. It errors out related to the following code:

    Code:
    	local list = file.Find("mprime_themes/*.lua",LUA_PATH)
    	for _,fil in pairs(list) do
    		print(fil,"mprime_themes/"..fil);
    		local f=file.Open("mprime_themes/"..fil,'rb',LUA_PATH)
    		if f ~= nil then
    			RunString('function THEME_FUNCTION()\nreturn {\n'..f:ReadString(f:Size())..'\n};\nend')
    			--RunString('function a()\nreturn {\n'..file.Read("autorun/client/mprime_themes/"..fil,LUA_PATH)..'\n};\nend')
    			themes[string.sub(fil,0,string.find(fil,".lua")-1)]=THEME_FUNCTION();
    			Msg('MPHUD: mounted \''..string.sub(fil,0,string.find(fil,".lua")-1)..'\' successfully\n')
    			f:Close()
    		end
    	end
    The folders exist and the filenames are read perfectly fine, but the "if f ~= nil" line doesn't appear to ever be true when using this from Workshop. I'm not completely sure why, but the reasons could be a lack of file access permissions.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  2. Post #2
    r 1
    r 1's Avatar
    January 2012
    92 Posts
    It has kind of been a month, and no response - this needs to be read. Bump.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  3. Post #3

    January 2010
    104 Posts
    well if you are doing a text file then do it in the data folder. That works for me.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  4. Post #4
    r 1
    r 1's Avatar
    January 2012
    92 Posts
    well if you are doing a text file then do it in the data folder. That works for me.
    They're .lua files.
    Reply With Quote Edit / Delete Windows 7 United States Show Events