Jump to content

Pickable droppicked does not work


Recommended Posts

I've tried changing a few pickable prefabs to user droppicked so they work similarly to the juicy berry bushes but i've come across a few things that just don't seem to work.

modmain.lua

local prefabs =
{
  "sapling",
  "grass",
  "berrybush",
  "flower",
  "carrot_planted",
  "cactus",
}

for k,v in pairs(prefabs) do
  AddPrefabPostInit(v, function(inst)
    if inst.components.pickable ~= nil then
      inst.components.pickable.quickpick = false
      inst.components.pickable.droppicked = true
      inst.components.pickable.dropheight = 1
    end
  end)
end

So you can see I'm making exactly the same changes for saplings, grass, berry bushes, flowers, carrots, and cactus. It works for the first 4, but it does not work for the last 4.

When I pick a sapling, a twig falls on the ground instead of going into my inventory.

When I pick grass, cut grass falls on the ground instead of going into my inventory.

When I pick a berry bush, the berry falls to the ground instead of going into my inventory.

When I pick a flower, carrot, or cactus, the petal, carrot, or cactus flesh instantly goes into my inventory instead of falling to the ground.

Why doesn't this work for some prefabs?

Edited by HomShaBom
Link to comment
Share on other sites

I'm not sure about cactus, but flower and carrot are instant pick, when grass/berry bush and sapling aren't. So maybe they use a different picking function or something ? Or maybe the quickpick prevent the drop to happen ?

 

Link to comment
Share on other sites

Flower, Evil Flower, Carrot, Cactus, Cave Fern, Lichen, and Reeds all refuse to drop their picked item, they all instantly go into the inventory, even after setting quickpick = false, droppicked = true, dropheight = 1

Berry Bush, Berry Bush (2), Juicy Berry Bush, Blue Mushroom, Green Mushroom, Red Mushroom, Grass, Sapling, Spiky Bush, Light Flower (1), Light Flower (2), Light Flower (3), Mysterious Plant, Cave Banana Tree all do work with droppicked exactly as expected.

Glommer's Statue works with droppicked, but for some reason the statue still looks like it has the flower even though you knock the flower to the ground.

Edited by HomShaBom
Link to comment
Share on other sites

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
 Share

×
  • Create New...