PDA

View Full Version : Newbie Mutator question



AlfonsÅberg
11-25-2007, 08:19 AM
Hi all,

I haven't scripted before and I am about to start. I got some programming skills but I am totally new to unrealscript. What I want to do is create a mutator that changes this function in Pawn.uc.

simulated function name GetDefaultCameraMode( PlayerController RequestedBy )
{
if ( RequestedBy != None && RequestedBy.PlayerCamera != None && RequestedBy.PlayerCamera.CameraStyle == 'Fixed' )
return 'Fixed';

return 'FirstPerson';
}

I want it to return 'ThirdPerson' instead. Very simple.

How do I write a mutator to do a simple thing like this?

AlfonsÅberg
11-25-2007, 10:50 AM
I figured it out all by myself. This is my solution.

function ModifyPlayer(Pawn Other)
{
if ( NextMutator != None )
NextMutator.ModifyPlayer(Other);


if ( Other.Controller != None && PlayerController(Other.Controller) != None )
PlayerController(Other.Controller).SetCameraMode(' ThirdPerson');
}