General > Developers Corner
file.Read
bender180:
Sorry that this isnt ulx/ulib related not sure what the rule on that is but ive been trying to convert a gmod 12 addon to work with 13 ive been using this guide https://docs.google.com/document/d/1khSuIYrAMkqXu7wlH5YRJNwz6hOH6Xqi5lqBhE3x6gA and i cant figure out why this
--- Code: ---local HoverboardTypes = util.KeyValuesToTable(file.Read("hoverboard/hoverboards.txt", "DATA"))
--- End code ---
is returning this
--- Code: ---[ERROR] addons/hoverboard/lua/weapons/gmod_tool/stools/hoverboard.lua:9: bad argument #1 to 'KeyValuesToTable' (string expected, got no value)
--- End code ---
Im just using file.Read for the first time so sorry if its something stupid.
MrPresident:
does garrysmod/data/hoverboard/hoverboards.txt exist?
If it does, does it have anything in it?
Megiddo:
Does the file exist in data/hoverboard/hoverboards.txt? Does it have content?
Or so I was going to say, before Mr. P beat me to the punch. Guess that's the trouble of leaving tabs open for a while. I'm glad that Mr. P and I agree completely on how to debug the issue, though. :P
bender180:
the file is in the addon folder so \garrysmod\garrysmod\addons\hoverboard\data\hoverboard\hoverboards.txt i havent check the contents of that file yet so it might be the file isnt compatible with 13.
MrPresident:
Move the file out of the addons folder into the raw data folder.
I think garry still hasn't fixed his issues with file.Read not reading from the addons folder completely yet.
Navigation
[0] Message Index
[#] Next page
Go to full version