Solio Posted August 11, 2015 Share Posted August 11, 2015 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 More sharing options...
Developer ImDaMisterL Posted August 11, 2015 Developer Share Posted August 11, 2015 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 More sharing options...
Solio Posted August 11, 2015 Author Share Posted August 11, 2015 But then how would I go about activating and deactivating that immobile state? Since he's a tree, I want it to be something you can do at any time as long as you have the hunger for it. Link to comment Share on other sites More sharing options...
StarmanUltra Posted August 12, 2015 Share Posted August 12, 2015 (edited) 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=595991local 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 KeyHandlercheck out this character mod for full code about a keypress change state http://steamcommunity.com/sharedfiles/filedetails/?id=484042273 Edited August 12, 2015 by StarmanUltra Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now