Jump to content

Recommended Posts

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! :D

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! :D

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")

 

 

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 by RexySeven
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

  • Big Ups 1

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...