Time for action – Making the GameReplicationInfo
One of the things a GameInfo
does when it spawns is create its GameReplicationInfo
, so it can send information to the players. The class to use is specified in its default properties, so let's create our own and set it there.
Create a new file in our
Development\Src\AwesomeGame\Classes
folder calledAwesomeGameReplicationInfo.uc
. Type the following code into it:class AwesomeGameReplicationInfo extends UTGameReplicationInfo; var bool bSpawnBoss; var float NextWaveTime; var int EnemiesLeft; var AwesomeEnemy TheBoss; replication { if(bNetDirty) bSpawnBoss, NextWaveTime, EnemiesLeft, TheBoss; } defaultproperties { }
This will be all the information we need to pass to the player.
Now we need the
GameInfo
to use this class as itsGameReplicationInfo
, so let's add a line toAwesomeGame
's default properties:GameReplicationInfoClass=class'AwesomeGame.AwesomeGameReplicationInfo'
Now we need to pass the information from
AwesomeGame
toAwesomeGameReplicationInfo...