Thanks for the help so far,
Ive got a pickup subclass and have copied then modified the standard invis code for my needs..
I also made one of those player starts (from another thread) that spawns you with the pickup..
OK 2 probs :
1.When you first enter the game you dont get my pickup, only when you respawn.
2.If I join a dedicated server then my view doesnt go foggy like invis usually does ? - everything else like the messages work though..
Also can anyone tell me how i would message someones name in it ?
Like so when a player recieves my pickup i could message players to say: 'so and so' " just respawned."
------------------------------------------------------------------------------------
Ive got a pickup subclass and have copied then modified the standard invis code for my needs..
I also made one of those player starts (from another thread) that spawns you with the pickup..
OK 2 probs :
1.When you first enter the game you dont get my pickup, only when you respawn.
2.If I join a dedicated server then my view doesnt go foggy like invis usually does ? - everything else like the messages work though..
Also can anyone tell me how i would message someones name in it ?
Like so when a player recieves my pickup i could message players to say: 'so and so' " just respawned."
------------------------------------------------------------------------------------
Code:
//=============================================================================
// SFInvSpawn.
//=============================================================================
class SFInvSpawn expands Pickup;
var byte TempVis;
var() localized string TimeMessage[2];
var int TimeCharge, RemainingTime;
function Invisibility (bool Vis)
{
if (Pawn(Owner)==None) Return;
if( Vis )
{
PlaySound(ActivateSound,,4.0);
if ( PlayerPawn(Owner) != None )
PlayerPawn(Owner).ClientAdjustGlow(-0.15, vect(156.25,156.25,351.625));
Pawn(Owner).Visibility = 10;
Pawn(Owner).bHidden=True;
if ( Pawn(Owner).Weapon != None )
Pawn(Owner).Weapon.bOnlyOwnerSee=False;
}
else
{
PlaySound(DeActivateSound);
if ( PlayerPawn(Owner) != None )
PlayerPawn(Owner).ClientAdjustGlow(0.15, vect(-156.25,-156.25,-351.625));
Pawn(Owner).Visibility = Pawn(Owner).Default.Visibility;
if ( Pawn(Owner).health > 0 )
Pawn(Owner).bHidden=False;
if ( Pawn(Owner).Weapon != None )
Pawn(Owner).Weapon.bOnlyOwnerSee=True;
}
}
state Activated
{
function endstate()
{
Invisibility(False);
bActive = false;
}
function Timer()
{
Owner.bHidden=True;
Pawn(Owner).Visibility = 10;
bActivatable = False;
TimeCharge++;
if (TimeCharge > 10)
{
Pawn(Owner).ClientMessage(ExpireMessage);
if ( Pawn(Owner) != None )
{
Pawn(Owner).NextItem();
if (Pawn(Owner).SelectedItem == Self)
{
Pawn(Owner).NextItem();
if (Pawn(Owner).SelectedItem == Self) Pawn(Owner).SelectedItem=None;
}
}
Owner.PlaySound(DeactivateSound);
Destroy();
}
if ( TimeCharge <= 10 )
{
RemainingTime--;
switch (RemainingTime)
{
case 10:
Pawn(Owner).ClientMessage(PickUpMessage, 'CriticalEvent');
break;
case 8:
Pawn(Owner).ClientMessage(TimeMessage[0]);
break;
case 5:
Pawn(Owner).ClientMessage(TimeMessage[1], 'CriticalEvent', True);
break;
case 4:
Pawn(Owner).ClientMessage(TimeMessage[0], 'CriticalEvent', True);
break;
case 3:
Pawn(Owner).ClientMessage(TimeMessage[0], 'CriticalEvent', True);
break;
case 2:
Pawn(Owner).ClientMessage(TimeMessage[0], 'CriticalEvent', True);
break;
case 1:
Pawn(Owner).ClientMessage(TimeMessage[0], 'CriticalEvent', True);
break;
}
}
}
function BeginState()
{
Invisibility(True);
TimeCharge = 0;
RemainingTime = 11;
SetTimer(1.0,True);
}
}
state DeActivated
{
Begin:
}
------------------------------------------------------------------------------------
//=============================================================================
// SFStart.
//=============================================================================
class SFStart expands PlayerStart;
function PlayTeleportEffect(actor Incoming, bool bOut)
{
local SFInvSpawn SR;
if ( Level.Game.bDeathMatch && Incoming.IsA('PlayerPawn') )
PlayerPawn(Incoming).SetFOVAngle(135);
Level.Game.PlayTeleportEffect(Incoming, bOut, Level.Game.bDeathMatch );
if(Incoming.IsA('Pawn')
&& Pawn(Incoming).bIsPlayer
&& Pawn(Incoming).FindInventoryType(class'SFInvSpawn') == None)
{
SR = Spawn(class'SFInvSpawn', Incoming,,Incoming.Location);
SR.GiveTo(Pawn(Incoming));
SR.bHeldItem = True;
SR.Activate();
Pawn(Incoming).SwitchToBestWeapon();
}
}
Last edited: