HPL3/Amnesia: Rebirth/Scripting/Scripting Api/Prop

From Frictional Wiki
Jump to navigation Jump to search

Have some helpful descriptions to add to this class? Edit this page and add your insight to the Wiki!

Summary

Return Type Function and Description
void Prop_AddAttachedProp(tString &in asPropName, tString &in asAttachName, tString &in asAttachFile, cVector3f &in avPosOffset, cVector3f &in avRotOffset)
Attaches a prop mesh (any other data is skipped) to a Prop
void Prop_AddHealth(const tString &in asPropName, float afHealth)
Adds health to a prop
void Prop_AlignRotation(const tString &in asName, const tString &in asTargetEntity, float afAcceleration, float afMaxSpeed, float afSlowDownDist, bool abResetSpeed, const tString &in asCallback = "", const tString &in asOffsetEntity = "")
Aligns the rotation of the specified prop to the current rotation of the target entity
void Prop_ClearVelocity(const tString &in asPropName)
Clear out all velocity on a prop
bool Prop_Clone(const tString &in asSourceProp, const tString &in asDestName, float afScale = 1.0f)
Returns a new copy of asSourceProp as a new prop called asDestName, with asSourceProp's properties
bool Prop_CopyScriptProperties(const tString &in asSourceProp, const tString &in asDestProp)
Copies all script properties (but not position, bodies and so on) from one prop to another existing prop of the same type
bool Prop_CopyState(const tString &in asSourceProp, const tString &in asDestProp)
Copies all properties etc
void Prop_DisableCollisionUntilOutsidePlayer(const tString &in asPropName)
float Prop_GetHealth(const tString &in asPropName)
Gets the health of a prop
void Prop_MoveLinearTo(const tString &in asName, const tString &in asTargetEntity, float afAcceleration, float afMaxSpeed, float afSlowDownDist, bool abResetSpeed, const tString &in asCallback = "")
Moves the specified prop to the current position of the target entity
void Prop_RemoveAttachedProp(tString &in asPropName, tString &in asAttachName)
Removes an attached prop from a prop
void Prop_RotateToSpeed(const tString &in asPropName, float afAcc, float afGoalSpeed, const cVector3f &in avAxis, bool abResetSpeed, const tString &in asOffsetEntity)
Rotates a prop to a target speed
void Prop_RotateToSpeed(const tString &in asPropName, float afAcc, float afGoalSpeed, bool abResetSpeed, const tString &in asOffsetEntity)
Rotates a prop to a target speed
void Prop_SetActiveAndFade(const tString &in asPropName, bool abActive, float afFadeTime)
Activates or deactivates a entity and fades the mesh in or out
void Prop_SetAllowMapTransfer(const tString &in asPropName, bool abX)
Sets if a prop should be transfered
void Prop_SetHealth(const tString &in asPropName, float afHealth)
Sets the health of a prop
void Prop_SetStaticPhysics(const tString &in asPropName, bool abX)
Sets the physics of the object to static or dynamic
void Prop_StopMovement(const tString &in asPropName)
Stops the static movement of a prop

Function Detail

Prop_AddAttachedProp

void Prop_AddAttachedProp(tString &in asPropName,
                          tString &in asAttachName,
                          tString &in asAttachFile,
                          cVector3f &in avPosOffset,
                          cVector3f &in avRotOffset)

Attaches a prop mesh (any other data is skipped) to a Prop

Parameters

Returns:

  • void

Prop_AddHealth

void Prop_AddHealth(const tString &in asPropName,
                    float afHealth)

Adds health to a prop.

Parameters

  • asPropName (tString) —
  • afHealth (float) —

Returns:

  • void

Prop_AlignRotation

void Prop_AlignRotation(const tString &in asName,
                        const tString &in asTargetEntity,
                        float afAcceleration,
                        float afMaxSpeed,
                        float afSlowDownDist,
                        bool abResetSpeed,
                        const tString &in asCallback = "",
                        const tString &in asOffsetEntity = "")

Aligns the rotation of the specified prop to the current rotation of the target entity.

Parameters

  • asName (tString) —
  • asTargetEntity (tString) —
  • afAcceleration (float) —
  • afMaxSpeed (float) —
  • afSlowDownDist (float) —
  • abResetSpeed (bool) —
  • asCallback (tString) —
  • asOffsetEntity (tString) —

Returns:

  • void

Prop_ClearVelocity

void Prop_ClearVelocity(const tString &in asPropName)

