Time for action – Moving functionality into Kismet
To do this we're going to create a new action that will spawn the boss, and also alter an existing action to give us more control over the waves of enemies:
Create a new file in
Development\Src\AwesomeGame\Classes
calledAwesomeSeqAct_SpawnBoss.uc
.Let's write the following code in it:
class AwesomeSeqAct_SpawnBoss extends SequenceAction; event Activated() { if(AwesomeGame(GetWorldInfo().Game) != none) AwesomeGame(GetWorldInfo().Game).SpawnBoss(); } defaultproperties { ObjName="Spawn Boss" ObjCategory="Awesome Game" VariableLinks.Empty }
The
SpawnBoss
function doesn't exist in AwesomeGame yet, so let's create it. Open up AwesomeGame.uc and add this function:function SpawnBoss() { bSpawnBoss = true; ActivateSpawners(); }
Now to keep the game from automatically spawning the boss, let's delete those two lines from
EnemyKilled
so it looks like this:function EnemyKilled() { local int i; if(bSpawnBoss) ...