Search the Community
Showing results for tags 'dig'.
-
Recently I've been making yet another character mod and said character is supposed to be able to chop and mine without the need of an ax or pickaxe(character has claws for that task) I've been searching around and found something to help, however, it binds to to the digging and hammering and prevents me from using a shovel to dig anything, the code I've been using is the following: For Modmain: local ACTIONS = GLOBAL.ACTIONSlocal myactions = {}myactions[ACTIONS.CHOP] = 5myactions[ACTIONS.MINE] = 3myactions[ACTIONS.HAMMER] = 0myactions[ACTIONS.DIG] = 0local multiact = AddAction("MULTI", "Work", function(act) if act.target.components.workable then local action = act.target.components.workable.action local numworks = myactions[action] or 1 act.target.components.workable:WorkedBy(act.doer, numworks) end return trueend)AddStategraphActionHandler("wilson", GLOBAL.ActionHandler(multiact, "multi"))AddStategraphState("wilson", GLOBAL.State { name = "multi", tags = {"notalking", "autopredict"}, onenter = function(inst) inst.sg.statemem.action = inst:GetBufferedAction() local target = inst.sg.statemem.action and inst.sg.statemem.action.target or nil inst.components.locomotor:Stop() inst.AnimState:PlayAnimation("throw") inst.sg:SetTimeout(cooldown) if target and target:IsValid() then inst:FacePoint(target.Transform:GetWorldPosition()) end end, timeline = { GLOBAL.TimeEvent(7 * GLOBAL.FRAMES, function(inst) inst:PerformBufferedAction() end), GLOBAL.TimeEvent(16 * GLOBAL.FRAMES, function(inst) if inst.components.playercontroller and inst.components.playercontroller:IsAnyOfControlsPressed(GLOBAL.CONTROL_SECONDARY, GLOBAL.CONTROL_ACTION, GLOBAL.CONTROL_CONTROLLER_ALTACTION) and inst.sg.statemem.action and inst.sg.statemem.action.target and inst.sg.statemem.action.target.components.workable and inst.sg.statemem.action.target.components.workable.workleft > 0 then inst:PushBufferedAction(inst.sg.statemem.action) end end), }, events = { GLOBAL.EventHandler("animover", function(inst) if inst.AnimState:AnimDone() then inst.sg:GoToState("idle", true) end end), },})for the prefab: inst:DoTaskInTime(0, function() inst.components.playeractionpicker.rightclickoverride = function(inst, target, position) local actions = {} if target and target.components.workable and target.components.workable.workable then local inv = inst.components.inventory if inv and not inv:GetEquippedItem(EQUIPSLOTS.HANDS) then table.insert(actions, ACTIONS.MULTI) end end return inst.components.playeractionpicker:SortActionList(actions, target) endend)Can someone give me a hand on how to fix this dig and hammering issue?
-
What ? wait ! how did you found the coffin ?
-
When a treeguard appeared... T_T, i was at day 7 or 6 i think, nothing to defend myself...