rons0n Posted January 22, 2015 Share Posted January 22, 2015 Well I was clearly wrong.I'm trying to make my custom weapon work like a boomerang so i just decided to take the boomerang prefab and put it within the mod. I did a quick renaming process but made sure to change the boomerang PlaySound back to boomerang_return since i don't have a custom playsound. Provided is the error i received and the file. Perhaps i'm doing this completely wrong haha. knifethrow.lua Link to comment https://forums.kleientertainment.com/forums/topic/49580-well-i-thought-renaming-a-prefab-would-work/ Share on other sites More sharing options...
rezecib Posted January 22, 2015 Share Posted January 22, 2015 (edited) @rons0n, It's probably looking for a knifethrow.tex inside inventoryimages.xml. Look at other custom items and see how they set their custom art-- should be something like this:inst.components.inventoryitem.imagename = "boomerang"inst.components.inventoryitem.atlasname = "images/inventoryimages.xml" Edited January 22, 2015 by rezecib Link to comment https://forums.kleientertainment.com/forums/topic/49580-well-i-thought-renaming-a-prefab-would-work/#findComment-604958 Share on other sites More sharing options...
rons0n Posted January 22, 2015 Author Share Posted January 22, 2015 @rons0n, It's probably looking for a knifethrow.tex inside inventoryimages.xml. Look at other custom items and see how they set their custom art-- should be something like this:inst.components.inventoryitem.imagename = "boomerang"inst.components.inventoryitem.atlasname = "images/inventoryimages.xml" Hi there rez!I see. So what I did was check how another modder placed his custom art and i found:inst:AddComponent("inventoryitem")inst.components.inventoryitem.atlasname = "images/inventoryimages/whatever.xml"So what i did was go into my inventory images checked if the xml and tex file were there and they were.Afterwards I looked at the line that had inst:AddComponent("inventoryitem") and then put below it:inst:AddComponent("inventoryitem")inst.components.inventoryitem:SetOnDroppedFn(OnDropped)inst.components.inventoryitem.imagename = "knifethrow" inst.components.inventoryitem.atlasname = "images/inventoryimages/knifethrow.xml"I still managed to get this error: Link to comment https://forums.kleientertainment.com/forums/topic/49580-well-i-thought-renaming-a-prefab-would-work/#findComment-604965 Share on other sites More sharing options...
rezecib Posted January 22, 2015 Share Posted January 22, 2015 (edited) @rons0n, and knifethrow.xml has a reference to knifethrow.tex? Are you loading the tex and xml in the assets table at the top? Edit: Oops, didn't see you provided the file. It looks like that's your problem-- you need to be loading the tex and xml in the assets table in your prefab. Edited January 22, 2015 by rezecib Link to comment https://forums.kleientertainment.com/forums/topic/49580-well-i-thought-renaming-a-prefab-would-work/#findComment-604971 Share on other sites More sharing options...
rons0n Posted January 23, 2015 Author Share Posted January 23, 2015 @rons0n, and knifethrow.xml has a reference to knifethrow.tex? Are you loading the tex and xml in the assets table at the top? Edit: Oops, didn't see you provided the file. It looks like that's your problem-- you need to be loading the tex and xml in the assets table in your prefab. Oh man how did i miss that?Everything works now!Knife isnt spinning but thats something im pretty sure i can solve myself. Much appreciated! I'll be on my way! Link to comment https://forums.kleientertainment.com/forums/topic/49580-well-i-thought-renaming-a-prefab-would-work/#findComment-605001 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