Jump to content

Recommended Posts

For example there is mod called "PickyPickyPicky" with follow code:

 

function PPP_QuickPick(inst)
    
    if inst.components.pickable then

        inst.components.pickable.quickpick = true
    end
end

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

 

May be there is method use this code (or its part) for my mode?

 

Here's a mod that allows to use a spear to slash grass (using attack animation). It introduces new action, that is faster than generic harvesting of grass and twigs. I think you could use it as an example to add your own action, that will replace generic picking of grass to shorter "pick up version" when the scythe is equipped. I am actually trying to do exactly that for my own gardening tools mod. (I wish my drawing didn't suck though.)

 

As of now unfortunately I don't know how to modify existing "pick up" action to do a short version of animation, when a specific item is equipped. Introducing new action is more bothersome, but it should work. Hope that helps. If you manage to do something, please send me a message, I am quite interested in creating a set of tools that speeds up harvesting of twigs, grass and plants (and their gold version, that'll last longer and prevent the damage from picking cacti).

 

UPD: Maybe actually you don't even need to change the animation from Slash Grass mod. Using "attack" animation while holding scythe is more fitting, then picking the grass up, like its just lying on the ground. In that case all you need to do is just copy the action code, change its name from "slash" to something like "reap" and add the tag "slasher" (you can change its name to custom one too) to your scythe's prefab file.

Edited by Madman666

Madman666, oh, big thanks. If in "Slash Grass" mod only change "spear" to "scythe", scythe alredy starts mowing...))) 

 

...

AddPrefabPostInit("scythe",makeSlash)
--AddPrefabPostInit("spear",makeSlash)
-- add "Slash" action to CollectScenceActions
local function replaceCollectAction(inst)
...

 

With this can work. It remains only to assemble all in one mode.))

 

 

Madman666, oh, big thanks. If in "Slash Grass" mod only change "spear" to "scythe", scythe alredy starts mowing...))) 

 

...

AddPrefabPostInit("scythe",makeSlash)

--AddPrefabPostInit("spear",makeSlash)

-- add "Slash" action to CollectScenceActions

local function replaceCollectAction(inst)

...

 

With this can work. It remains only to assemble all in one mode.))

 

 

Yup, that should work. I think that every time you mow grass the scythe needs to lose durability though or it will be somewhat out of place in Don't Starve's "everything ends" concept. I still did not figure it out how to chain durability loss to specific character's action though. If I think of something - will post here.

Perfect. Thanks a bunch. Will check it out immediately.

 

UPD: Oh, I've got it. You attached finite uses through the "tool" component. Thanks, that'll help in my mod a lot.

 

By the way - your art is damn good. Could I perhaps ask you to help me out with my mod's art? That's of course if you have time and interested.

Edited by Madman666

 

Madman666, job is done. In .lua files of my mod there are several --comments specially for you. 
 

 

 

Tested out - this code does not work. Grass and etc. collects faster, but nor scythe's nor my mod's tools durability does not decrease while collectig resources.

 

UPD: This code works fine if you use "action button" (spacebar) to pick grass and etc., then tool's durability properly decreases. But if you use mouse to do action - it does not. Trying to figure it out.

Edited by Madman666

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