Hi, I've just started using Adventure Creator, it really works great.
I'm trying to create a game that lets the player use keyboard/mouse or controller. Everything's almost working (using the Walking Dead example UI), but I just need to be able to switch between the two control schemes. That control is currently locked away in the Settings menu. And it has to be one or the other.
I followed all that as much as I could but, not being a programmer, I couldn't just copy and paste the action I found...
InputMethod AC.SettingsManager.inputMethod = InputMethod.MouseAndKeyboard
It was going to require a little more knowledge. Like exactly where in the ActionTemplate.cs script that line goes?
Comments
You can read all about custom Actions, and the location of the ActionTemplate script, by following this tutorial.
To change the movement method to e.g. "Mouse and Keyboard", you'll want to place the following in your Action's Run() function:
KickStarter.settingsManager.inputMethod = InputMethod.MouseAndKeyboard;
Going further, you could make a new public InputMethod variable in your Action, so that you can expose/change it in your Action's GUI. You'd then be able to re-use the same Action for whichever input method you wanted.
Be mindful, however, that since the Settings Manager is an asset file - any changes you make to it will not be reverted once you exit the game. Therefore, you'll have to set your desired Input method when your game begins by running this Action in your game's ActionList when start game field, at the top of the Settings Manager.
I expect you'd want to map this to an Options setting, too. This tutorial covers the principles involved.