I started my mutator yesterday, and aim to have it finished on Monday or Tuesday, time allowing, as I'm really busy at work at the moment.
I took an obvious approach to my mutator, but I'm also using a number of more advanced UnrealScript features. I decided to use post processing in my mutator. Now, whenever you kill an enemy, the screen will flash bright white, blinding you, for a split second before fading away. LEt's see you double kill now!
It's very nearly there. I'm just having trouble getting the post processing to revert to normal after the flash.
Here's my code, for anyone who is interested in how I've attempted it:
class LP_Mutator_Flare extends UTMutator; var class<GameRules> GRClass; function bool MutatorIsAllowed() { return (WorldInfo.NetMode == NM_Standalone); } function InitMutator(string Options, out string ErrorMessage) { WorldInfo.Game.AddGameRules(GRClass); Super.InitMutator(Options, ErrorMessage); } DefaultProperties { GRClass=class'MWLight.LP_Flare_Rules' }
class LP_Flare_Rules extends GameRules; var float FlashTime; var localplayer LocalPlayer; var PostProcessSettings FlareSettings, NormalSettings; function ScoreKill(Controller Killer, Controller Killed) { if ( PlayerController(Killer) != None ) { LocalPlayer = LocalPlayer(PlayerController(Killer).Player); LocalPlayer.bOverridePostProcessSettings = true; NormalSettings.Scene_Highlights.X = LocalPlayer.CurrentPPInfo.LastVolumeUsed.Settings.Scene_Highlights.X; NormalSettings.Scene_Highlights.Y = LocalPlayer.CurrentPPInfo.LastVolumeUsed.Settings.Scene_Highlights.Y; NormalSettings.Scene_Highlights.Z = LocalPlayer.CurrentPPInfo.LastVolumeUsed.Settings.Scene_Highlights.Z; FlareSettings.Scene_Highlights.X = 0.f; FlareSettings.Scene_Highlights.Y = 0.f; FlareSettings.Scene_Highlights.Z = 0.f; SetTimer(FlashTime, false); } if ( NextGameRules != None ) { NextGameRules.ScoreKill(Killer,Killed); } } function timer() { GotoState('rampup'); } state Rampup { function Tick(float DeltaTime) { if(DeltaTime > (FlashTime / 2)) { //LocalPlayer.ClearPostProcessSettingsOverride(); LocalPlayer.PostProcessSettingsOverride = NormalSettings; GotoState(''); } else { FlareSettings.Scene_Highlights.X -= 0.001f; FlareSettings.Scene_Highlights.Y -= 0.001f; FlareSettings.Scene_Highlights.Z -= 0.001f; LocalPlayer.PostProcessSettingsOverride = FlareSettings; } } } DefaultProperties { FlashTime = 0.5 }