Jump to content

My Mod Character's Tree Punching Powers


Recommended Posts

Welp, ya see... I'm making a mod and I've run into a brick wall in terms of coding...

My mod character's special power is supposed to be the power to punch trees with his fist buuuut I'm having a little trouble with the code.

If anyone knows how, please leave some information for me!

Thanks,

Dudedude

Link to comment
Share on other sites

I'd suggest looking into woodie, as he can basically do what you want when he transforms.
 Woodie isn't ported yet. It's just a copy of his single-player files, pretty much.

 

@Dudedude, I think what you need to do is modify the fn for ACTIONS.CHOP, and add a componentaction to a "treepunching" component that you make for your character. I wrote a bit on how to add actions and componentactions in my guide. Taking a look at ACTIONS.CHOP, though, you might not need to modify that at all, and just add the component action.

Link to comment
Share on other sites

 Woodie isn't ported yet. It's just a copy of his single-player files, pretty much.

 

@Dudedude, I think what you need to do is modify the fn for ACTIONS.CHOP, and add a componentaction to a "treepunching" component that you make for your character. I wrote a bit on how to add actions and componentactions in my guide. Taking a look at ACTIONS.CHOP, though, you might not need to modify that at all, and just add the component action.

 

 

Hmm... being the noob that I am, I'm going to have a lovely time figuring this out, but at least it's a step forward. Thanks a bunch!

 

EDIT: I forgot to mention that I already attempted to add ACTIONS.CHOP into my prefab file:

 

local master_postinit = function(inst)

    inst.components.health:SetMaxHealth(120)

    inst.components.hunger:SetMax(135)

    inst.components.sanity:SetMax(180)

    inst.components.combat.damagemultiplier = 0.85

    inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.15)

    inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.2)

    inst.components.eater.strongstomach = false

    inst.components.sanity.neg_aura_mult = 0

    inst:AddComponent("worker")

    inst.components.worker:SetAction(ACTIONS.CHOP, 2)

    inst.components.worker:SetAction(ACTIONS.MINE, 2)

    inst.components.sanity.night_drain_mult = -3

end

This was the end result; it didn't work. I'm working on trying your idea now, but honestly I have no coding skill so I'm lost like a helpless baby in a dark room. Yup.

Edited by Dudedude
Link to comment
Share on other sites

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
 Share

×
  • Create New...