Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have two main subclasses of GameInfo for the two game types we have. I'm wondering if it's possible to get one of these to read a different .ini file because we'd like to move a few of the controls to different buttons for that mode.

It looks to me like it's just going to read Input.ini for this, regardless of the game type.

share|improve this question
up vote 3 down vote accepted

You could create a subclass of PlayerInput with its own section with keybinds in the Input.ini.

If the controls are different based solely on the map/GameInfo, you can make a subclass of your PlayerController, set its InputClass to your new PlayerInput subclass in defaultproperties, then in your GameInfo you can set PlayerControllerClass to your new PlayerController type. So that GameInfo will spawn that PlayerController with that PlayerInput type.

If instead you want to swap it at runtime, you can skip creating the PlayerController subclass. You'll have to find and remove the old PlayerInput from you PlayerController's Interactions array, set your PlayerInput to none, change your InputClass. After that, you can call InitInputSystem() and it'll reinitialize your input with the new class.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.