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.


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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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