Jump to content

Pressing a Button to Activate a Stategraph State


Recommended Posts

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
Share on other sites

@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
Share on other sites

@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
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...