The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall

UE3:UTProjectile (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Revision as of 12:47, 6 November 2009 by (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
UDK Object >> Actor >> Projectile >> UTProjectile

Contents

Package: 
UTGame
Direct subclasses:
UTDecoy, UTProj_CicadaRocket, UTProj_Grenade, UTProj_LinkPlasma, UTProj_MantaBolt, UTProj_Rocket, UTProj_ScorpionGlob_Base, UTProj_ShockBall
This class in other games:
UT3

UTProjectile

This is our base projectile class.

Properties

AccelRate

Type: float

Acceleration magnitude. By default, acceleration is in the same direction as velocity

AmbientSound

Type: SoundCue

The sound that is played looped.

bAdvanceExplosionEffect

Type: bool

If true, this explosion effect expects to be orientated differently and have extra data passed in via parameters

bAttachExplosionToVehicles

Type: bool

If true, attach explosion effect to vehicles

Default value: True

bCheckProjectileLight

Type: bool

Make true if want to spawn ProjectileLight. Set false in TickSpecial() once it's been determined whether Instigator is local player. Done there to make sure instigator has been replicated

bImportantAmbientSound

Type: bool

If true, never cut out ambient sound for perf reasons

bShuttingDown

Type: bool

if true, the shutdown function has been called and 'new' effects shouldn't happen

bSuppressExplosionFX

Type: bool

used to prevent effects when projectiles are destroyed (see LimitationVolume)

bSuppressSounds

Type: bool

Additional Sounds

Buoyancy

Type: float

Water buoyancy. A ratio (1.0 = neutral buoyancy, 0.0 = no buoyancy)

bWaitForEffects

Type: bool

if True, this projectile will remain alive (but hidden) until the flight effect is done

bWideCheck

Type: bool

for console games (wider collision w/ enemy players)

CheckRadius

Type: float


CustomGravityScaling

Type: float

custom gravity multiplier

Default value: 1.0

DecalDissolveParamName

Type: name

MaterialInstance param name for dissolving the decal *

Default value: 'DissolveAmount'

DecalHeight

Type: float


DecalWidth

Type: float


DurationOfDecal

Type: float

How long the decal should last before fading out *

Default value: 4.0

ExplosionDecal

Type: MaterialInterface

decal for explosion

ExplosionLightClass

Type: class<UTExplosionLight>

Class of ExplosionLight

ExplosionSound

Type: SoundCue

The sound that is played when it explodes

GlobalCheckRadiusTweak

Type: float

FIXME TEMP for tweaking global checkradius

Default value: 0.5

InstigatorBaseVehicle

Type: Vehicle

if this projectile is fired by a vehicle passenger gun, this is the base vehicle considered the same as Instigator for purposes of bBlockedByInstigator

MaxEffectDistance

Type: float

This value sets the cap how far away the explosion effect of this projectile can be seen

Default value: 10000.0

MaxExplosionLightDistance

Type: float

Max distance to create ExplosionLight

Default value: 4000.0

ProjectileLight

Type: PointLightComponent

LightComponent for this projectile (spawned only if projectile fired by the local player)

ProjectileLightClass

Type: class<PointLightComponent>

Class of ProjectileLight

ProjEffects

Type: ParticleSystemComponent

This is the effect that is played while in flight

ProjExplosionTemplate

Type: ParticleSystem


ProjFlightTemplate

Type: ParticleSystem

Effects Template

TerminalVelocity

Type: float

TerminalVelocity for this projectile when falling

Default value: 3500.0

TossZ

Type: float


Default values

Property Value
bBlockedByInstigator False
bCollideComplex True
bSwitchToZeroCollision True
Components[0] CylinderComponent'CollisionCylinder'
DamageRadius 0.0

Subobjects

CollisionCylinder

Class: Engine.CylinderComponent

Inherits from: Projectile.CollisionCylinder

Property Value
ReplacementPrimitive None

Functions

Static functions

CalculateTravelTime

static final function float CalculateTravelTime (float Dist, float MoveSpeed, float MaxMoveSpeed, float AccelMag)

calculate travel time for something to move Dist units with the given movement parameters

Parameters:

  • Dist - distance to travel
  • MoveSpeed - starting speed
  • MaxMoveSpeed - maximum speed (acceleration stops being applied when we reach this)
  • AccelMag - rate of acceleration

Returns:

travel time

GetRange

simulated static function float GetRange ()

Overrides: Projectile.GetRange

returns the maximum distance this projectile can travel

StaticGetTimeToLocation

static simulated function float StaticGetTimeToLocation (Object.Vector TargetLoc, Object.Vector StartLoc, Controller RequestedBy)

Overrides: Projectile.StaticGetTimeToLocation

static version of GetTimeToLocation()

Native functions

GetTerminalVelocity

native function float GetTerminalVelocity ()

Overrides: Actor.GetTerminalVelocity

returns terminal velocity (max speed while falling) for this actor. Unless overridden, it returns the TerminalVelocity of the PhysicsVolume in which this actor is located.

Events

CreateProjectileLight

simulated event CreateProjectileLight ()

CreateProjectileLight() called from TickSpecial() once if Instigator is local player

Destroyed

simulated event Destroyed ()

Overrides: Projectile.Destroyed


GetHomingTarget

event Actor GetHomingTarget (UTProjectile Seeker, Controller InstigatedBy)


Landed

simulated event Landed (Object.Vector HitNormal, Actor FloorActor)

Overrides: Actor.Landed

Explode when the projectile comes to rest on the floor. It's called from the native physics processing functions. By default, when we hit the floor, we just explode.

PostBeginPlay

simulated event PostBeginPlay ()

Overrides: Projectile.PostBeginPlay

When this actor begins its life, play any ambient sounds attached to it

PreBeginPlay

event PreBeginPlay ()

Overrides: Projectile.PreBeginPlay


SetInitialState

simulated event SetInitialState ()

Overrides: Actor.SetInitialState


Shutdown

simulated event Shutdown ()

Overrides: Actor.ShutDown

Clean up

TornOff

event TornOff ()

Overrides: Actor.TornOff


Other instance functions

CalcCamera

simulated function bool CalcCamera (float fDeltaTime, out Object.Vector out_CamLoc, out Object.Rotator out_CamRot, out float out_FOV)

Overrides: Actor.CalcCamera

(Description copied from Actor.CalcCamera)
Calculate camera view point, when viewing this actor.

Parameters:

  • fDeltaTime - delta time seconds since last update
  • out_CamLoc - Camera Location
  • out_CamRot - Camera Rotation
  • out_FOV - Field of View

Returns:

true if Actor should provide the camera point of view.

CanSplash

simulated function bool CanSplash ()

Overrides: Projectile.CanSplash


CheckMaxEffectDistance

simulated function bool CheckMaxEffectDistance (PlayerController P, Object.Vector SpawnLocation, optional float CullDistance)

Overrides: Actor.CheckMaxEffectDistance


EffectIsRelevant

simulated function bool EffectIsRelevant (Object.Vector SpawnLocation, bool bForceDedicated, optional float CullDistance)

Overrides: Actor.EffectIsRelevant


Explode

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

Overrides: Projectile.Explode

Explode this Projectile

GetPawnOwner

simulated function Pawn GetPawnOwner ()

called when this Projectile is the ViewTarget of a local player

Returns:

the Pawn to use for rendering HUD displays

GetTimeToLocation

simulated function float GetTimeToLocation (Object.Vector TargetLoc)

Overrides: Projectile.GetTimeToLocation

returns the amount of time it would take the projectile to get to the specified location

HideProjectile

simulated function HideProjectile ()

Hide any meshes/etc.

Init

function Init (Object.Vector Direction)

Overrides: Projectile.Init

Initialize the Projectile

MyOnParticleSystemFinished

simulated function MyOnParticleSystemFinished (ParticleSystemComponent PSC)


ProcessTouch

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

Overrides: Projectile.ProcessTouch


ProjectileHurtRadius

simulated function bool ProjectileHurtRadius (float DamageAmount, float InDamageRadius, class<DamageTypeDamageType, float Momentum, Object.Vector HurtOrigin, Object.Vector HitNormal, optional class<DamageTypeImpactedActorDamageType)

Hurt locally authoritative actors within the radius. Projectile version if needed offsets the start of the radius check to prevent hits embedded in walls from failing to cause damage

SetExplosionEffectParameters

simulated function SetExplosionEffectParameters (ParticleSystemComponent ProjExplosion)

sets any additional particle parameters on the explosion effect required by subclasses

ShouldSpawnExplosionLight

simulated function bool ShouldSpawnExplosionLight (Object.Vector HitLocation, Object.Vector HitNormal)

ShouldSpawnExplosionLight() Decide whether or not to create an explosion light for this explosion

SpawnExplosionEffects

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

Spawn Explosion Effects

SpawnFlightEffects

simulated function SpawnFlightEffects ()

Spawns any effects needed for the flight of this projectile

States

WaitingForVelocity

state used only on the client for projectiles with AccelRate > 0 to wait for Velocity to be replicated so we can use it to set Acceleration the alternative would be to make Velocity repnotify in Actor.uc, but since many Actors (such as Pawns) change their velocity very frequently, that would have a greater performance hit

WaitingForVelocity.Tick

simulated event Tick (float DeltaTime)

Overrides: Actor.Tick (global)