parityb1t

  • Content count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About parityb1t

  • Rank
    Junior Member
  1. Answering my own question. Still don't know where the prefab files for the produce are, but they are inventoryitem. Debugging showed me that my character was missing the ActionHandler for ACITONS.PICKUP in the stategraph, hence it was failing. Adding it solved it.
  2. In 'carrot' and 'berrybush' prefab files, the pickable component has 'carrot' and 'berries' prefab set, respectively, to be spawned when `Pick()` is called. This drops is directly into the inventory. product set: inst:AddComponent("pickable") inst.components.pickable.picksound = "dontstarve/wilson/pickup_plants" inst.components.pickable:SetUp("carrot", 10) extract from `Pick()` local loot = nil if picker and picker.components.inventory and self.product then loot = SpawnPrefab(self.product) ... picker.components.inventory:GiveItem(loot, nil, Vector3(TheSim:GetScreenPos(self.inst.Transform:GetWorldPosition()))) so we can use ACTIONS.PICK on 'carrot' and 'berrybush', but how could I make a character pick up 'carrot' or 'berries' if they are not in the inventory, i.e. on the ground and have already been harvested? How would I use ACTIONS.PICKUP? I cannot even seem to find the prefab files for the 'carrot' and 'berries' (only their planted version) and the code seems to suggest they do not have the component `inventoryitem` hence cannot be picked up.
  3. Making character can eat wood.

    In `log.lua` and 'twigs.lua', it shows that wood logs are already edible inst:AddComponent("edible") inst.components.edible.foodtype = "WOOD" You can set the following for the `eater` component of your character inst.components.eater:SetBeaver() That will set in the eater component `self.foodprefs` to "WOOD". Which allows the character to eat wood (but I think wood only?). You can play around with eater.foodprefs to get the combination you desire for what character can eat.