HPL3/SOMA/Scripting/Scripting Api/Prop

From Frictional Wiki
< HPL3‎ | SOMA‎ | Scripting‎ | Scripting Api
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 = "")
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
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

  • asPropName (tString) — name of the prop. Wildcard(s) * are supported.
  • asAttachName (tString) — the internal name of the attached prop
  • asAttachFile (tString) — the entity file of the prop to attach
  • avPosOffset (cVector3f) — the postion offset for the attached prop
  • avRotOffset (cVector3f) — the rotational offset for the attached prop

Returns:

  • void

Prop_AddHealth

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

Adds health to a prop.

Parameters

  • asPropName (tString) — name of the prop. Wildcard(s) * supported.
  • afHealth (float) — health to add, can be negative to reduce health.

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 = "")

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

Parameters

  • asName (tString) — name of prop to move.
  • asTargetEntity (tString) — name of the entity to align with.
  • afAcceleration (float) — acceleration of rotation.
  • afMaxSpeed (float) — the maximum speed of movement.
  • afSlowDownDist (float) — the distance at which movement slows down.
  • abResetSpeed (bool) — if all static movement for the prop should be stopped before starting this movement.
  • asCallback (tString) — callback when movement is done: void (const tString& in asPropName)

Returns:

  • void

Prop_ClearVelocity

void Prop_ClearVelocity(const tString &in asPropName)

Clear out all velocity on a prop.

Parameters

  • asPropName (tString) — name of the prop. Wildcard(s) * are supported.

Returns:

  • void

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

  • asPropName (tString) — name of the prop.

Returns:

  • 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) — name of prop to move.
  • asTargetEntity (tString) — name of the entity to move the prop to.
  • afAcceleration (float) — acceleration in m/s^2
  • afMaxSpeed (float) — the maximum speed of movement.
  • afSlowDownDist (float) — the distance at which movement slows down.
  • abResetSpeed (bool) — if all static movement for the prop should be stopped before starting this movement.
  • asCallback (tString) — callback when movement is done: void (const tString& in asPropName)

Returns:

  • void

Prop_RemoveAttachedProp

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

Removes an attached prop from a prop

Parameters

  • asPropName (tString) — name of the prop. Wildcard(s) * are supported.
  • asAttachName (tString) — the internal name of the attached prop

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) — name of the prop. Wildcard(s) * are supported.
  • afAcc (float) — acceleration to target speed
  • afGoalSpeed (float) — target speed
  • avAxis (cVector3f) — axis to rotate around
  • abResetSpeed (bool) — if the speed should be reset before beginning rotation.
  • asOffsetEntity (tString) — name of entity to rotate around. If left as "",

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) — name of the prop. Wildcard(s) * are supported.
  • afAcc (float) — acceleration to target speed
  • afGoalSpeed (float) — target speed
  • abResetSpeed (bool) — if the speed should be reset before beginning rotation.
  • asOffsetEntity (tString) — name of entity to rotate around along the entity up axis.

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) — name of the prop. Wildcard(s) * are supported.
  • abActive (bool) — true = activates prop - false = deactivates prop.
  • afFadeTime (float) — time to fade over.

Returns:

  • void

Prop_SetAllowMapTransfer

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

Sets if a prop should be transfered

Parameters

  • asPropName (tString) — name of the prop. Wildcard(s) * supported.
  • abX (bool) — should transfer be allowed

Returns:

  • void

Prop_SetHealth

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

Sets the health of a prop

Parameters

  • asPropName (tString) — name of the prop. Wildcard(s) * supported.
  • afHealth (float) — health to set.

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) — name of the prop. Wildcard(s) * are supported.
  • abX (bool) — true = static physics - false = dynamic physics

Returns:

  • void

Prop_StopMovement

void Prop_StopMovement(const tString &in asPropName)

Stops the static movement of a prop.

Parameters

  • asPropName (tString) — name of the prop. Wildcard(s) * are supported.

Returns:

  • void