Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
Protected Member Functions | Protected Attributes | List of all members
dp88_buildingScripts_minorWeakpoint Class Reference

dp88 Building Scripts - Minor Weakpoint More...

#include <dp88_buildingScripts.h>

Protected Member Functions

void OnBuildingDestroyed (GameObject *obj)
 
- Protected Member Functions inherited from dp88_buildingScripts_componentBaseClass
void Detach (GameObject *obj)
 
virtual void OnDetach (GameObject *obj)
 
void PlayAnimation (GameObject *obj, const char *animation, int nStartFrame, int nEndFrame, bool bLooped)
 
- Protected Member Functions inherited from dp88_buildingScripts_baseClass
GameObject * RegisterWithParent (GameObject *obj, const char *preset_name, int type)
 
void Custom (GameObject *obj, int type, int param, GameObject *sender)
 
virtual void OnCustom (GameObject *obj, int type, int param, GameObject *sender)
 
virtual void OnBuildingOffline (GameObject *obj)
 
virtual void OnBuildingOnline (GameObject *obj)
 
virtual void OnBuildingCaptured (GameObject *obj, int team)
 

Protected Attributes

bool m_bIsDestroyed
 
- Protected Attributes inherited from dp88_buildingScripts_componentBaseClass
LoopedAnimationControllerm_pAnimController
 
- Protected Attributes inherited from dp88_buildingScripts_baseClass
int m_parentId
 

Detailed Description

Author
Daniel Paul (danpa.nosp@m.ul88.nosp@m.@yaho.nosp@m.o.co.nosp@m..uk)

Attach this script to a building part which should function as a minor weakpoint, which can be attacked by an enemy to disable the building until the weakpoint is repaired. If a building has multiple minor weakpoints they must all be destroyed before the building is disabled and, once disabled, they must all be fully repaired before the building is enabled again.

The exact effects of disabling the building are determined by the building function scripts which are attached to the object with the dp88_buildingScripts_controller attached.

Precondition
The weakpoint is considered destroyed if the shield strength is 0 and the object should be indestructable to allow it to be repaired (if desired). The recommended way to implement this is to give the preset a health value of 1 with a "blamo" skin type. The shield strength alone will then function as the weakpoints total hitpoints.
Parameters
Building_Controller_PresetName of the preset to which the controller script for this building is attached. Note that if there are multiple copies of this preset on the map the script will use the closest instance as its parent.
Animation_NameOptional. The name of an animation to play on this weakpoint in the "alive" state
Animation_Start_FrameOptional. The first frame number to play within the named animation for the "alive" state
Animation_End_FrameOptional. The last frame number to play within the named animation for the "alive" state
Animation_LoopedOptional. Whether to loop the animation in the "alive" state. 1 to enable, 0 to disable
Destroyed_Animation_NameOptional. The name of an animation to play on this weakpoint in the "destroyed" state
Destroyed_Animation_Start_FrameOptional. The first frame number to play within the named animation for the "destroyed" state
Destroyed_Animation_End_FrameOptional. The last frame number to play within the named animation for the "destroyed" state
Destroyed_Animation_LoopedOptional. Whether to loop the animation in the "destroyed" state. 1 to enable, 0 to disable
Note
The "alive" and "destroyed" animations can both be contained in the same animation if desired

Member Function Documentation

◆ OnBuildingDestroyed()

void dp88_buildingScripts_minorWeakpoint::OnBuildingDestroyed ( GameObject * obj)
protectedvirtual

Event function called when the building has been destroyed

Reimplemented from dp88_buildingScripts_baseClass.

Member Data Documentation

◆ m_bIsDestroyed

bool dp88_buildingScripts_minorWeakpoint::m_bIsDestroyed
protected

Tracks whether this weakpoint has been destroyed, so we can trigger the repaired event upon reaching 100% health again