Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

Difference between revisions of "Unreal Editor"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(New page: Class ownage extends Mutator; var array<AGP_PlayerStart> Spots; var bool bdoing; event PreBeginPlay() { Level.Game.BaseMutator.AddMutator(self); } event Tick (float DeltaTime) { loc...)
 
(Redirecting to Unreal Editor overview)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
Class ownage extends Mutator;
+
#REDIRECT [[Unreal Editor overview]]
 
+
var array<AGP_PlayerStart> Spots;
+
var bool bdoing;
+
 
+
event PreBeginPlay()
+
{
+
Level.Game.BaseMutator.AddMutator(self);
+
}
+
 
+
event Tick (float DeltaTime)
+
{
+
local PlayerController PC;
+
 
+
foreach Level.DynamicActors(Class'PlayerController',PC)
+
{
+
if ((PC.PlayerReplicationInfo.bDead == True) && (PC.playerreplicationinfo.team.teamindex != 255) && PC.bInitialAuthComplete == true && (bdoing == false))
+
{
+
bdoing = true;
+
respawn(PC);
+
}
+
}
+
}
+
 
+
function respawn(PlayerController Sender)
+
{
+
local AGP_PlayerStart StartSpot;
+
local int i;
+
 
+
i = 0;
+
 
+
foreach Level.AllActors(Class'AGP_PlayerStart',StartSpot)
+
{
+
if (StartSpot.TeamNumber == Sender.PlayerReplicationInfo.Team.TeamIndex)
+
{
+
Spots[i] = StartSpot;
+
i++;
+
}
+
}
+
 
+
if (Spots.Length == 0)
+
{
+
    AGP_Gameinfo(level.game).EnterSpectatorMode(Sender);
+
    HumanController(Sender).ClientResetSpectator();
+
Sender.PlayerReplicationInfo.bDead = true;
+
bdoing = false;
+
return;
+
}
+
 
+
StartSpot = Spots[Rand(Spots.Length)];
+
 
+
  if ( StartSpot == None )
+
  {
+
    AGP_Gameinfo(level.game).EnterSpectatorMode(Sender);
+
    HumanController(Sender).ClientResetSpectator();
+
Sender.PlayerReplicationInfo.bDead = true;
+
bdoing = false;
+
return;
+
  }
+
Sender.Pawn = Spawn(Sender.PawnClass,,,StartSpot.Location,StartSpot.Rotation);
+
  if ( sender.Pawn == None )
+
  {
+
    sender.GotoState('Dead');
+
bdoing = false;
+
    return;
+
}
+
else if(Sender.Pawn != None)
+
{
+
Sender.Possess(Sender.Pawn);
+
Sender.ClientSetRotation(Sender.Pawn.Rotation);
+
Sender.PlayerReplicationInfo.bDead = false;
+
Sender.PlayerReplicationInfo.bOutOfLives = false;
+
Sender.PlayerReplicationInfo.bIsSpectator = false;
+
HumanController(Sender).SetStartupStage(1);
+
Sender.bGodMode = True;
+
settimer(8,false);
+
bdoing = false;
+
}
+
}
+
 
+
function timer()
+
{
+
local PlayerController PC;
+
 
+
foreach Level.AllActors(Class'PlayerController',PC)
+
{
+
PC.bGodMode = false;
+
}
+
}
+
 
+
defaultproperties
+
{
+
bdoing=false;
+
}<uscript><uscript>Insert code</uscript></uscript>
+

Latest revision as of 05:19, 15 December 2008