User:Crusha/UltimateMappingTools/UltimateDestructibleEnvironment

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to navigation Jump to search

UltimateDestroyableEnvironment

by Crusha K. Rool

UT2004 Object >> Actor >> Decoration >> UltimateDestroyableEnvironment (custom)
Package: 
UltimateMappingTools

Allows to set up an actor that gets more and more destroyed when it takes damage. That is done by having multiple versions of the StaticMesh that are differently high damaged.

Properties

Property group 'Events'

ResetEvent

Type: name

Triggered if bReset is True, so that you can potentially do some updates on other things as well when resetting this actor.

WrongDamageTypeEvent

Type: name

Triggered when an invalid DamageType damaged this actor.

Property group 'UltimateDestroyableEnvironment'

bBlackList

Type: bool

If true, the DamageTypes in the array can NOT damage this actor.

Default value: True

bReset

Type: bool

Reset this actor after the round ended or keep destruction the whole match?

bResetEventOnlyWhenFinalDestruction

Type: bool

If True, only fire off the ResetEvent if an LOD with bFinalDestruction has been reached in this round.

DamageTypes

Type: array<class<DamageType> >

Which DamageTypes can affect this actor?

LevelOfDestruction

Type: array<_LevelOfDestruction>

Determines the appearance of the Actor at different health levels.

TotalHealth

Type: int

The initial health of this actor.

Default value: 2000

WrongDamageEventTreshold

Type: int

Trigger an event every time this much damage has been caused by a "wrong" DamageType.

Default value: 300

Internal variables

AccumulatedWrongDamage

Type: int

This much of the wrong damage has been accumulated already.

bFinalDestructionReached

Type: bool

Used by bResetEventOnlyWhenFinalDestruction.

CurrentLOD

Type: int

This tells players who join the match in progress how the Actor currently looks like.

Default value: -1

i_temp

Type: int

Counter.

j_temp

Type: int

Remember the current array for use in GainedChild.

OldLOD

Type: int

Only change appearance if we receive a LOD value that is not the same as the old one.

Default value: -1

OriginalLocation

Type: Object.Vector

Remember for calculating offset from default in each LOD.

OriginalRotation

Type: Object.Rotator

Remember for calculating rotation offset from default in each LOD.

OriginalScale

Type: Object.Vector

Just remember this too.

OriginalStaticMesh

Type: StaticMesh

Remember for reset.

OriginalStyle

Type: Actor.ERenderStyle

Don't ask.

Default values

Property Value
bAlwaysRelevant True
bBlockActors True
bBlockKarma True
bCollideActors True
bEdShouldSnap True
bNetNotify True
bNoDelete True
bStatic False
bWorldGeometry True
DrawType DT_StaticMesh
RemoteRole ROLE_SimulatedProxy
StaticMesh StaticMesh'Albatross_architecture.Alb_crate1'

Structs

_DecoKActor

You can spawn real chunks that are physics calculated when you destroy this Actor step by step.

StaticMesh KActorStaticMesh 
This StaticMesh will be used by the KarmaThing that is spawned.
float KActorMaxNetUpdateInterval 
How often is the KActor maximally updated per second for online games. Should be about 0.5
KarmaParams KActorParameters 
Set the parameters for the new Karma object.
Object.Vector SpawnOffset 
Where does the KActor spawn in relation to the location of the StaticMesh?
Object.Rotator RotationOffset 
Which rotation does the KActor have in relation to the StaticMesh?
float KActorLifeSpan 

_LevelOfDestruction

Determines the appearance of the Actor at different health levels.

StaticMesh DestroyedStaticMesh 
The new StaticMesh that is used at this LOD.
int HealthLimit 
This LOD becomes active if the actors health drops below this.
Object.Vector StaticMeshScale 
Scale the StaticMesh by this value. Values close to 0 are ignored.
Object.Vector StaticMeshOffset 
New location of the StaticMesh in relation to the original location.
Object.Rotator StaticMeshRotation 
New rotation of the StaticMesh in relation to the original rotation.
array<_DecoKActor> KarmaDeco 
KActors to spawn at the destruction.
name TriggerEvent 
Trigger this Event once this LOD has been reached.
bool bFinalDestruction 
bool bReached 
True if this LOD has been executed already.

Functions

Events

GainedChild

simulated event GainedChild (Actor Other)

Overrides: Actor.GainedChild

This is the only place where we can assign our custom KParam as KParam of the spawned KActor before the Karma physics are initilizing.

PostBeginPlay

simulated event PostBeginPlay ()

Overrides: Actor.PostBeginPlay

Use the Health variable and keep TotalHealth as backup.

PostNetReceive

simulated event PostNetReceive ()

Overrides: Actor.PostNetReceive

This updates the visuals and collision on the client to the current LOD when the variable changes on the server or when the player just joined.

TakeDamage

event TakeDamage (int NDamage, Pawn instigatedBy, Object.Vector hitlocation, Object.Vector momentum, class<DamageTypedamageType)

Overrides: Decoration.TakeDamage

Process damage on this actor and change it's appearance if a DamageLimit is reached.

Trigger

event Trigger (Actor Other, Pawn EventInstigator)

Overrides: Decoration.Trigger

Triggering will cause the actor to lose all health that is the difference to the next lower LOD, i.e. cause it to active the next LOD.

Other instance functions

AssignKarmaThingProperties

simulated function AssignKarmaThingProperties (DynamicSpawnableKarmaThing KarmaThing, float NewLifeSpan, StaticMesh NewStaticMesh, float NewMaxNetUpdateInterval)

Small hack to get the KarmaThing set up on the client as well.

CheckDamageType

function bool CheckDamageType (class<DamageTypeDT)

Returns True if the DamageType is considered valid for this actor.

Reset

function Reset ()

Overrides: Actor.Reset

Restore initial values if this actor should be reset.

UpdatePrecacheStaticMeshes

simulated function UpdatePrecacheStaticMeshes ()

Overrides: Actor.UpdatePrecacheStaticMeshes

Load StaticMeshes into memory for faster access.


DynamicSpawnableKarmaThing

UT2004 Object >> Actor >> KActor >> KarmaThing >> DynamicSpawnableKarmaThing (custom)
Package: 
UltimateMappingTools

A dynamic (and not so network efficient) version of the KarmaThing that can be spawned at runtime. It's used by the UltimateDestroyableEnvironment and not supposed to be placed in the map by hand.

Default values

Property Value
bNoDelete False