Jump to content

Well I thought renaming a prefab would work...


Recommended Posts

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.

 

HaEGR0J.jpg

knifethrow.lua

Link to comment
Share on other sites

@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 by rezecib
Link to comment
Share on other sites

 

@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:

 

5m5E2sf.jpg

Link to comment
Share on other sites

@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 by rezecib
Link to comment
Share on other sites

@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
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...