Time for action – Creating a custom GameInfo and PlayerController
Creating a custom GameInfo
class is simple enough; it's just knowing where to let the game know that you want to run it. First up, let's create the class.
Create a new file in our
AwesomeGame/Classes
folder calledAwesomeGame.uc
. Type the following code into it:class AwesomeGame extends UTDeathmatch; defaultproperties { }
UTDeathmatch
is a good place to start for a customGameInfo
, even for games that don't involve killing anyone, or for single player games.UTDeathmatch
and its parent classes have a lot of functionality in common with those types of games including the player spawn behavior.Now let's create a custom
PlayerController
. Create a new file in ourAwesomeGame/Classes
folder calledAwesomePlayerController.uc
. Type the following code into it:class AwesomePlayerController extends UTPlayerController; simulated function PostBeginPlay() { super.PostBeginPlay(); `log("AwesomePlayerController spawned!"); } defaultproperties...