Time for action – Our first Kismet event
We're going to make it so that we can spawn as many waves of enemies as we want, so instead of calling this event something like EnemiesDefeated
, we'll use something like WaveComplete
.
Create a new file in our
Development\Src\AwesomeGame\Classes
folder calledAwesomeSeqEvent_WaveComplete.uc
.The code for this one is going to be really simple:
class AwesomeSeqEvent_WaveComplete extends SequenceEvent; defaultproperties { ObjName="Wave Complete" ObjCategory="Awesome Game" VariableLinks.Empty bPlayerOnly=false }
Yep, that's it. We don't have an instigator so we don't need to have any variable links. The
bPlayersOnly
variable lets classes other thanPlayerControllers
trigger the event.The event is created, so now we need to trigger it. Open up AwesomeGame in ConTEXT and add a line to our
EnemyKilled
function:function EnemyKilled() { local int i; if(bSpawnBoss) return; EnemiesLeft--; if(EnemiesLeft <= 0) ...