• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Extended mutator class for Killing Floor - TWI needs your ideas!

Benjamin

Grizzled Veteran
May 17, 2009
3,630
619
France
Hi all,

I've contacted Xienen and he has agreed to add an extended mutator class, which will have new KF-specific events called during the game. I'll be compiling a list of events, writing the mutator base class, and detailing where the hooks should be placed.

So I'm asking you guys if there are any particular events that you need, so that they can be implemented. I've constructed a basic list so far:


Extended mutator event list

PostInitGame - Called directly after the game's InitGame function has been called, this allows modifying the current match after it has been initialized (useful for altering waves, the specimen list, and so on).
MatchBegin - Called when the match has begun.
MatchEnd (bool bWin) - Called when the match has ended, and indicates whether the humans survived or not.
WaveBegin (int WaveNum) - Called when a wave has begun, indicating said wave number.
WaveEnd (int WaveNum) - Called when a wave has ended, indicating said wave number.
EnterZedTime - Called when entering zed time.
LeaveZedTime - Called when leaving zed time.
int ModifyDamage(int OriginalDamage, Pawn Injured, Pawn InstigatedBy, vector HitLocation, out vector Momentum, class<DamageType> DamageType) - Equivalent of game rules' ReduceDamage, called for all pawns instead of just players. Useful for implementing a custom (possibly dynamically-adjusting) difficulty setting.
ZedSpawned (KFMonster Zed, ZombieVolume ZV) - Called when a specimen has spawned, and indicates which ZombieVolume spawned it.
ZedKilled (KFMonster Zed, Controller Killer) - Called when a specimen is killed, and indicates who the killer is.
PlayerKilled (PlayerController Player, Controller Killer) - Called when a player is killed, and indicates who the killer is.
ChatMessage (Controller Sender, out string Message) - Called when a player sends a chat message, and allows altering the message. Useful for logging chat and implementing filters and user commands.
DropWeapon (Controller Player, Pickup Weapon) - Called when a player drops a weapon, with a reference to the newly-created pickup.
bool PickupWeapon (Controller Player, Pickup Weapon) - Called before a player picks up a weapon, allowing a mutator to prevent said weapon from being picked up.
bool DoorOpen (KFDoorMover Door, Controller Opener) - Called when a door is opened.
bool DoorClose (KFDoorMover Door, Controller Closer) - Called when a door is closed.
bool DoorDestroyed (KFDoorMover Door, Controller Destroyer) - Called when a door is destroyed.
Pawn SetEnemy(KFMonster Specimen, Pawn enemy) - Called when a specimen is deciding whether a specific pawn should be considered an enemy.


Example mutator

Spoiler!
 
Last edited:
MatchBegin - Called when the match has begun.
MatchEnd (bool bWin) - Called when the match has ended, and indicates whether the humans survived or not.
...
ZedSpawned (KFMonster Zed, ZombieVolume ZV) - Called when a specimen has spawned, and indicates which ZombieVolume spawned it.
ZedKilled (KFMonster Zed, Controller Killer) - Called when a specimen is killed, and indicates who the killer is.
PlayerKilled (PlayerController Player, Controller Killer) - Called when a player is killed, and indicates who the killer is.
ChatMessage (Controller Sender, out string Message) - Called when a player sends a chat message, and allows altering the message. Useful for logging chat and implementing filters and user commands.
...
bool PickupWeapon (Controller Player, Pickup Weapon) - Called before a player picks up a weapon, allowing a mutator to prevent said weapon from being picked up.
I don't think they are really necessary when we have Actor.MatchStarting, GameRules.CheckEndGame, GameRules.ScoreKill, BroadcastHandler.BroadcastText and GameRules.OverridePickupQuery.

However it would be nice to have something to catch/modify voice taunts as-well as some KFDoorMover script events, also something to override KFMonsterController.SetEnemy behaviour (eg: make specimen hate/be friendly to something specific).
 
Upvote 0
I don't think they are really necessary when we have Actor.MatchStarting, GameRules.CheckEndGame, GameRules.ScoreKill, BroadcastHandler.BroadcastText and GameRules.OverridePickupQuery.

However it would be nice to have something to catch/modify voice taunts as-well as some KFDoorMover script events, also something to override KFMonsterController.SetEnemy behaviour (eg: make specimen hate/be friendly to something specific).

Part of my motivation for this class was to make it easy to capture certain events without having to register any kind of handler or rules class, which is why those are there.

I'll look into useful KFDoorMover events. :)

Might be useful to have the ability to override SetEnemy but would you really need it with the current game type and specimens?
 
Upvote 0
Might be useful to have the ability to override SetEnemy but would you really need it with the current game type and specimens?
Think as player specimen vs players mods; currently there's no way of preventing AI specimen attacking player specimen without overriding each one of the monstercontrollers (should also change that in KFMonsterController.FindNewEnemy aswell).
 
Upvote 0
Slaved mentioned on this thread how it'd be useful to be able to tap into patriarch events such as healing. Anyone have any specific requests regarding this?

Think as player specimen vs players mods; currently there's no way of preventing AI specimen attacking player specimen without overriding each one of the monstercontrollers (should also change that in KFMonsterController.FindNewEnemy aswell).

True, but I would normally expect someone to just write their own extended specimen classes for this. Nonetheless I think it could be useful. :)
 
Upvote 0
hi,

class ExampleMutator extends KFMutator;

I have an error:

Superclass KFMutator of ExampleMutator not found

I have try class ExampleMutator extends Mutator and use function WaveBegin(int WaveNum) but i've a message error:
G:\Stream\SteamApps\common\killingfloor\ExampleMutator\Classes\ExampleMutator.uc(30)
: Error, Unknown Function 'WaveBegin' in 'Class Engine.Mutator'
Compile aborted due to errors.

Someone can help me?

Thx
 
Upvote 0
It's not implemented yet, it's currently just an idea. I would have tried to get it sorted before the latest flurry of updates but I was never notified that they were happening. Not sure when the next update will be but I think we've still got some time to come up with new ideas for this, so if you have any don't hesitate to post them.
 
Upvote 0