Jump to content

A question about the possibility of planting a character


Recommended Posts

I'm currently tinkering with a character that would essentially be a player-sized treeguard and I brainstormed a bunch of stuff relating to it's mechanics, some of which would hinge on one thing. Would it be at all possible for the character to be able to plant himself? I want the mechanic to work somewhat like a tent where you would gain health and sanity among other things for hunger, but if it's not possible, then I'd have to rethink some things. So could this work? I assume if anything that if anything it would have to work using a plantable item since I can't think of a way otherwise.

Link to comment
Share on other sites

  • Developer

Can't you just... add an animation that makes it appear like he was planted... makes him immovable/un-noticeable or whatever the heck you want to do with it, and look at the tent's DST prefab to see what they do to regain sanity, then try to look for how to do it with health too!

Link to comment
Share on other sites

You can activate/deactivate a state with a key press. So for example, you could tap R to root yourself, and tap again to uproot. Here's an example from Kzisor http://forums.kleientertainment.com/topic/48203-how-to-add-a-new-key-function/?view=findpost&p=595991

local KeyHandler = Class(function(self, inst)self.inst = instself.handler = TheInput:AddKeyHandler(function(key, down) self:OnRawKey(key, down) end )end)function KeyHandler:OnRawKey(key, down)  if (key == KEY_T and not down) then      print("test")  endendreturn KeyHandler

check out this character mod for full code about a keypress change state http://steamcommunity.com/sharedfiles/filedetails/?id=484042273

Edited by StarmanUltra
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...