UE2:Mutator (UT2004)

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 09:42, 2 March 2009 by imported>Wormbo (→‎Mutate: added description and explained unofficial kick notification protocol)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
UT2004 Object >> Actor >> Info >> Mutator
Package: 
Engine
Known custom subclass:
Eliot/LevelConfigManager

Mutator.

Mutators allow modifications to gameplay while keeping the game rules intact. Mutators are given the opportunity to modify player login parameters with ModifyLogin(), to modify player pawn properties with ModifyPlayer(), to change the default weapon for players with GetDefaultWeapon(), or to modify, remove, or replace all other actors when they are spawned with CheckRelevance(), which is called from the PreBeginPlay() function of all actors except those (Decals, Effects and Projectiles for performance reasons) which have bGameRelevant==true.

Properties

Property group 'Mutator'

ConfigMenuClassName

Type: string

Modifiers: cache


Description

Type: string

Modifiers: localized, cache


FriendlyName

Type: string

Modifiers: localized, cache


GroupName

Type: string

Modifiers: cache

Will only allow one mutator with this tag to be selected.

IconMaterialName

Type: string

Modifiers: cache


Default value: "MutatorArt.nosym"

Internal variables

bAddToServerPackages

Type: bool

if true, the package this mutator is in will be added to serverpackages at load time

bUserAdded

Type: bool

mc - mutator was added by user (cmdline or mutator list)

DefaultWeapon

Type: class<Weapon>


DefaultWeaponName

Type: string


NextMutator

Type: Mutator


Functions

Events

Destroyed

event Destroyed ()

Overrides: Actor.Destroyed


OverrideDownload

event bool OverrideDownload (string PlayerIP, string PlayerID, string PlayerURL, out string RedirectURL)


PreBeginPlay

event PreBeginPlay ()

Overrides: Actor.PreBeginPlay


Other instance functions

AddMutator

function AddMutator (Mutator M)


AlwaysKeep

function bool AlwaysKeep (Actor Other)


CanEnterVehicle

function bool CanEnterVehicle (Vehicle V, Pawn P)


CanLeaveVehicle

function bool CanLeaveVehicle (Vehicle V, Pawn P)


CheckRelevance

function bool CheckRelevance (Actor Other)


CheckReplacement

function bool CheckReplacement (Actor Other, out byte bSuperRelevant)


DriverEnteredVehicle

function DriverEnteredVehicle (Vehicle V, Pawn P)


DriverLeftVehicle

function DriverLeftVehicle (Vehicle V, Pawn P)


GetDefaultWeapon

function class<WeaponGetDefaultWeapon ()


GetInventoryClass

function class<InventoryGetInventoryClass (string InventoryClassName)


GetInventoryClassOverride

function string GetInventoryClassOverride (string InventoryClassName)


GetServerDetails

function GetServerDetails (out GameInfo.ServerResponseLine ServerState)


GetServerPlayers

function GetServerPlayers (out GameInfo.ServerResponseLine ServerState)


IsRelevant

function bool IsRelevant (Actor Other, out byte bSuperRelevant)


ModifyLogin

function ModifyLogin (out string Portal, out string Options)


ModifyPlayer

function ModifyPlayer (Pawn Other)


Mutate

function Mutate (string MutateString, PlayerController Sender)

Called by a PlayerController when the player executes a "mutate" console command. Everything after the command name "mutate" is passed to this function as a raw string, which you will have to parse yourself. Keep in mind that this function is called for every possible mutate command a player may use, so make sure you always call Super.Mutate(MutateString, Sender); to ensure all other mutators get a chance to parse their mutate commands. Always make sure Sender is not None. (see below)

Note: The SafeGame anti-cheat mod introduced an unofficial protocol for player kick notifications that is based on this Mutate function with the Sender parameter being None. According to this protocol, which is also used or recognized by other mods, such as the UTAN mutator or Anti TCC, kick notifications can be sent to all mutators by using a MutateString formatted as follows:

KickedBy parameters

The parameters string contains the following fields, which are separated by the character that is returned by Chr(254):

  1. Mod name: This is the name of the mod that kicked a player, for example SafeGame, AntiTCC or UTAN.
  2. Player name: The exact, current name of the player being kicked.
  3. Zero or more other parameters: These are separated by Chr(254) as well and their meaning depends on the mod.
    For UTAN this is the ban ID, SafeGame and AntiTCC put details such as the GUID, IP and other player-specific information here, as well as a kick reason.

MutatorFillPlayInfo

function MutatorFillPlayInfo (PlayInfo PlayInfo)


MutatorIsAllowed

function bool MutatorIsAllowed ()


MyDefaultWeapon

function class<WeaponMyDefaultWeapon ()


NewRecommendCombo

function string NewRecommendCombo (string ComboName, AIController C)


NotifyLogout

function NotifyLogout (Controller Exiting)


ParseChatPercVar

function string ParseChatPercVar (Controller Who, string Cmd)


PlayerChangedClass

function PlayerChangedClass (Controller aPlayer)


RecommendCombo

function string RecommendCombo (string ComboName)


ReplaceWith

function bool ReplaceWith (Actor Other, string aClassName)


ServerTraveling

function ServerTraveling (string URL, bool bItems)