Time for action – Creating Kismet actions
As far as creating a custom class goes, Kismet should be pretty easy for us by now. For our first experiment, let's disable the default spawning of enemies in our game and create a Kismet action to do it instead. That will give us more control over when the enemies spawn in our Awesome Game.
Make sure the editor is closed.
Open AwesomeGame.uc in ConTEXT. At the bottom of our
PostBeginPlay
function, let's take out the timer that activates the spawners. The function should now look like this:simulated function PostBeginPlay() { local AwesomeEnemySpawner ES; super.PostBeginPlay(); GoalScore = 1; foreach DynamicActors(class'AwesomeEnemySpawner', ES) EnemySpawners[EnemySpawners.length] = ES; }
Now we're ready to create the Kismet action that will handle the spawning. In our
Development\Src\AwesomeGame\Classes
folder, create a new file calledAwesomeSeqAct_SpawnerActivation.uc
.Write the following code in this new file:
class AwesomeSeqAct_SpawnerActivation...