Arkathorn Posted November 27, 2015 Share Posted November 27, 2015 Does anyone know why the game arbitrarily messes up on certain texture assets, based only on their file names? Such assets will register successfully, but upon reference will throw this error:WARNING! Invalid resource handle for atlas '../path/to/asset.xml', did you remember to load the asset?Some file names will work, and some will not, independent of the content of the image. Link to comment https://forums.kleientertainment.com/forums/topic/59471-invalid-asset-names/ Share on other sites More sharing options...
Mobbstar Posted November 27, 2015 Share Posted November 27, 2015 I don't know what exactly you are talking about. How about an example? Link to comment https://forums.kleientertainment.com/forums/topic/59471-invalid-asset-names/#findComment-689032 Share on other sites More sharing options...
Arkathorn Posted November 28, 2015 Author Share Posted November 28, 2015 WARNING! Invalid resource handle for atlas '../mods/modname/images/ui/symbols/nosymbol.xml', did you remember to load the asset?../mods/modname/images/ui/symbols/nosymbol.xmlLUA ERROR stack traceback: C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/widgets/image.lua(30,1) in function 'SetTexture' C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/widgets/image.lua(11,1) in function '_ctor' C:/Program Files (x86)/Steam/steamapps/common/dont_starve/data/scripts/class.lua(98,1) in function 'Image'The traceback goes on, but that is the relevant bit. Other filenames I have previously encountered include:blbrbubdbutton_leftbutton_rightbutton_upbutton_downbuttonleftbuttonrightbuttonupbuttondownarrow_leftarrow_rightarrow_uparrow_downarrowleftarrowrightarrowuparrowdownleftrightupdown The list goes on... I have tried reinstalling both the Don't Starve Mod Tools and the game, as well as giving full access to any programs concerning the entire 'dont_starve' folder and all subdirectories. Nothing has fixed it. The content of the file is irrelevant, only the filename. Link to comment https://forums.kleientertainment.com/forums/topic/59471-invalid-asset-names/#findComment-689212 Share on other sites More sharing options...
Mobbstar Posted November 28, 2015 Share Posted November 28, 2015 Cannot reproduce.Assets = {Asset("IMAGE", "images/down.tex" ), --empty white square of 256x256Asset("ATLAS", "images/down.xml" ),}local Image = GLOBAL.require "widgets/image"AddGamePostInit(function()local x = Image("images/global.xml", "square.tex")x.inst:AddTag("NOCLICK")x:SetVRegPoint(GLOBAL.ANCHOR_MIDDLE)x:SetHRegPoint(GLOBAL.ANCHOR_MIDDLE)x:SetVAnchor(GLOBAL.ANCHOR_MIDDLE)x:SetHAnchor(GLOBAL.ANCHOR_MIDDLE)--x:SetScaleMode(GLOBAL.SCALEMODE_FILLSCREEN) --lol better not do thatend) I also tried the same folder structure. I'll try the same name, but only edit this post if it crashes. Link to comment https://forums.kleientertainment.com/forums/topic/59471-invalid-asset-names/#findComment-689218 Share on other sites More sharing options...
Arkathorn Posted November 28, 2015 Author Share Posted November 28, 2015 Yeah, I thought that it might be local. Well that's annoying...I'll keep messing around, and see if I can fix it. If I do, I'll post the fix. Link to comment https://forums.kleientertainment.com/forums/topic/59471-invalid-asset-names/#findComment-689221 Share on other sites More sharing options...
Arkathorn Posted November 29, 2015 Author Share Posted November 29, 2015 ...I feel really dumb now. I assumed that the assets were being successfully loaded in the first place, because it threw no error when loading, and I assumed that it was not my code's fault because I had encountered this issue before and (I thought) exhaustively checked all the possibilities, and because I had identical code in the same mod that worked, using a different asset. My mod uses a lot of UI assets, which need to be declared in the 'Assets' table in 'modmain.lua'. What I did was I made separate tables ('RecipeAssets', 'UIAssets', etc.) and added them to 'Assets' like this:Assets = { GLOBAL.unpack(RecipeAssets), GLOBAL.unpack(UIAssets), ...}Totally defeated, imagine my surprise when I arbitrarily decided to print the contents of 'Assets', and found only six tables (I had defined far more than three assets)! I then tested the 'unpack' function in the console.return unpack({1,2,3,4})Returns '1 2 3 4'.return unpack({unpack({1,2,3,4}),unpack({5,6,7,8})})Returns '1 5 6 7 8'. I have since replaced my use of 'GLOBAL.unpack' with 'for k,v' loops, and the issue is resolved. OMG THERE IS A NINJA WILSON AND A PIRATE WILSON AND A 12TH DOCTOR WILSON Link to comment https://forums.kleientertainment.com/forums/topic/59471-invalid-asset-names/#findComment-689402 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now