ColombianCam

  • Content count

    13
  • Joined

  • Last visited

Community Reputation

3 Neutral

About ColombianCam

  • Rank
    Junior Member
  1. A long time ago I tried to get the werebeaver to have more actions such as, shaving beefalo and pitchforking but the problem is that they're not inside the action picker and rather in componentactions.lua local function RightClickPicker(inst, target) if target ~= nil and target ~= inst then for i, v in ipairs(BEAVER_DIET) do if target:HasTag("edible_"..v) then return inst.components.playeractionpicker:SortActionList({ ACTIONS.EAT }, target, nil) end end return (target:HasTag("HAMMER_workable") and inst.components.playeractionpicker:SortActionList({ ACTIONS.HAMMER }, target, nil)) or (target:HasTag("DIG_workable") and target:HasTag("sign") and inst.components.playeractionpicker:SortActionList({ ACTIONS.DIG }, target, nil)) or (target:HasTag("hat") and inst.components.playeractionpicker:SortActionList({ ACTIONS.PICKUP }, target, nil)) or (target:HasTag("groundtile") and inst.components.playeractionpicker:SortActionList({ ACTIONS.TERRAFORM }, target, nil)) or (target:HasTag("beefalo") and inst.components.playeractionpicker:SortActionList({ACTIONS.SHAVE)}, target, nil)) or nil here's the code for terraforming in componenactions.lua for terraform terraformer = function(inst, doer, pos, actions, right) if right and TheWorld.Map:CanTerraformAtPoint(pos:Get()) then table.insert(actions, ACTIONS.TERRAFORM) end end, shaver = function(inst, doer, target, actions) if target:HasTag("bearded") and not (doer.replica.rider ~= nil and doer.replica.rider:IsRiding()) then table.insert(actions, ACTIONS.SHAVE) end end, so um, can anyone help me please? In game what ends up happening is that the beaver has the option to shave but he doesn't complete the action, he sort of just stutters and as for the terraformer, he doesn't even bother to detect turfs.
  2. Thanks a bunch guys! After analyzing what y'all proposed I landed on this function(inst, eater) if eater.prefab == "woodie" and not eater.isbeavermode:value() then eater.components.beaverness:SetPercent(.25) elseif eater.prefab == "woodie" and eater.isbeavermode:value()then eater.components.beaverness:SetPercent(1) end end) which instead of making the character go into transformation, it sets the transformation values of the log meter, so I don't have to code any transformation bits and the game does it for me, if the log meter reached this log beaverness value.
  3. I'm trying to make woodie be able to use living logs as an off and on switch of his state, if he eats a living log as a beaver he turns into woodie and vice versa, but I'm not able to make it happen without crashing, I've been looking at everything related to this, event handlers because transforming is an event but how do I apply it to a eaten item? it says eater is not defined to say it's woodie who transforms if eaten. I noticed that there was only inst so I decided to replace everything with eater to see if it worked, I've stressed out options in the past by using woodie's prefab own transform bits but it doesn't work, i've read rezecibs post to understand. inst:AddComponent("edible") inst.components.edible.foodtype = FOODTYPE.WOOD inst.components.edible.woodiness = 0 inst.components.edible.healthvalue = 0 inst.components.edible.hungervalue = 0 if eater.isbeavermode:value() then eater:RemoveTag("beaver") eater.Network:RemoveUserFlag(USERFLAGS.CHARACTER_STATE_1) eater.isbeavermode:set(false) eater:PushEvent("stopbeaver") OnBeaverModeDirty(eater) if not eater.isbeavermode:value() then eater:AddTag("beaver") eater.Network:AddUserFlag(USERFLAGS.CHARACTER_STATE_1) eater.isbeavermode:set(true) eater:PushEvent("startbeaver") OnBeaverModeDirty(eater) inst.components.edible:SetOnEatenFn(oneaten)