RexySeven Posted May 16, 2023 Share Posted May 16, 2023 Hello again, I got a problem making item "deployable" As of right now It spawns under character's feet after being crafted Ideally you have to choose where to place it similar to regular structures here's the code in Modmain.lua: AddPrefabPostInit("cactus", function(inst) inst:AddComponent("deployable")inst.components.deployable.ondeploy = OnDeploy end) AddCharacterRecipe("cactus", -- name { -- ingredients GLOBAL.Ingredient("succulent_picked", 5), GLOBAL.Ingredient("poop", 2), }, GLOBAL.TECH.SCIENCE_ONE, { -- config "cactus_placer",--placer 2, -- min_spacing builder_tag = "whispy", atlas = "images/inventoryimages/cacti.xml", }, { -- filters "CHARACTER", "FARM", } ) If some kind soul could help me it would be greatly appreciated! Link to comment https://forums.kleientertainment.com/forums/topic/147820-problem-making-item-deployable/ Share on other sites More sharing options...
Haruhi Kawaii Posted May 17, 2023 Share Posted May 17, 2023 20 hours ago, RexySeven said: Hello again, I got a problem making item "deployable" As of right now It spawns under character's feet after being crafted Ideally you have to choose where to place it similar to regular structures here's the code in Modmain.lua: AddPrefabPostInit("cactus", function(inst) inst:AddComponent("deployable")inst.components.deployable.ondeploy = OnDeploy end) AddCharacterRecipe("cactus", -- name { -- ingredients GLOBAL.Ingredient("succulent_picked", 5), GLOBAL.Ingredient("poop", 2), }, GLOBAL.TECH.SCIENCE_ONE, { -- config "cactus_placer",--placer 2, -- min_spacing builder_tag = "whispy", atlas = "images/inventoryimages/cacti.xml", }, { -- filters "CHARACTER", "FARM", } ) If some kind soul could help me it would be greatly appreciated! Probably will work Spoiler Modmain.lua AddCharacterRecipe("cactus_test", -- name { -- ingredients GLOBAL.Ingredient("succulent_picked", 5), GLOBAL.Ingredient("poop", 2), }, GLOBAL.TECH.SCIENCE_ONE, { product = "cactus", placer= "cactus_placer", min_spacing = 2, builder_tag = "whispy", atlas = "images/inventoryimages/cacti.xml", }, { -- filters "CHARACTER", "FARM", } ) /scripts/prefab/testcactus.lua return MakePlacer("cactus_placer", "cactus", "cactus", "idle") Link to comment https://forums.kleientertainment.com/forums/topic/147820-problem-making-item-deployable/#findComment-1635367 Share on other sites More sharing options...
RexySeven Posted May 17, 2023 Author Share Posted May 17, 2023 (edited) 4 hours ago, Haruhi Kawaii said: Probably will work Reveal hidden contents Modmain.lua AddCharacterRecipe("cactus_test", -- name { -- ingredients GLOBAL.Ingredient("succulent_picked", 5), GLOBAL.Ingredient("poop", 2), }, GLOBAL.TECH.SCIENCE_ONE, { product = "cactus", placer= "cactus_placer", min_spacing = 2, builder_tag = "whispy", atlas = "images/inventoryimages/cacti.xml", }, { -- filters "CHARACTER", "FARM", } ) /scripts/prefab/testcactus.lua return MakePlacer("cactus_placer", "cactus", "cactus", "idle") Hmmm, it doesn't Maybe I should do something specific in testcactus.lua ? (edit, the character just doesn't show up in the selection menu now) Edited May 17, 2023 by RexySeven Link to comment https://forums.kleientertainment.com/forums/topic/147820-problem-making-item-deployable/#findComment-1635386 Share on other sites More sharing options...
Haruhi Kawaii Posted May 18, 2023 Share Posted May 18, 2023 14 hours ago, RexySeven said: Hmmm, it doesn't Maybe I should do something specific in testcactus.lua ? (edit, the character just doesn't show up in the selection menu now) I have attached the mod, you can check it out cactustest.zip 1 Link to comment https://forums.kleientertainment.com/forums/topic/147820-problem-making-item-deployable/#findComment-1635511 Share on other sites More sharing options...
RexySeven Posted May 18, 2023 Author Share Posted May 18, 2023 1 hour ago, Haruhi Kawaii said: I have attached the mod, you can check it out cactustest.zip 2.25 kB · 0 downloads Works perfectly, thank you c: Got problem with inventoryicon not showing up, but I'll figure it out 1 Link to comment https://forums.kleientertainment.com/forums/topic/147820-problem-making-item-deployable/#findComment-1635526 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