Mario384 Posted April 1, 2015 Share Posted April 1, 2015 Basically, I'm wondering if I can make a button for one specific character make it do a certain stategraph state. For example, if I press the SHIFT key, and my custom player is a warg, it could be made so he would go into a howl state. Link to comment https://forums.kleientertainment.com/forums/topic/52560-pressing-a-button-to-activate-a-stategraph-state/ Share on other sites More sharing options...
rezecib Posted April 2, 2015 Share Posted April 2, 2015 @Mario384, Well, I think there are a number of ways you could do this. Stategraphs are composed of ActionHandlers, EventHandlers, and States. You could directly push a state (inst.sg:GoToState("somestate")), you could make an action handler (ActionHandler(ACTIONS.MYACTION, "howl")) and bind the key to an action, or you could make an event handler that sends it to a state, and then push the event with the keybind. so... basically any way you want to do it, you can. There are already a couple of guides on here for how to bind a key to server-side events (e.g. in the Pig Feed game mode, shift makes you sprint). Link to comment https://forums.kleientertainment.com/forums/topic/52560-pressing-a-button-to-activate-a-stategraph-state/#findComment-626798 Share on other sites More sharing options...
Mario384 Posted April 3, 2015 Author Share Posted April 3, 2015 @Mario384, Well, I think there are a number of ways you could do this. Stategraphs are composed of ActionHandlers, EventHandlers, and States. You could directly push a state (inst.sg:GoToState("somestate")), you could make an action handler (ActionHandler(ACTIONS.MYACTION, "howl")) and bind the key to an action, or you could make an event handler that sends it to a state, and then push the event with the keybind. so... basically any way you want to do it, you can. There are already a couple of guides on here for how to bind a key to server-side events (e.g. in the Pig Feed game mode, shift makes you sprint). I rigged an ActionHandler up to PICK, which appears to work very well. Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/52560-pressing-a-button-to-activate-a-stategraph-state/#findComment-627186 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