Developer & Publisher

Since early 2002, Shee Labs has been a group of individuals working to produce free game and media downloads. With ever-fluctuate staffing, Shee Labs continues working behind the scenes on various exciting projects for a bewildering array of areas. Shee Labs ceased to exist in September 2009.

Today we're going to recreate a mutator I wrote for Shee Labs Mutator Week! You can read about it here: Moddb.com

It's very short, very sweet and easy to modify to suit your needs. Once more, we're going to use a mutator and the modify player function. This time, we're going to change every players post process settings, and make it very difficult to see. We're also going to make the AI react accordingly, so they don't become too hard for the player to fight against.

We need post process settings to set out blindness, and we also need a LocalPlayer. LocalPlayer is the class that contains the post processing controls, and it's all client side, which allows us to affect players on their machines, and not worry about the effects elsewhere - because we don't need to.

First, we find the local player (lots of nasty casting - we get the controller of the pawn, then cast it into a player controller, then we find the player of the player controller, and cast it into a local player - hope your head doesn't hurt!). We then set bOverridePostProcessSettings to true, so we can edit the post processing. We then set our post process settings to the last post process settings the local player used - this way, we don't just create new settings and ignore the post processing in the level, we can modify it instead.

In my settings, I enabled depth of field and added extra bloom. You could also add things like motion blur if you wanted. I also used the colour controls to desaturate the scene, and make it very dark - which in combination with the depth of field blur, makes it difficult to see!

I finally set the local player's post process settings override to our custom settings.

To make the AI work correctly, we check out pawn is a UTPawn, and if so, we set it invisible to AI. This means that the AI won't notice players unless the players are shooting, bump into them, or some other event that makes them noticeable.

For the first life works as expected. Once I die and respawn though, the darkness effect (desaturation) goes away and only the motion blur remains.
A contributor? Also, do you think there's a way to reset it once the player is killed? So that he can see what all is around him?

LocalPlayer.PlayerController is sort of what we're doing - but LocalPlayer doesn't actually have a PlayerController variable, nor a function to retrieve it.

In order to get a LocalPlayer (so that we can access the post process settings over-rides), we need to find the correct object, and cast it into a LocalPlayer.

In this case, we find the Pawn's controller (Other.Controller) and cast it into a PlayerController. The PlayerController class has a Player object called Player, and we can cast this into a LocalPlayer. Now we can finally access the post processing.

When I start a new deathmatch game (after already playing a game with this post processing effect), etc. even if I don't add this mutator to the new match, i still get the blur effect(maybe saturation also). I tried looking at the GameRules class but am not sure if I use the GetRules() method or something else. This is the first time(me being a mutator beginner) that I have seen a mutator get embedded into every following deathmatch game(even changed game type, level, etc.). Any ideas? Thanks

Perhaps. Maybe patch 1.2 has changed a few things that make this work a bit funny - I'll have to look into it.

PostProcessSettings are stored on a user level on the client side (hence accessing the 'local player'. I wouldn't have thought motion blur would have persisted when the other settings do not - very unusual.

Put everything before the if( UTPawn (Other) != None ) conditional line in an if block with the condition of:
if( !LocalPlayer.bOverridePostProcessSettings )

This way you're checking to see if you haven't already overridden the post processing settings. If you haven't then you apply them, otherwise you don't do anything to the PP settings.

I'm not sure why the code wasn't working after one death. If anything I would think it would just make the PP effects more severe on each subsequent death as you're modifying the PP settings by the same rate each life. Perhaps some threshold values are being reached immediately after one death?