RedTarantula Posted March 7, 2018 Share Posted March 7, 2018 So! Nearly everything on my mod is working correctly. For the last thing, I created a "cave spider egg sack" prefab that works just like the regular spider egg sack but spawns a Spider Hole instead of a Den once deployed. It works as it's meant to work, it's spawning the Spider Hole, but I'm having a few issues. 1- The graphics are mostly working. However, it's invisible when on the ground and also the "positioning ghost" for when the player is about to deploy it doesn't show up either. I edited the Spider Hole's graphics to make it on the size of an inventory item and I would like basically the same thing for when it's on the ground or being deployed. 2- When the player deploys it, they're pushed backward. This is probably due to the structure's size x deploying size(?). I don't know if there's a way of fixing this. Link to comment https://forums.kleientertainment.com/forums/topic/88387-prefab-graphics-bug-help/ Share on other sites More sharing options...
RedTarantula Posted March 8, 2018 Author Share Posted March 8, 2018 Bump Link to comment https://forums.kleientertainment.com/forums/topic/88387-prefab-graphics-bug-help/#findComment-1012242 Share on other sites More sharing options...
pickleplayer Posted March 8, 2018 Share Posted March 8, 2018 it's probably something wrong with the build or bank of the inventory item, but we'll need more information about that to know. As for the physics size pushing them back, you might be able to change its physical size (without changing the size of the sprite) with inst.Physics:SetCapsule(x, y) with x being the diameter and y being height Link to comment https://forums.kleientertainment.com/forums/topic/88387-prefab-graphics-bug-help/#findComment-1012700 Share on other sites More sharing options...
RedTarantula Posted March 9, 2018 Author Share Posted March 9, 2018 I based the prefab off the game's normal egg sack. Spoiler require "prefabutil" local Assets = { Asset("ANIM", "anim/cave_spider_egg_sack.zip"), Asset("ATLAS", "images/inventoryimages/cave_spider_egg_sack.xml"), } local prefabs = { "spiderhole", } local function ondeploy(inst, pt) inst.SoundEmitter:PlaySound("dontstarve/creatures/spider/spider_egg_sack") local tree = SpawnPrefab("spiderhole") if tree ~= nil then tree.Transform:SetPosition(pt:Get()) inst.components.stackable:Get():Remove() end end local function onpickup(inst) inst.SoundEmitter:PlaySound("dontstarve/creatures/spider/spider_egg_sack") end local function fn() local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("cave_spider_egg_sack") inst.AnimState:SetBuild("cave_spider_egg_sack") inst.AnimState:PlayAnimation("idle_90s") inst:AddTag("cattoy") inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end inst:AddComponent("stackable") inst.components.stackable.maxsize = TUNING.STACK_SIZE_LARGEITEM inst:AddComponent("inspectable") inst:AddComponent("fuel") inst.components.fuel.fuelvalue = TUNING.LARGE_FUEL MakeSmallBurnable(inst, TUNING.LARGE_BURNTIME) MakeSmallPropagator(inst) MakeHauntableLaunchAndIgnite(inst) inst:AddComponent("inventoryitem") inst:AddComponent("tradable") inst.components.inventoryitem.atlasname = "images/inventoryimages/cave_spider_egg_sack.xml" inst.components.inventoryitem:SetOnPickupFn(onpickup) inst:AddComponent("deployable") --inst.components.deployable:SetDeployMode(DEPLOYMODE.ANYWHERE) inst.components.deployable:SetDeploySpacing(DEPLOYSPACING.NONE) inst.components.deployable.ondeploy = ondeploy return inst end return Prefab( "cave_spider_egg_sack", fn, Assets), MakePlacer("cave_spider_egg_sack_placer", "spider_mound", "spider_mound", "spider_mound") This here is the scml, I don't really know how to deal with these files so I also based it off an existing mod. Spoiler <?xml version="1.0" encoding="UTF-8"?> <spriter_data scml_version="1.0" generator="BrashMonkey Spriter" generator_version="b5"> <folder id="0" name="spider_egg_sac01"> <file id="0" name="spider_egg_sac01/spider_egg_sac01-0.png" width="344" height="212" pivot_x="0.493313" pivot_y="0.366158" /> </folder> <entity id="0" name="spider_egg_sac"> <animation id="0" name="idle_90s" length="34"> <mainline> <key id="0" time="0"> <object_ref id="0" name="spider_egg_sac01" abs_x="0" abs_y="0" abs_pivot_x="0.493313" abs_pivot_y="0.366158" abs_angle="0" abs_scale_x="1" abs_scale_y="1" abs_a="1" timeline="0" key="0" z_index="1" /> </key> <key id="1" time="34"> <object_ref id="0" name="spider_egg_sac01" abs_x="0" abs_y="0" abs_pivot_x="0.493313" abs_pivot_y="0.366158" abs_angle="0" abs_scale_x="1" abs_scale_y="1" abs_a="1" timeline="0" key="1" z_index="1" /> </key> </mainline> <timeline id="0" name="spider_egg_sac01"> <key id="0" time="0" spin="1"> <object folder="0" file="0" x="0" y="-0" scale_x="1" scale_y="1" angle="0" /> </key> <key id="1" time="34" spin="1"> <object folder="0" file="0" x="0" y="-0" scale_x="1" scale_y="1" angle="0" /> </key> </timeline> </animation> </entity> </spriter_data> I used the game's egg sack image for now just until I make it work, then I'll work on a graphic for it myself. I'm attaching everything that has to do with the prefab. That's not the entire mod, so I did not include modmain or modinfo or whatever else the mod contains, which I judged to be irrelevant for this. I can post the whole thing if needed. Thanks in advance! Cave Spider Egg Sack.rar Link to comment https://forums.kleientertainment.com/forums/topic/88387-prefab-graphics-bug-help/#findComment-1012755 Share on other sites More sharing options...
Aquaterion Posted March 9, 2018 Share Posted March 9, 2018 it should be idle not idle_90s, even if its called like that in spriter, pretty sure Link to comment https://forums.kleientertainment.com/forums/topic/88387-prefab-graphics-bug-help/#findComment-1012802 Share on other sites More sharing options...
RedTarantula Posted March 9, 2018 Author Share Posted March 9, 2018 Ive tried that. Doesn't work either Link to comment https://forums.kleientertainment.com/forums/topic/88387-prefab-graphics-bug-help/#findComment-1012893 Share on other sites More sharing options...
Aquaterion Posted March 9, 2018 Share Posted March 9, 2018 Try changing the entity name in spriter to "cave_spider_egg_sack" while also doing PlayAnimation("idle") in code Link to comment https://forums.kleientertainment.com/forums/topic/88387-prefab-graphics-bug-help/#findComment-1013005 Share on other sites More sharing options...
RedTarantula Posted March 10, 2018 Author Share Posted March 10, 2018 (edited) It worked for the item on the ground, but not for the "placer", like when you're gonna place the normal egg sack as in the picture I attached to this post. Regardless that already helped me a lot! Thank you so much! For anyone who might see this in the future, my problem was with naming things correctly in Spriter. I knew it was something dumb. I haven't really messed around with that tool too much, so yeah. Edit: Just noticed the "PlaySound("dontstarve/creatures/spider/spider_egg_sack")" isn't playing any sounds These are the last things for the grand finale of my mod. I wanna post a thread for it once I'm done with this. I really appreciate all you guys' help! Edited March 10, 2018 by RedTarantula Link to comment https://forums.kleientertainment.com/forums/topic/88387-prefab-graphics-bug-help/#findComment-1013202 Share on other sites More sharing options...
Aquaterion Posted March 10, 2018 Share Posted March 10, 2018 (edited) MakePlacer("cave_spider_egg_sack_placer", "spider_mound", "spider_mound", "full") --or "med" for the flatter version Edited March 10, 2018 by Aquaterion Link to comment https://forums.kleientertainment.com/forums/topic/88387-prefab-graphics-bug-help/#findComment-1013297 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