Worst-case scenario: the UEd Goblin wipes the map and burns down your house.

Difference between revisions of "UE1:BruteProjectile (UT)"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Auto-generated page)
 
m (+section "Bugs")
Line 115: Line 115:
 
====Flying.BlowUp====
 
====Flying.BlowUp====
 
{{code|function '''BlowUp''' ({{tl|Vector|Object|structs}} '''HitLocation''')}}
 
{{code|function '''BlowUp''' ({{tl|Vector|Object|structs}} '''HitLocation''')}}
 
+
Sub routine for function Explode(). (See also [[UE1:BruteProjectile_(UT)#Access_Nones|Bugs]].)
<!-- enter function description -->
+
  
 
====Flying.Explode====
 
====Flying.Explode====
Line 134: Line 133:
 
====Flying.SetUp====
 
====Flying.SetUp====
 
{{code|function '''SetUp''' ()}}
 
{{code|function '''SetUp''' ()}}
 +
Initialisation of the projectile, called by ''BeginState''. (See also [[UE1:BruteProjectile_(UT)#ScriptedPawn.28Instigator.29.ProjectileSpeed|Bugs]].)
  
<!-- enter function description -->
+
== Bugs ==
 +
=== ScriptedPawn(Instigator).ProjectileSpeed ===
 +
If the instigator is a [[Legacy:ScriptedPawn|ScriptedPawn]], its ''ProjectileSpeed'' is not taken into account. A correct version of function ''SetUp'' could be: <uscript>
 +
function SetUp()
 +
{
 +
PlaySound(SpawnSound);
 +
if ( ScriptedPawn(Instigator) != None )
 +
{
 +
Speed = ScriptedPawn(Instigator).ProjectileSpeed;
 +
if ( Instigator.IsA('LesserBrute') )
 +
Damage *= 0.7;
 +
}
 +
Velocity = Vector(Rotation) * speed; // this assignment needs to be after modifying *speed*
 +
}</uscript>
 +
 
 +
=== Access Nones ===
 +
If the instigator is destroyed before the projectile explodes, a ScriptWarning is issued when the projectile explodes. A possible better version of function ''BlowUp'' could be:
 +
<uscript>
 +
function BlowUp(vector HitLocation)
 +
{
 +
local fload DamageRadius;
 +
if (instigator != None) DamageRadius = instigator.skill * 45;
 +
HurtRadius(damage, 50 + DamageRadius, 'exploded', MomentumTransfer, HitLocation);
 +
MakeNoise(1.0);
 +
PlaySound(ImpactSound);
 +
}
 +
</uscript>

Revision as of 21:56, 12 July 2018

UT Object >> Actor >> Projectile >> BruteProjectile
Package: 
UnrealShare
Direct subclass:
MercRocket
This class in other games:
RTNP, U1

BruteProjectile.

Properties

TimerDelay

Type: float


Default values

Property Value
AmbientGlow 9
AmbientSound Sound'UnrealShare.General.BRocket'
bUnlit True
Damage 30.0
DrawScale 0.12
ImpactSound Sound'UnrealShare.flak.Explode1'
LifeSpan 8.0
LightBrightness 154
LightHue 24
LightRadius 2
LightSaturation 207
LightType LT_Steady
MaxSpeed 900.0
Mesh LodMesh'UnrealShare.srocket'
MomentumTransfer 50000
RemoteRole ROLE_SimulatedProxy
SoundPitch 73
SoundRadius 15
SoundVolume 255
SpawnSound Sound'UnrealShare.Eightball.Ignite'
Speed 700.0
Texture None

States

Flying

Modifiers: auto

Flying.AnimEnd

simulated event AnimEnd ()

Overrides: Actor.AnimEnd (global)


Flying.BeginState

simulated event BeginState ()

Overrides: Object.BeginState (global)


Flying.Timer

simulated event Timer ()

Overrides: Actor.Timer (global)


Flying.BlowUp

function BlowUp (Object.Vector HitLocation)

Sub routine for function Explode(). (See also Bugs.)

Flying.Explode

simulated function Explode (Object.Vector HitLocation, Object.Vector HitNormal)

Overrides: Projectile.Explode (global)


Flying.ProcessTouch

simulated function ProcessTouch (Actor Other, Object.Vector HitLocation)

Overrides: Projectile.ProcessTouch (global)


Flying.SetUp

function SetUp ()

Initialisation of the projectile, called by BeginState. (See also Bugs.)

Bugs

ScriptedPawn(Instigator).ProjectileSpeed

If the instigator is a ScriptedPawn, its ProjectileSpeed is not taken into account. A correct version of function SetUp could be:

function SetUp()
{
	PlaySound(SpawnSound);
	if ( ScriptedPawn(Instigator) != None )
	{
		Speed = ScriptedPawn(Instigator).ProjectileSpeed;
		if ( Instigator.IsA('LesserBrute') )
			Damage *= 0.7;
	}
	Velocity = Vector(Rotation) * speed; // this assignment needs to be after modifying *speed*
}

Access Nones

If the instigator is destroyed before the projectile explodes, a ScriptWarning is issued when the projectile explodes. A possible better version of function BlowUp could be:

function BlowUp(vector HitLocation)
{
local fload DamageRadius;
	if (instigator != None) DamageRadius = instigator.skill * 45;
	HurtRadius(damage, 50 + DamageRadius, 'exploded', MomentumTransfer, HitLocation);
	MakeNoise(1.0);
	PlaySound(ImpactSound);
}