UnrealScript: Creating a Basic Mutator


simulated event PostRender( canvas Canvas );
Draws on canvas like postrender in other classes.

function ModifyPlayer(Pawn Other)
Takes parameter Other (player) so that the mutator can modify it.

function bool HandleRestartGame()
Calls restart game mutator function as would the game's restart game function be called.

function bool HandleEndGame()
Calls end game mutator function as would the game's end game function be called.

function bool HandlePickupQuery(Pawn Other, Inventory item, out byte bAllowPickup)
Calls mutator pickup function as would an inventory pickup function be called.

function bool PreventDeath(Pawn Killed, Pawn Killer, name damageType, vector HitLocation)
Handles a would-be normal death according to the mutator.

function ModifyLogin(out class<playerpawn> SpawnClass, out string Portal, out string Options)
Can be used to change player properties, class, etc. at the beginning of the game.

function ScoreKill(Pawn Killer, Pawn Other)
Game calls scorekill mutator function as it would the game's scorekill.

function Class<Weapon> MutatedDefaultWeapon()
return what should replace the default weapon mutators further down the list override earlier mutators

function bool ReplaceWith(actor Other, string aClassName)
Replaces an actor Other with string-to-actor aClassName via DynamicLoadObject.

function bool AlwaysKeep(Actor Other)
Forces game to keep mutator even though others might have wanted to remove it.

function bool IsRelevant(Actor Other, out byte bSuperRelevant)
Removes actors that are not relevant to the game with respect to the mutator.

function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
Takes a parameter Other which can be used to compare to actors in default game. The second parameter acts as basically as a bool (no out bools allowed) which returns if super class is relevant.

function Mutate(string MutateString, PlayerPawn Sender)
Works sort of like an exec function. Players can use this to execute console commands. E.g. "mutate bdbmapvote votemenu"

function MutatorTakeDamage( out int ActualDamage, Pawn Victim, Pawn InstigatedBy, out Vector HitLocation, out Vector Momentum, name DamageType)
Modifies taking damage in game.

simulated function RegisterHUDMutator()
Registers the current mutator on the client to receive PostRender calls.

 

An example file: WeaponPackTest.zip(5K)