And if it'll help, here's the FakeHealth's code.Init: Game engine initialized
Log: Startup time: 3.026008 seconds
DevMusic: Load music: Music FlyBy.FlyBy
ScriptLog: Console leaving Typing
ScriptLog: Fabricate fakehealth.fakehealth
Log: Loading: Package fakehealth
ScriptLog: Console leaving Typing
(Here's where I touch the FakeHealth)
Critical: AActor::ProcessState
Critical: Object fakehealth Unreal.fakehealth0, Old State State fakehealth.fakehealth.Death, New State State fakehealth.fakehealth.Death
Critical: AActor::Tick
Critical: TickAllActors
Critical: ULevel::Tick
Critical: (NetMode=0)
Critical: TickLevel
Critical: UGameEngine::Tick
Critical: UpdateWorld
Critical: MainLoop
Exit: Executing UObject::StaticShutdownAfterError
Exit: UGalaxyAudioSubsystem::ShutdownAfterError
Exit: Executing UWindowsClient::ShutdownAfterError
Log: DirectDraw End Mode
Exit: UD3DRenderDevice::ShutdownAfterError
Exit: appExit
Uninitialized: Name subsystem shut down
Uninitialized: Log file closed, 02/14/08 21:58:43
Code: Select all
//=============================================================================
// FakeHealth.
// A booby (lolbooby) trapped Health pack that blows up in your face when you try to pick it up
//=============================================================================
class FakeHealth expands Decoration;
var() int damage;
var() int MomentumTransfer;
var(Display) bool bAmbientGlow;
function PostBeginPlay()
{
SetPhysics(phys_falling);
}
Auto State Blowup
{
function Trigger( actor Other, pawn EventInstigator )
{
GotoState('death');
}
function Touch(Actor Other)
{
if (other.IsA('pawn') || other.IsA('projectile') )
{
log("You were tricked!");
gotostate('death');
Disable('Touch');
}
}
function TakeDamage( int Damage, Pawn InstigatedBy, Vector Hitlocation, Vector Momentum, name DamageType)
{
log("Hit by a projectile");
gotostate('death');
Instigator = InstigatedBy;
if ( Instigator != None )
MakeNoise(1.0);
}
function Explode(vector HitLocation, vector HitNormal)
{
HurtRadius(damage, 200.0, 'exploded', MomentumTransfer, HitLocation);
Spawn(class'SpriteBallExplosion', Pawn(Owner),,HitLocation);
Destroy();
}
}
state death
{
Begin:
if (Velocity.z != 0)
ambientsound = Sound'UnrealI.flak.Hit5';
sleep(0.1);
Goto('Explode');
}