First, log:
Code: Select all
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.ProcessMove:00B5) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.PlayerMove:0256) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.ProcessMove:00B5) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.PlayerMove:0256) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.ProcessMove:00B5) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.PlayerMove:0256) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.ProcessMove:00B5) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.PlayerMove:0256) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.ProcessMove:00B5) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.PlayerMove:0256) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.ProcessMove:00B5) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.PlayerMove:0256) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.ProcessMove:00B5) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.PlayerMove:0256) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.ProcessMove:00B5) GetAnimGroup: No mesh
ScriptLog: StartDeactivate()
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.PlayerMove:0256) GetAnimGroup: No mesh
Log: RPG_LionPlatformer Autoplay.RPG_LionPlatformer0 (Function Engine.PlayerPawn.PlayerWalking.ProcessMove:00B5) GetAnimGroup: No mesh
ScriptLog: PlayDeactivate()
Code: Select all
//=============================================================================
// RPG_Cannon.
// TeamCannon from UT99, no team alliance and begins firing.
// Cannot be destroyed.
//=============================================================================
class RPG_Cannon extends RPG_StationaryPawn;
var() localized string PreKillMessage, PostKillMessage;
var() Class<Projectile> ProjectileType;
var() sound FireSound;
var() sound ActivateSound;
var() sound DeActivateSound;
var() bool bLeadTarget;
var bool bShoot;
var float Drop; // How far down to drop spawning of projectile
var float SampleTime; // How often we sample Instigator's location
var int TrackingRate; // How fast Cannon tracks Instigator
var rotator StartingRotation;
function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType);
function Died(pawn Killer, name damageType, vector HitLocation);
//=============================================================================
// General functionality
//=============================================================================
function PostBeginPlay()
{
Super.PostBeginPlay();
StartingRotation = Rotation;
}
simulated function Destroyed()
{
Super.Destroyed();
}
function string KillMessage( name damageType, pawn Other )
{
return (PreKillMessage@Other.PlayerReplicationInfo.PlayerName@PostKillMessage);
}
function Trigger( actor Other, pawn EventInstigator )
{
log("Was Triggered");
GotoState('DeActivated');
}
/*simulated function SpawnBase()
{
GunBase = Spawn(class'CeilingGunBase', self);
}*/
//=============================================================================
// Sounds
//=============================================================================
function PlayDeactivate()
{
log("PlayDeactivate()");
PlaySound(ActivateSound, SLOT_None,5.0);
}
function PlayActivate()
{
log("PlayActivate()");
PlaySound(ActivateSound, SLOT_None, 2.0);
}
//=============================================================================
// Combat
//=============================================================================
function StartDeactivate()
{
log("StartDeactivate()");
SetPhysics(PHYS_Rotating);
DesiredRotation = StartingRotation;
}
function DropAdjust()
{
log("DropAdjust()");
if (DesiredRotation.Pitch < -13400 )
{
Drop = 35;
}
else if (DesiredRotation.Pitch < -10600 )
{
Drop = 30;
}
else if (DesiredRotation.Pitch < -7400 )
{
Drop = 25;
}
else if (DesiredRotation.Pitch < -4200 )
{
Drop = 20;
}
else if (DesiredRotation.Pitch < -1000 )
{
Drop = 15;
}
else
{
Drop = 10;
}
log("Drop ="$Drop);
}
function Shoot()
{
local Vector FireSpot, ProjStart;
local Projectile p;
// if (DesiredRotation.Pitch < -20000) Return;
DropAdjust();
PlaySound(FireSound, SLOT_None,5.0);
ProjStart = Location+Vector(DesiredRotation)*100 - Vect(0,0,1)*Drop;
log("Shoot");
if ( bLeadTarget )
{
FireSpot = Target.Location + FMin(1, 0.7 + 0.6 * FRand()) * (Target.Velocity * VSize(Target.Location - ProjStart)/ProjectileType.Default.Speed);
if ( !FastTrace(FireSpot, ProjStart) )
FireSpot = 0.5 * (FireSpot + Target.Location);
DesiredRotation = Rotator(FireSpot - ProjStart);
}
p = Spawn (ProjectileType,,,ProjStart,DesiredRotation);
bShoot=False;
SetTimer(0.05,True);
}
//=============================================================================
// States
//=============================================================================
auto state Idle
{
ignores EnemyNotVisible;
function SeePlayer(Actor SeenPlayer)
{
local RPG_PlatformPawn PlatformPawn;
if ( SeenPlayer.bCollideActors && ( ( Pawn(SeenPlayer) == class'RPG_PlatformPawn' ) ) )
{
Enemy = Pawn(SeenPlayer);
GotoState('ActiveCannon');
}
}
function BeginState()
{
log("BeginState - Idle");
Enemy = None;
}
Begin:
Sleep(5.0);
StartDeactivate();
Sleep(0.0);
PlayDeactivate();
Sleep(2.0);
SetPhysics(PHYS_None);
}
/*state DeActivated
{
ignores SeePlayer, EnemyNotVisible;
Begin:
Enemy = None;
StartDeactivate();
Sleep(0.0);
PlayDeactivate();
Sleep(6.0);
SetPhysics(PHYS_None);
}*/
state ActiveCannon
{
ignores SeePlayer;
function EnemyNotVisible()
{
local Pawn P;
log("EnemyNotVisible - ActiveCannon");
Enemy = None;
for ( P=Level.PawnList; P!=None; P=P.NextPawn )
if ( ( P.bCollideActors && P.bIsPlayer ) && (P.Health > 0) && !P.IsA('RPG_Cannon') && LineOfSightTo(P) )
{
log("EnemyFound - EnemyNotVisible - ActiveCannon");
Enemy = P;
return;
}
GotoState('Idle');
}
function Timer()
{
DesiredRotation = rotator(Enemy.Location - Location);
Shoot();
bShoot=True;
SetTimer(SampleTime,True);
}
function BeginState()
{
Target = Enemy;
}
Begin:
Disable('Timer');
PlayActivate();
Enable('Timer');
SetTimer(SampleTime,True);
RotationRate.Yaw = TrackingRate;
SetPhysics(PHYS_Rotating);
bShoot=True;
FaceEnemy:
TurnToward(Enemy);
Goto('FaceEnemy');
}
state GameEnded
{
ignores SeePlayer, HearNoise, KilledBy, Bump, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, TakeDamage, WarnTarget, Died;
function BeginState()
{
Destroy();
}
}
defaultproperties
{
Health=1
}