Got the powerups respawning properly when the player is restarted. I still can't get subversion running on this machine, so someone will have to merge these changes on my behalf. It's all pretty simple anyway. I'll have that posted on here ASAP.
Edit: Here it is, shouldn't take long to merge.
Super speed pickup.
class FiveWeek_PickupFactorySuperSpeed extends UTPowerupPickupFactory;
State WaitingForMatch
{
ignores Touch;
function MatchStarting()
{
GotoState('Pickup');
}
event BeginState(Name PreviousStateName)
{
SetPickupVisible();
}
}
defaultproperties
{
InventoryType=class'FiveWeek.FiveWeek_SuperSpeed'
BaseBrightEmissive=(R=50.0,G=1.0)
BaseDimEmissive=(R=5.0,G=0.1)
RespawnSound=SoundCue'A_Pickups_Powerups.PowerUps.A_Powerup_Berzerk_SpawnCue'
Begin Object Class=UTParticleSystemComponent Name=BerserkParticles
Template=ParticleSystem'Pickups.Berserk.Effects.P_Pickups_Berserk_Idle'
bAutoActivate=false
SecondsBeforeInactive=1.0f
Translation=(X=0.0,Y=0.0,Z=+5.0)
End Object
ParticleEffects=BerserkParticles
Components.Add(BerserkParticles)
Begin Object Class=AudioComponent Name=BerserkReady
SoundCue=SoundCue'A_Pickups_Powerups.PowerUps.A_Powerup_Berzerk_GroundLoopCue'
End Object
PickupReadySound=BerserkReady
Components.Add(BerserkReady)
bHasLocationSpeech=false
}
Super Speed object.
/**
* Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
*/
class FiveWeek_SuperSpeed extends UTTimedPowerup;
/** sound played when the UDamage is running out */
var SoundCue SpeedFadingSound;
/** ambient sound played while active*/
var SoundCue SpeedAmbientSound;
/** last time we played that sound, so it isn't too often */
var float LastSpeedSoundTime;
/** overlay material applied to owner */
var MaterialInterface OverlayMaterialInstance;
function GivenTo(Pawn NewOwner, bool bDoNotActivate)
{
local UTPawn P;
Super.GivenTo(NewOwner, bDoNotActivate);
// boost speed
NewOwner.GroundSpeed = 1600;
NewOwner.AirSpeed = 1600;
NewOwner.AccelRate = 400;
P = UTPawn(NewOwner);
if (P != None)
{
// apply overlay
P.SetOverlayMaterial(OverlayMaterialInstance);
P.SetPawnAmbientSound(SpeedAmbientSound);
}
// set timer for ending sounds
SetTimer(TimeRemaining - 3.0, false, 'PlaySpeedFadingSound');
}
function ItemRemovedFromInvManager()
{
local UTPlayerReplicationInfo UTPRI;
local UTPawn P;
Pawn(Owner).GroundSpeed = 800;
Pawn(Owner).AirSpeed = 800;
Pawn(Owner).AccelRate = 100;
for (i = 0; i <FiveWeek_Game(WorldInfo.Game).SuperSpeedFactories.length; i++)
{
FiveWeek_Game(WorldInfo.Game).SuperSpeedFactories[i].GotoState('Pickup');
FiveWeek_Game(WorldInfo.Game).SuperSpeedFactories[i].SetPickupVisible();
}
P = UTPawn(Owner);
if (P != None)
{
//clear overlay
//P.ClearOverlay(OverlayMaterialInstance);
P.SetOverlayMaterial(None);
P.SetPawnAmbientSound(none);
//Stop the timer on the powerup stat
if (P.DrivenVehicle != None)
{
UTPRI = UTPlayerReplicationInfo(P.DrivenVehicle.PlayerReplicationInfo);
}
else
{
UTPRI = UTPlayerReplicationInfo(P.PlayerReplicationInfo);
}
if (UTPRI != None)
{
UTPRI.StopPowerupTimeStat(GetPowerupStatName());
}
}
SetTimer(0.0, false, 'PlaySpeedFadingSound');
}
/** called on a timer to play UDamage ending sound */
function PlaySpeedFadingSound()
{
// reset timer if time got added
if (TimeRemaining > 3.0)
{
SetTimer(TimeRemaining - 3.0, false, 'PlaySpeedFadingSound');
}
else
{
Instigator.PlaySound(SpeedFadingSound);
SetTimer(0.75, false, 'PlaySpeedFadingSound');
}
}
defaultproperties
{
PickupMessage="SUPER SPEED!!!"
SpeedFadingSound=SoundCue'A_Pickups_Powerups.PowerUps.A_Powerup_UDamage_WarningCue'
OverlayMaterialInstance=Material'PICKUPS.UDamage.M_UDamage_Overlay'
SpeedAmbientSound=SoundCue'A_Pickups_Powerups.PowerUps.A_Powerup_UDamage_PowerLoopCue'
PowerupOverSound=SoundCue'A_Pickups_Powerups.PowerUps.A_Powerup_UDamage_EndCue'
PowerupStatName="POWERUPTIME_UDAMAGE"
IconCoords=(U=792.000000,V=41.000000,UL=43.000000,VL=58.000000)
PP_Scene_HighLights=(X=-0.100000,Y=0.040000,Z=-0.200000)
bRenderOverlays=True
bReceiveOwnerEvents=True
PickupSound=SoundCue'A_Pickups_Powerups.PowerUps.A_Powerup_UDamage_PickupCue'
Begin Object Class=StaticMeshComponent Name=MeshComponentA ObjName=MeshComponentA Archetype=StaticMeshComponent'Engine.Default__StaticMeshComponent'
StaticMesh=StaticMesh'PICKUPS.UDamage.Mesh.S_Pickups_UDamage'
CullDistance=8000.000000
CachedCullDistance=8000.000000
bUseAsOccluder=False
CastShadow=False
bForceDirectLightMap=True
bCastDynamicShadow=False
CollideActors=False
BlockRigidBody=False
Translation=(X=0.000000,Y=0.000000,Z=5.000000)
Scale3D=(X=0.600000,Y=0.600000,Z=0.600000)
Name="MeshComponentA"
ObjectArchetype=StaticMeshComponent'Engine.Default__StaticMeshComponent'
End Object
DroppedPickupMesh=MeshComponentA
PickupFactoryMesh=MeshComponentA
Begin Object Class=UTParticleSystemComponent Name=PickupParticles ObjName=PickupParticles Archetype=UTParticleSystemComponent'UTGame.Default__UTParticleSystemComponent'
Template=ParticleSystem'PICKUPS.UDamage.Effects.P_Pickups_UDamage_Idle'
bAutoActivate=False
Translation=(X=0.000000,Y=0.000000,Z=5.000000)
Name="PickupParticles"
ObjectArchetype=UTParticleSystemComponent'UTGame.Default__UTParticleSystemComponent'
End Object
DroppedPickupParticles=PickupParticles
//Begin Object Class=SpriteComponent Name=Sprite ObjName=Sprite Archetype=SpriteComponent'UTGame.Default__UTTimedPowerup:Sprite'
// ObjectArchetype=SpriteComponent'UTGame.Default__UTTimedPowerup:Sprite'
//End Object
//Components(0)=Sprite
Name="SuperSpeed"
ObjectArchetype=UTTimedPowerup'UTGame.Default__UTTimedPowerup'
}
Five Week Game
var array <Actor> out_Speed, out_Time;
var array <FiveWeek_PickupFactorySuperSpeed> SuperSpeedFactories;
var array <FiveWeek_BonusTime> BonusTimeFactories;
//message displayed on PlayerController when leaving the startVolume
var() String startGameMessage;
simulated function PostBeginPlay()
{
local int i;
Super.PostBeginPlay();
if (FindActorsOfClass(class'FiveWeek_PickupFactorySuperSpeed', out_Speed))
{
for (i = 0; i < out_Speed.length; i++)
{
SuperSpeedFactories[i] = FiveWeek_PickupFactorySuperSpeed(out_Speed[i]);
}
}
if (FindActorsOfClass(class'FiveWeek_BonusTime', out_Time))
{
for (i = 0; i < out_Speed.length; i++)
{
BonusTimeFactories[i] = FiveWeek_BonusTime(out_Time[i]);
}
}
}
function RestartPlayer(Controller aPlayer)
{
local int i;
super.RestartPlayer(aPlayer);
if(PlayerController(aPlayer) != None)
PlayerController(aPlayer).SetCameraMode('ThirdPerson');
for (i = 0; i <SuperSpeedFactories.length; i++)
{
SuperSpeedFactories[i].GotoState('Pickup');
SuperSpeedFactories[i].SetPickupVisible();
}
for (i = 0; i <BonusTimeFactories.length; i++)
{
BonusTimeFactories[i].GotoState('Pickup');
BonusTimeFactories[i].SetPickupVisible();
}
}
Edited by ambershee, 03 May 2008 - 01:12 PM.