Jump to content

Picky Picky Picky


bigpak

Recommended Posts

Alright, there is a mod that is called Picky Picky Picky, it makes it so some plants that you can harvest plays the animation for picking a flower or a carrot etc so instead of it being the slower animation its faster, however I am wanting to add farms to it. 

function PPP_QuickPick(inst)	if inst.components.pickable then	inst.components.pickable.quickpick = true	endend

That is the main code for it, then there is the prefabs

AddPrefabPostInit("sapling", PPP_QuickPick)AddPrefabPostInit("marsh_bush", PPP_QuickPick)AddPrefabPostInit("reeds", PPP_QuickPick)AddPrefabPostInit("grass", PPP_QuickPick)AddPrefabPostInit("berrybush2", PPP_QuickPick)AddPrefabPostInit("berrybush", PPP_QuickPick)AddPrefabPostInit("flower_cave", PPP_QuickPick)AddPrefabPostInit("red_mushroom", PPP_QuickPick)AddPrefabPostInit("green_mushroom", PPP_QuickPick)AddPrefabPostInit("blue_mushroom", PPP_QuickPick)AddPrefabPostInit("cactus", PPP_QuickPick)AddPrefabPostInit("lichen", PPP_QuickPick)

I have tried AddPrefabPostInit("fast_farmplot", PPP_QuickPick)

and AddPrefabPostInit("plant_normal", PPP_QuickPick) and neither will work and I cannot figure out what to put in to make it work. Any ideas?

 

Edit: I swear I did not mean to post multiple topics of the same subject, it just did. How do I remove duplicate topics?

Link to comment
Share on other sites

plant_normal doesn't seem to have the pickable component. It has the crop component instead. The ActionHandler for crops is for "harvest" as opposed to "pick."  This is because there are some different interactions that need to be checked for when harvesting as opposed to picking For example, if it's burning when you harvest, it will make you pick up a cooked version of the crop.

If you look in SGwilson.lua you'll find the line

ActionHandler(ACTIONS.HARVEST, "dolongaction"),

I'm fairly new to this API so I'm not sure how ActionHandler works.  You may be able to override that handler and pass it "doshortaction."  I'm not sure what "the proper way" to do that from within a mod is, though.

Link to comment
Share on other sites

@bigpak,

As Corrosive said, plant_normal and the farmplot prefabs are not pickable.

But all the individual vegetables are pickable. Use "AddPrefabPostInit("vegetable_name", PPP_QuickPick)" for all of them. You can probably loop through them with this.

 

GLOBAL.require "prefabs/veggies"

for k,v in pairs(VEGGIES) do
-- ...
end

 

 

Edit: Hmm. They also already contain this.

inst.components.pickable.quickpick = true

 

 

You might have to find a different workaround. Look into the action handlers, if the above didn't work.

 

Edit 2: Disregard. Only applies to carrots. (Whoops)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...