DarkM Posted May 14 Share Posted May 14 Hello, this is my first time working with Spriter. When I try to place my item on the meat rack, it becomes invisible, and even after it dries, it remains invisible even when I try to generate dried meat that's already in the game. I've also tried adding an existing file to the code, but that didn't work either. Any clues or help on how to solve this problem would be greatly appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/171523-invisible-items-displayed-on-the-meat-rack/ Share on other sites More sharing options...
Bumber64 Posted Saturday at 01:39 AM Share Posted Saturday at 01:39 AM (edited) You could look at my leaf jerky mod, although that's more to modify an existing prefab (which happened to already have an unused animation). The important part should be something like this: local assets = { Asset("ANIM", "anim/rack_large_bird_meat.zip"), } and this: inst.components.dryable:SetBuildFile("rack_large_bird_meat") inst.components.dryable:SetDriedBuildFile("your_jerky_build_here") in your prefab. I'm also reasonably certain you don't need a separate anim file for the rack version? It's usually in with the same file that makes the raw meat visible when dropped on the ground. Edited Saturday at 02:05 AM by Bumber64 1 Link to comment https://forums.kleientertainment.com/forums/topic/171523-invisible-items-displayed-on-the-meat-rack/#findComment-1867141 Share on other sites More sharing options...
DarkM Posted Saturday at 04:44 AM Author Share Posted Saturday at 04:44 AM Thank you! I know your mod, I think it's very well done. I also think that two separate files aren't necessary too, but I haven't quite figured out how to do that yet. Is it just a matter of putting both images in the same folder before creating the project? Like: exported > large_bird_meat > large_bird_meat > then inside that folder, I put the default images and the one that will be displayed on the drying rack? Or does the first folder need a separate folder for each image? Link to comment https://forums.kleientertainment.com/forums/topic/171523-invisible-items-displayed-on-the-meat-rack/#findComment-1867146 Share on other sites More sharing options...
Bumber64 Posted Saturday at 10:00 PM Share Posted Saturday at 10:00 PM (edited) Like this (imagining it's raw meat): And the prefab has: inst.AnimState:SetBank("plantmeat_dried") inst.AnimState:SetBuild("plantmeat_dried") inst.AnimState:PlayAnimation("idle_dried_plant") inst.scrapbook_anim = "idle_dried_plant" I'm not entirely sure how it knows to use "dried_plant" for the rack animation. Perhaps it defaults to the first animation? Edited Saturday at 10:18 PM by Bumber64 Link to comment https://forums.kleientertainment.com/forums/topic/171523-invisible-items-displayed-on-the-meat-rack/#findComment-1867190 Share on other sites More sharing options...
DarkM Posted Monday at 03:03 AM Author Share Posted Monday at 03:03 AM I imagine there's still a lot of room for improvement, but the important thing is that I learned how to do it. Thank you very much for your help @Bumber64 ❤️ I'll leave some files here, maybe they'll help someone else too. local assets = { Asset("ANIM", "anim/large_bird_meat.zip"), } local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("large_bird_meat") inst.AnimState:SetBuild("large_bird_meat") inst.AnimState:PlayAnimation("idle") MakeInventoryFloatable(inst) inst:AddTag("dryable") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("inspectable") inst:AddComponent("inventoryitem") inst.components.inventoryitem.atlasname = "images/inventoryimages/large_bird_meat.xml" inst.components.inventoryitem.imagename = "large_bird_meat" inst:AddComponent("dryable") inst.components.dryable:SetProduct("meat_dried") inst.components.dryable:SetDryTime(TUNING.DRY_FAST) inst.components.dryable:SetBuildFile("large_bird_meat") inst.components.dryable:SetDriedBuildFile("meat_rack_food") MakeHauntableLaunch(inst) return inst end return Prefab("common/inventory/large_bird_meat", fn, assets) Link to comment https://forums.kleientertainment.com/forums/topic/171523-invisible-items-displayed-on-the-meat-rack/#findComment-1867263 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