Clear out all velocity on a prop.

Parameters

Returns:

  • void

Prop_Clone

bool Prop_Clone(const tString &in asSourceProp,
                const tString &in asDestName,
                float afScale = 1.0f)

Returns a new copy of asSourceProp as a new prop called asDestName, with asSourceProp's properties.

Parameters

  • asSourceProp (tString) —
  • asDestName (tString) —
  • afScale (float) —

Returns:

  • bool

Prop_CopyScriptProperties

bool Prop_CopyScriptProperties(const tString &in asSourceProp,
                               const tString &in asDestProp)

Copies all script properties (but not position, bodies and so on) from one prop to another existing prop of the same type.

Parameters

Returns:

  • bool

Prop_CopyState

bool Prop_CopyState(const tString &in asSourceProp,
                    const tString &in asDestProp)

Copies all properties etc. from one prop to another existing prop of the same type.

Parameters

Returns:

  • bool

Prop_DisableCollisionUntilOutsidePlayer

void Prop_DisableCollisionUntilOutsidePlayer(const tString &in asPropName)


Parameters

Returns:

  • void

Prop_GetHealth

float Prop_GetHealth(const tString &in asPropName)

Gets the health of a prop.

Parameters

Returns:

  • float—float, the health of the specified prop.

Prop_MoveLinearTo

void Prop_MoveLinearTo(const tString &in asName,
                       const tString &in asTargetEntity,
                       float afAcceleration,
                       float afMaxSpeed,
                       float afSlowDownDist,
                       bool abResetSpeed,
                       const tString &in asCallback = "")

Moves the specified prop to the current position of the target entity.

Parameters

  • asName (tString) —
  • asTargetEntity (tString) —
  • afAcceleration (float) —
  • afMaxSpeed (float) —
  • afSlowDownDist (float) —
  • abResetSpeed (bool) —
  • asCallback (tString) —

Returns:

  • void

Prop_RemoveAttachedProp

void Prop_RemoveAttachedProp(tString &in asPropName,
                             tString &in asAttachName)

Removes an attached prop from a prop

Parameters

Returns:

  • void

Prop_RotateToSpeed

void Prop_RotateToSpeed(const tString &in asPropName,
                        float afAcc,
                        float afGoalSpeed,
                        const cVector3f &in avAxis,
                        bool abResetSpeed,
                        const tString &in asOffsetEntity)

Rotates a prop to a target speed.
the prop will rotate around its own axis.

Parameters

  • asPropName (tString) —
  • afAcc (float) —
  • afGoalSpeed (float) —
  • avAxis (cVector3f) —
  • abResetSpeed (bool) —
  • asOffsetEntity (tString) —

Returns:

  • void

Prop_RotateToSpeed

void Prop_RotateToSpeed(const tString &in asPropName,
                        float afAcc,
                        float afGoalSpeed,
                        bool abResetSpeed,
                        const tString &in asOffsetEntity)

Rotates a prop to a target speed. Using the up vector of offset entity as axis.
If left as , the prop will rotate around its own up axis.

Parameters

  • asPropName (tString) —
  • afAcc (float) —
  • afGoalSpeed (float) —
  • abResetSpeed (bool) —
  • asOffsetEntity (tString) —

Returns:

  • void

Prop_SetActiveAndFade

void Prop_SetActiveAndFade(const tString &in asPropName,
                           bool abActive,
                           float afFadeTime)

Activates or deactivates a entity and fades the mesh in or out.

Parameters

  • asPropName (tString) —
  • abActive (bool) —
  • afFadeTime (float) —

Returns:

  • void

Prop_SetAllowMapTransfer

void Prop_SetAllowMapTransfer(const tString &in asPropName,
                              bool abX)

Sets if a prop should be transfered

Parameters

  • asPropName (tString) —
  • abX (bool) —

Returns:

  • void

Prop_SetHealth

void Prop_SetHealth(const tString &in asPropName,
                    float afHealth)

Sets the health of a prop

Parameters

  • asPropName (tString) —
  • afHealth (float) —

Returns:

  • void

Prop_SetStaticPhysics

void Prop_SetStaticPhysics(const tString &in asPropName,
                           bool abX)

Sets the physics of the object to static or dynamic

Parameters

  • asPropName (tString) —
  • abX (bool) —

Returns:

  • void

Prop_StopMovement

void Prop_StopMovement(const tString &in asPropName)

Stops the static movement of a prop.

Parameters

Returns:

  • void