-
Content Count
13 -
Joined
-
Last visited
Community Reputation
1 NeutralAbout Zoshiru
-
Rank
Junior Member
Recent Profile Visitors
310 profile views
-
ktools: Cross-platform modding tools for Don't Starve
Zoshiru commented on simplex's file in Modding Tools, Tutorials & Examples
-
Ok, you've fixed the syntax error, but now I'm getting THIS error: The lines it's mentioning: local master_postinit = function(inst) -- choose which sounds this character will play inst.soundsname = "willow" -- Stats inst.components.health:SetMaxHealth(150) inst.components.hunger:SetMax(150) inst.components.sanity:SetMax(80) inst.components.sanity.night_drain_mult = 0 inst.components.combat.damagemultiplier = 0.5 AddComponentPostInit("tool", function(t) local old = SetAction function Tool:SetAction(action, effectiveness) if self.inst and self.inst.components.inventoryitem and self.inst.components.inventoryitem.owner and self.inst.components.inventoryitem.owner.prefab == "timothy" then effectiveness = effectiveness / 2 end old(self, action, effectiveness) end end)end
-
Added that to my character's prefab, now the game just crashes. Not even an error message. If I add it to modmain, it crashes with the error "Unexpected symbol near )" Edit: For some reason the function stretches all the way to the bottom of the script in Notepad++, as if it's missing an end. Are there some syntax errors in there I'm not seeing?
-
Ok, so modifying the animation speed is overcomplicated. But then there's a mod on the Workshop called "Zinnia the dismantler" that makes mining/chopping less effective by making it take more swings. A large tree, for instance, takes 15 hits with an axe, but with the tool she starts with it takes 20. As far as I can tell this is the part of the script that does it: inst:AddComponent("tool") inst.components.tool:SetAction(ACTIONS.HAMMER, 1.5) inst.components.tool:SetAction(ACTIONS.MINE, 0.5) inst.components.tool:SetAction(ACTIONS.CHOP, 0.75)Would it be possible to put this into a character's script instead of a tool? There's some similar code in Woodie's script under the Werebeaver code that sets his chop speed while he's without and axe: inst:AddComponent("worker") inst.components.worker:SetAction(ACTIONS.DIG, 1) inst.components.worker:SetAction(ACTIONS.CHOP, 4) inst.components.worker:SetAction(ACTIONS.MINE, 1) inst.components.worker:SetAction(ACTIONS.HAMMER, 1)But I'm not entirely sure how the "worker" component fits into this or if tools override these values with their own. Is it possible to override the tool's stats with my own values for this?
-
I believe in English thats:
-
So I'm looking to add a perk to my character that makes him use tools like Axes and Pickaxes at half the speed of other characters. I looked at Woodie's code and found that his increased chopping speed is part of his axe, but is there a way to make it affect all tools wielded by a character? I would also like to decrease his swing speed when attacking monsters, but if that's not possible I'll just half his attack damage.