I search for solutions in this order: Past Code, Unreal Source, Wiki, BUF, groups.yahoo, google, screaming at monitor. – RegularX
Difference between revisions of "User:Crusha/UltimateMappingTools/UltimateDestructibleEnvironment"
m (-) |
(First revision of page, Checked for correctness.) |
||
Line 1: | Line 1: | ||
− | + | =UltimateDestroyableEnvironment= | |
by Crusha K. Rool | by Crusha K. Rool | ||
{{infobox class | {{infobox class | ||
− | | class | + | | class = UltimateDestroyableEnvironment |
+ | | game = UT2004 | ||
+ | | engine = UE2 | ||
+ | | package = UltimateMappingTools | ||
| parent1 = Decoration | | parent1 = Decoration | ||
| parent2 = Actor | | parent2 = Actor | ||
| parent3 = Object | | parent3 = Object | ||
− | + | | custom = yes | |
− | + | ||
− | | custom | + | |
}} | }} | ||
− | + | 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]] | |
− | '''Type:''' [[ | + | |
− | + | Triggered when an invalid DamageType damaged this actor. | |
− | ==== | + | ===Property group 'UltimateDestroyableEnvironment'=== |
− | '''Type:''' [[ | + | ====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==== | ====DamageTypes==== | ||
− | '''Type:''' [[array]]<[[UE2:DamageType (UT2004)|DamageType]]> | + | '''Type:''' [[array]]<[[class]]<[[UE2:DamageType (UT2004)|DamageType]]> > |
Which DamageTypes can affect this actor? | Which DamageTypes can affect this actor? | ||
− | ==== | + | ====LevelOfDestruction==== |
− | '''Type:''' [[ | + | '''Type:''' [[array]]<{{tl|_LevelOfDestruction}}> |
− | + | Determines the appearance of the Actor at different health levels. | |
− | + | ====TotalHealth==== | |
+ | '''Type:''' [[int]] | ||
− | + | The initial health of this actor. | |
− | + | ||
− | '''Default value:''' | + | '''Default value:''' 2000 |
− | + | ====WrongDamageEventTreshold==== | |
+ | '''Type:''' [[int]] | ||
− | + | Trigger an event every time this much damage has been caused by a "wrong" DamageType. | |
− | + | ||
− | '''Default value:''' | + | '''Default value:''' 300 |
− | + | ===Internal variables=== | |
+ | ====AccumulatedWrongDamage==== | ||
+ | '''Type:''' [[int]] | ||
− | ==== | + | This much of the wrong damage has been accumulated already. |
+ | |||
+ | ====bFinalDestructionReached==== | ||
'''Type:''' [[bool]] | '''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]] | '''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:''' [[ | + | '''Type:''' [[UE2:Object structs (UT2004)#Vector|Object.Vector]] |
− | + | Remember for calculating offset from default in each LOD. | |
− | ==== | + | ====OriginalRotation==== |
− | '''Type:''' [[ | + | '''Type:''' [[UE2:Object structs (UT2004)#Rotator|Object.Rotator]] |
− | + | Remember for calculating rotation offset from default in each LOD. | |
− | ==== | + | ====OriginalScale==== |
− | '''Type:''' [[ | + | '''Type:''' [[UE2:Object structs (UT2004)#Vector|Object.Vector]] |
− | + | Just remember this too. | |
− | ==== | + | ====OriginalStaticMesh==== |
− | '''Type:''' | + | '''Type:''' {{cl|StaticMesh}} |
− | + | Remember for reset. | |
− | + | ||
− | ==== | + | ====OriginalStyle==== |
− | '''Type:''' [[ | + | '''Type:''' [[UE2:Actor enums (UT2004)#ERenderStyle|Actor.ERenderStyle]] |
− | + | Don't ask. | |
− | === | + | ===Default values=== |
− | + | {| class="list defaults" | |
+ | ! Property | ||
+ | ! Value | ||
+ | |- | ||
+ | | [[UE2:Actor internal variables (UT2004)#bAlwaysRelevant|bAlwaysRelevant]] | ||
+ | | True | ||
+ | |- | ||
+ | | [[UE2:Actor properties (UT2004)#bBlockActors|bBlockActors]] | ||
+ | | True | ||
+ | |- | ||
+ | | [[UE2:Actor properties (UT2004)#bBlockKarma|bBlockKarma]] | ||
+ | | True | ||
+ | |- | ||
+ | | [[UE2:Actor properties (UT2004)#bCollideActors|bCollideActors]] | ||
+ | | True | ||
+ | |- | ||
+ | | [[UE2:Actor properties (UT2004)#bEdShouldSnap|bEdShouldSnap]] | ||
+ | | True | ||
+ | |- | ||
+ | | [[UE2:Actor internal variables (UT2004)#bNetNotify|bNetNotify]] | ||
+ | | True | ||
+ | |- | ||
+ | | [[UE2:Actor properties (UT2004)#bNoDelete|bNoDelete]] | ||
+ | | True | ||
+ | |- | ||
+ | | [[UE2:Actor internal variables (UT2004)#bStatic|bStatic]] | ||
+ | | False | ||
+ | |- | ||
+ | | [[UE2:Actor internal variables (UT2004)#bWorldGeometry|bWorldGeometry]] | ||
+ | | True | ||
+ | |- | ||
+ | | [[UE2:Actor properties (UT2004)#DrawType|DrawType]] | ||
+ | | [[UE2:Actor enums (UT2004)#EDrawType|DT_StaticMesh]] | ||
+ | |- | ||
+ | | [[UE2:Actor internal variables (UT2004)#RemoteRole|RemoteRole]] | ||
+ | | [[UE2:Actor enums (UT2004)#ENetRole|ROLE_SimulatedProxy]] | ||
+ | |- | ||
+ | | [[UE2:Actor properties (UT2004)#StaticMesh|StaticMesh]] | ||
+ | | {{cl|StaticMesh}}'Albatross_architecture.Alb_crate1' | ||
+ | |} | ||
− | + | ==Structs== | |
+ | ===_DecoKActor=== | ||
+ | You can spawn real chunks that are physics calculated when you destroy this Actor step by step. | ||
+ | ; {{cl|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 | ||
+ | ; [[UE2:KarmaParams (UT2004)|KarmaParams]] KActorParameters : Set the parameters for the new Karma object. | ||
+ | ; [[UE2:Object structs (UT2004)#Vector|Object.Vector]] SpawnOffset : Where does the KActor spawn in relation to the location of the StaticMesh? | ||
+ | ; [[UE2:Object structs (UT2004)#Rotator|Object.Rotator]] RotationOffset : Which rotation does the KActor have in relation to the StaticMesh? | ||
+ | ; [[float]] KActorLifeSpan : <!-- enter variable description --> | ||
− | === | + | ===_LevelOfDestruction=== |
− | + | Determines the appearance of the Actor at different health levels. | |
+ | ; {{cl|StaticMesh}} DestroyedStaticMesh : The new StaticMesh that is used at this LOD. | ||
+ | ; [[int]] HealthLimit : This LOD becomes active if the actors health drops below this. | ||
+ | ; [[UE2:Object structs (UT2004)#Vector|Object.Vector]] StaticMeshScale : Scale the StaticMesh by this value. Values close to 0 are ignored. | ||
+ | ; [[UE2:Object structs (UT2004)#Vector|Object.Vector]] StaticMeshOffset : New location of the StaticMesh in relation to the original location. | ||
+ | ; [[UE2:Object structs (UT2004)#Rotator|Object.Rotator]] StaticMeshRotation : New rotation of the StaticMesh in relation to the original rotation. | ||
+ | ; [[array]]<{{tl|_DecoKActor}}> KarmaDeco : KActors to spawn at the destruction. | ||
+ | ; [[name]] TriggerEvent : Trigger this Event once this LOD has been reached. | ||
+ | ; [[bool]] bFinalDestruction : <!-- enter variable description --> | ||
+ | ; [[bool]] bReached : True if this LOD has been executed already. | ||
− | + | ==Functions== | |
+ | ===Events=== | ||
+ | ====GainedChild==== | ||
+ | {{code|simulated event '''GainedChild''' ([[UE2:Actor (UT2004)|Actor]] '''Other''')}} | ||
+ | '''Overrides:''' [[UE2:Actor events (UT2004)#GainedChild|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==== | |
+ | {{code|simulated event '''PostBeginPlay''' ()}} | ||
− | + | '''Overrides:''' [[UE2:Actor events (UT2004)#PostBeginPlay|Actor.PostBeginPlay]] | |
− | + | Use the Health variable and keep TotalHealth as backup. | |
− | + | ||
− | + | ====PostNetReceive==== | |
+ | {{code|simulated event '''PostNetReceive''' ()}} | ||
− | + | '''Overrides:''' [[UE2:Actor events (UT2004)#PostNetReceive|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==== |
− | ''' | + | {{code|event '''TakeDamage''' ([[int]] '''NDamage''', [[UE2:Pawn (UT2004)|Pawn]] '''instigatedBy''', [[UE2:Object structs (UT2004)#Vector|Object.Vector]] '''hitlocation''', [[UE2:Object structs (UT2004)#Vector|Object.Vector]] '''momentum''', [[class]]<[[UE2:DamageType (UT2004)|DamageType]]> '''damageType''')}} |
− | + | '''Overrides:''' [[UE2:Decoration (UT2004)#TakeDamage|Decoration.TakeDamage]] | |
− | + | Process damage on this actor and change it's appearance if a DamageLimit is reached. | |
+ | ====Trigger==== | ||
+ | {{code|event '''Trigger''' ([[UE2:Actor (UT2004)|Actor]] '''Other''', [[UE2:Pawn (UT2004)|Pawn]] '''EventInstigator''')}} | ||
− | + | '''Overrides:''' [[UE2:Decoration (UT2004)#Trigger|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==== |
+ | {{code|simulated function '''AssignKarmaThingProperties''' ([[User:Crusha/UltimateMappingTools/UltimateDestructibleEnvironment#DynamicSpawnableKarmaThing|DynamicSpawnableKarmaThing]] '''KarmaThing''', [[float]] '''NewLifeSpan''', {{cl|StaticMesh}} '''NewStaticMesh''', [[float]] '''NewMaxNetUpdateInterval''')}} | ||
− | + | Small hack to get the KarmaThing set up on the client as well. | |
− | ==== | + | ====CheckDamageType==== |
− | ''' | + | {{code|function [[bool]] '''CheckDamageType''' ([[class]]<[[UE2:DamageType (UT2004)|DamageType]]> '''DT''')}} |
− | + | Returns True if the DamageType is considered valid for this actor. | |
+ | ====Reset==== | ||
+ | {{code|function '''Reset''' ()}} | ||
− | + | '''Overrides:''' [[UE2:Actor instance functions (UT2004)#Reset|Actor.Reset]] | |
− | + | ||
− | ' | + | |
− | + | Restore initial values if this actor should be reset. | |
− | ==== | + | ====UpdatePrecacheStaticMeshes==== |
− | ''' | + | {{code|simulated function '''UpdatePrecacheStaticMeshes''' ()}} |
− | + | '''Overrides:''' [[UE2:Actor instance functions (UT2004)#UpdatePrecacheStaticMeshes|Actor.UpdatePrecacheStaticMeshes]] | |
− | + | Load StaticMeshes into memory for faster access. | |
− | + | ||
− | |||
− | |||
− | |||
− | + | =DynamicSpawnableKarmaThing= | |
+ | {{infobox class | ||
+ | | class = DynamicSpawnableKarmaThing | ||
+ | | game = UT2004 | ||
+ | | engine = UE2 | ||
+ | | package = UltimateMappingTools | ||
+ | | customparent1 = KarmaThing | ||
+ | | parent2 = KActor | ||
+ | | parent3 = Actor | ||
+ | | parent4 = Object | ||
+ | | custom = yes | ||
+ | }} | ||
− | + | 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== | |
+ | {| class="list defaults" | ||
+ | ! Property | ||
+ | ! Value | ||
+ | |- | ||
+ | | [[UE2:Actor properties (UT2004)#bNoDelete|bNoDelete]] | ||
+ | | False | ||
+ | |} |
Latest revision as of 14:58, 12 October 2011
UltimateDestroyableEnvironment
by Crusha K. Rool
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
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
Overrides: Actor.PostBeginPlay
Use the Health variable and keep TotalHealth as backup.
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
Overrides: Decoration.TakeDamage
Process damage on this actor and change it's appearance if a DamageLimit is reached.
Trigger
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
Small hack to get the KarmaThing set up on the client as well.
CheckDamageType
Returns True if the DamageType is considered valid for this actor.
Reset
Overrides: Actor.Reset
Restore initial values if this actor should be reset.
UpdatePrecacheStaticMeshes
Overrides: Actor.UpdatePrecacheStaticMeshes
Load StaticMeshes into memory for faster access.
DynamicSpawnableKarmaThing
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 |