Jump to content

Recommended Posts

Hi! So, as the title says I need some pointers for my item skin i'm trying to create. Right now I'm at the part of the tutorial that creates a ground texture, However my skin is invisible and won't show up. The option to select a skin does show up in the UI so I'm not sure what I did incorrectly. I've been stuck on this problem for a few weeks, so any help would be really appreciated!

image.png.8e358dd945c0ab5c4c31b2959ac4fa43.png

image.png.573a0e40912790044e0ae996e20ea402.png

Originaly I thought the problem might be with my animation file for the ground item; but i've renammed the texture a few times to ms_dark_scepter_roseate_ground and to dark_scepter_ground but neither has worked

Here are my modmain and skins file, if you need anything else from the mod let me know

modmain.luadark_scepter_skins.luadark_scepter.lua

If you don't want to share your entire mod, if you're willing to recreate a smaller version of your mod that can run that just has the item + the item's exported folder (.scml files included) with modded skins compatibility, I'm willing to sit down and try to figure out what the problem is. I can't do it from this amount of information unfortunately (I am an artist not a coder). I've briefly compared your files to another modded item on my computer and can't see what the problem is either.

One thing I would say is double check that your .scml files for your ground item have animations that are named the same thing. A tutorial might have used "idle" but your code in your item prefab says "anim". That's the only thing I spotted, but I don't have your .scml files so I can't check that for you. X)

  • Thanks 1

Okay, so I got it to show up in the equipt slot! But it is not appearing in the inventory icon or when droped on the ground. Here's the updated version of the test; hopefully you can spot where I went wrong. image.png.054606b61cfe8bdab434a0a0a3b98db0.png

Dark Septer Full moded skins (Not working).zip

I think there might be a issue with this line:

inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.imagename = "dark_scepter"
    inst.components.inventoryitem.atlasname = "images/inventoryimages/dark_scepter.xml"

It really would help If I had a example of a regular item with a skin on it; I'm really not sure what I'm doing wrong or if i'm missing something. I'm a beginner with LUA (I do know what functions are and how to make one) I just don't know what i'm looking at in the context of the skin API

If anyone is reading this I still need help figureing this out, I'm not really sure what the problem is. A example of a item or input with the test version of my mod would be really appreciated!

 

Dark Septer Full moded skins (Not working).zip

Oh I'm sorry, I haven't been getting your pings for some reason (maybe because you are a new user)??? I had no idea you were replying to me - I was even keeping an eye out for your thread and the thread looked like there were no replies from you on my end for days so I stopped checking!! I feel like I'm going crazy. I'm just replying now to let you know that I've seen it. I'll take a look.

EDIT: unfortunately it doesn't seem to be letting me download the attatched files.

image.png.2cf98742d6403a18a5f8296ad634cb61.png

Edited by Chesed

Alright, I got it to work this time. I can also confirm that for some reason the forum is not showing me that your thread is updating: I can only see my reply on the main page. >:C Sorry about that, but that explains a lot.

I'll take a look at your mod while I have time this evening and update you later.

  • Thanks 1

Okay! The inventory icon fix was easy: registering the inventory icon name and atlas in "dark_scepter.lua"'s main_function overwrites the modded skins' ability to change the inventory icon, so I've commented those parts of the code out for you and put a RegisterInventoryItemAtlas in your modmain instead.

Fixing the ground icon has been a bit more convoluted but I got it to work hahaha.

It turns out you missed a step in the tutorial - adding the "GLOBAL.dark_scepter_init_fn " to your modmain. However, this function doesn't actually work with items that use more than one build. I had to go hunting in the thread to find someone else with the same problem and after fiddling around with the code Hornette gave them I think I got it to work.

I put a comment next to every significant thing I changed  I also did some minor things like adding your roseate files to your dark_scepter.lua's Assets table but honestly I don't even know if that did anything I was just desperately trying everything I could think of.

Hopefully this provides you with the foundation you need to get it working on your end too. Please let me know if I missed anything. I'm extremely forgetful so I'm very sorry if I forgot to write down a step that I did, as well.

(The changes are in modmain.lua, and dark_scepter.lua. I think I changed the tag in "dark_scepter_skins.lua" but I don't believe that did anything.)

Dark Septer Full moded skins (Working).zip

Edited by Chesed

Can confirm it definitely works! Just added it to my current version which has durability and you fuel it with nightmare fuel. Adding it to a non-equiptable item would just be the same but without the on equpit function?

 

It depends: does your non-equippable item also have a "item" and "item_ground" build? If it does, the code in your modmain for the "dark_scepter" that I added can be reused. (I am assuming since you can't equip it it doesn't but, hey, I don't know!)

If your non-equippable item does not have an "item" and "item_ground", and only has an "item" build, you need to put this instead:

Quote


GLOBAL.exampleitem_init_fn = function(inst, build_name)
    GLOBAL.basic_init_fn( inst, build_name, "exampleitem" )
end

GLOBAL.exampleitem_clear_fn = function(inst)
    GLOBAL.basic_clear_fn(inst, "exampleitem" )
end

Replace all instances of "exampleitem" with your item's prefab name.

Other than that I believe you're right? I haven't actually made an item skin for a non-equippable item before! X)

Edited by Chesed

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
×
  • Create New...