Forum Thread
  Posts  
Settting a Pawn's invisibility [UT2k3] (Forums : Coding & Scripting : Settting a Pawn's invisibility [UT2k3]) Locked
Thread Options
Mar 22 2003 Anchor

Hope you guys can help me. I'm just testing out a little bit of modding UT 2003, and I wanted to make a mutator that will make you more and more invisible as you kill more and more.

Now the Big Head mutator already does something like this (the only difference is that it sets the Pawn's head size based on how many kills they have).

class MutInv extends Mutator;

function PostBeginPlay()
{
local BigHeadRules G;

Super.PostBeginPlay();
G = spawn(class'BigHeadRules');
G.BigHeadMutator = self;
if ( Level.Game.GameRulesModifiers == None )
Level.Game.GameRulesModifiers = G;
else
Level.Game.GameRulesModifiers.AddGameRules(G);
}

function float GetHeadScaleFor(Pawn P)
{
local float NewScale;

if ( abs(P.PlayerReplicationInfo.Deaths) < 1 )
NewScale = P.PlayerReplicationInfo.Score + 1;
else
NewScale = (P.PlayerReplicationInfo.Score+1)/(P.PlayerReplicationInfo.Deaths+1);
return FClamp(NewScale, 0.5, 4.0);
}

function ModifyPlayer(Pawn Other)
{
Other.SetInvisibility(GetHeadScaleFor(Other));

if ( NextMutator != None )
NextMutator.ModifyPlayer(Other);
}

defaultproperties
{
IconMaterialName="MutatorArt.nosym"
ConfigMenuClassName=""
GroupName="BigHead"
FriendlyName="Invisibility"
Description="Invisibility depends on how well you are doing."
}

Now on the line that starts Other.SetInvisibility, I get a compiling error.

Unrecognized member "SetInvisibility" in class "Pawn". After looking back at the ComboInv class (which lets you go invisible when you have 100 adrenaline) I noticed that the function passes in an xPawn instead of the Pawn that is passed in with my function.

My question is, what do you think I need to change to make this work? Is there another method for the Pawn class that lets me set invisibility?

Thanks

--

- n00bie programmer -

Mar 22 2003 Anchor

Well I figured it out.

And I found out that I'm really stupid. The SetInvisibility method only lets you put in the time in which you are invisible, not the amount of invisibility you have :P

So now I'm making a "Newbie Helper" which helps out people with a Kill-to-Death ratio less than 1.

--

- n00bie programmer -

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.