https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/Scripting_Api/Prop&feed=atom&action=historyHPL3/SOMA/Scripting/Scripting Api/Prop - Revision history2024-03-28T19:03:22ZRevision history for this page on the wikiMediaWiki 1.34.2https://wiki.frictionalgames.com/page?title=HPL3/SOMA/Scripting/Scripting_Api/Prop&diff=5047&oldid=prevAbion47: Created page with "{{ScriptingStub}} Have some helpful descriptions to add to this class? Edit this page and add your insight to the Wiki! ==Summary== {{CodeDocSummaryTop}} {{CodeDocSummaryIte..."2020-08-24T20:58:10Z<p>Created page with "{{ScriptingStub}} Have some helpful descriptions to add to this class? Edit this page and add your insight to the Wiki! ==Summary== {{CodeDocSummaryTop}} {{CodeDocSummaryIte..."</p>
<p><b>New page</b></p><div>{{ScriptingStub}}<br />
<br />
Have some helpful descriptions to add to this class? Edit this page and add your insight to the Wiki!<br />
<br />
==Summary==<br />
{{CodeDocSummaryTop}}<br />
{{CodeDocSummaryItem|void|[[#Prop_AddAttachedProp|Prop_AddAttachedProp]]([[../../tString|tString]] &in asPropName, [[../../tString|tString]] &in asAttachName, [[../../tString|tString]] &in asAttachFile, [[../../cVector3f|cVector3f]] &in avPosOffset, [[../../cVector3f|cVector3f]] &in avRotOffset)|Attaches a prop mesh (any other data is skipped) to a Prop}}<br />
{{CodeDocSummaryItem|void|[[#Prop_AddHealth|Prop_AddHealth]](const [[../../tString|tString]] &in asPropName, float afHealth)|Adds health to a prop}}<br />
{{CodeDocSummaryItem|void|[[#Prop_AlignRotation|Prop_AlignRotation]](const [[../../tString|tString]] &in asName, const [[../../tString|tString]] &in asTargetEntity, float afAcceleration, float afMaxSpeed, float afSlowDownDist, bool abResetSpeed, const [[../../tString|tString]] &in asCallback <nowiki>=</nowiki> "")|Aligns the rotation of the specified prop to the current rotation of the target entity}}<br />
{{CodeDocSummaryItem|void|[[#Prop_ClearVelocity|Prop_ClearVelocity]](const [[../../tString|tString]] &in asPropName)|Clear out all velocity on a prop}}<br />
{{CodeDocSummaryItem|void|[[#Prop_DisableCollisionUntilOutsidePlayer|Prop_DisableCollisionUntilOutsidePlayer]](const [[../../tString|tString]] &in asPropName)|}}<br />
{{CodeDocSummaryItem|float|[[#Prop_GetHealth|Prop_GetHealth]](const [[../../tString|tString]] &in asPropName)|Gets the health of a prop}}<br />
{{CodeDocSummaryItem|void|[[#Prop_MoveLinearTo|Prop_MoveLinearTo]](const [[../../tString|tString]] &in asName, const [[../../tString|tString]] &in asTargetEntity, float afAcceleration, float afMaxSpeed, float afSlowDownDist, bool abResetSpeed, const [[../../tString|tString]] &in asCallback <nowiki>=</nowiki> "")|Moves the specified prop to the current position of the target entity}}<br />
{{CodeDocSummaryItem|void|[[#Prop_RemoveAttachedProp|Prop_RemoveAttachedProp]]([[../../tString|tString]] &in asPropName, [[../../tString|tString]] &in asAttachName)|Removes an attached prop from a prop}}<br />
{{CodeDocSummaryItem|void|[[#Prop_RotateToSpeed|Prop_RotateToSpeed]](const [[../../tString|tString]] &in asPropName, float afAcc, float afGoalSpeed, const [[../../cVector3f|cVector3f]] &in avAxis, bool abResetSpeed, const [[../../tString|tString]] &in asOffsetEntity)|Rotates a prop to a target speed}}<br />
{{CodeDocSummaryItem|void|[[#Prop_RotateToSpeed|Prop_RotateToSpeed]](const [[../../tString|tString]] &in asPropName, float afAcc, float afGoalSpeed, bool abResetSpeed, const [[../../tString|tString]] &in asOffsetEntity)|Rotates a prop to a target speed}}<br />
{{CodeDocSummaryItem|void|[[#Prop_SetActiveAndFade|Prop_SetActiveAndFade]](const [[../../tString|tString]] &in asPropName, bool abActive, float afFadeTime)|Activates or deactivates a entity and fades the mesh in or out}}<br />
{{CodeDocSummaryItem|void|[[#Prop_SetAllowMapTransfer|Prop_SetAllowMapTransfer]](const [[../../tString|tString]] &in asPropName, bool abX)|Sets if a prop should be transfered}}<br />
{{CodeDocSummaryItem|void|[[#Prop_SetHealth|Prop_SetHealth]](const [[../../tString|tString]] &in asPropName, float afHealth)|Sets the health of a prop}}<br />
{{CodeDocSummaryItem|void|[[#Prop_SetStaticPhysics|Prop_SetStaticPhysics]](const [[../../tString|tString]] &in asPropName, bool abX)|Sets the physics of the object to static or dynamic}}<br />
{{CodeDocSummaryItem|void|[[#Prop_StopMovement|Prop_StopMovement]](const [[../../tString|tString]] &in asPropName)|Stops the static movement of a prop}}<br />
{{CodeDocSummaryBottom}}<br />
<br />
==Function Detail==<br />
{{CodeDocDetailTop|Prop_AddAttachedProp}}<br />
<syntaxhighlight lang="c++">void Prop_AddAttachedProp(tString &in asPropName,<br />
tString &in asAttachName,<br />
tString &in asAttachFile,<br />
cVector3f &in avPosOffset,<br />
cVector3f &in avRotOffset)</syntaxhighlight><br />
{{CodeDocDetailBody|Attaches a prop mesh (any other data is skipped) to a Prop}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}}<br />
{{CodeDocDetailParam|asAttachName|[[../../tString|tString]]|the internal name of the attached prop}}<br />
{{CodeDocDetailParam|asAttachFile|[[../../tString|tString]]|the entity file of the prop to attach}}<br />
{{CodeDocDetailParam|avPosOffset|[[../../cVector3f|cVector3f]]|the postion offset for the attached prop}}<br />
{{CodeDocDetailParam|avRotOffset|[[../../cVector3f|cVector3f]]|the rotational offset for the attached prop}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_AddHealth}}<br />
<syntaxhighlight lang="c++">void Prop_AddHealth(const tString &in asPropName,<br />
float afHealth)</syntaxhighlight><br />
{{CodeDocDetailBody|Adds health to a prop.}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * supported.}}<br />
{{CodeDocDetailParam|afHealth|float|health to add, can be negative to reduce health.}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_AlignRotation}}<br />
<syntaxhighlight lang="c++">void Prop_AlignRotation(const tString &in asName,<br />
const tString &in asTargetEntity,<br />
float afAcceleration,<br />
float afMaxSpeed,<br />
float afSlowDownDist,<br />
bool abResetSpeed,<br />
const tString &in asCallback = "")</syntaxhighlight><br />
{{CodeDocDetailBody|Aligns the rotation of the specified prop to the current rotation of the target entity.}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asName|[[../../tString|tString]]|name of prop to move.}}<br />
{{CodeDocDetailParam|asTargetEntity|[[../../tString|tString]]|name of the entity to align with.}}<br />
{{CodeDocDetailParam|afAcceleration|float|acceleration of rotation.}}<br />
{{CodeDocDetailParam|afMaxSpeed|float|the maximum speed of movement.}}<br />
{{CodeDocDetailParam|afSlowDownDist|float|the distance at which movement slows down.}}<br />
{{CodeDocDetailParam|abResetSpeed|bool|if all static movement for the prop should be stopped before starting this movement.}}<br />
{{CodeDocDetailParam|asCallback|[[../../tString|tString]]|callback when movement is done: void (const tString& in asPropName)}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_ClearVelocity}}<br />
<syntaxhighlight lang="c++">void Prop_ClearVelocity(const tString &in asPropName)</syntaxhighlight><br />
{{CodeDocDetailBody|Clear out all velocity on a prop.}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_DisableCollisionUntilOutsidePlayer}}<br />
<syntaxhighlight lang="c++">void Prop_DisableCollisionUntilOutsidePlayer(const tString &in asPropName)</syntaxhighlight><br />
{{CodeDocDetailBody|}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_GetHealth}}<br />
<syntaxhighlight lang="c++">float Prop_GetHealth(const tString &in asPropName)</syntaxhighlight><br />
{{CodeDocDetailBody|Gets the health of a prop.}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop.}}<br />
{{CodeDocDetailReturn|float|the health of the specified prop.}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_MoveLinearTo}}<br />
<syntaxhighlight lang="c++">void Prop_MoveLinearTo(const tString &in asName,<br />
const tString &in asTargetEntity,<br />
float afAcceleration,<br />
float afMaxSpeed,<br />
float afSlowDownDist,<br />
bool abResetSpeed,<br />
const tString &in asCallback = "")</syntaxhighlight><br />
{{CodeDocDetailBody|Moves the specified prop to the current position of the target entity.}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asName|[[../../tString|tString]]|name of prop to move.}}<br />
{{CodeDocDetailParam|asTargetEntity|[[../../tString|tString]]|name of the entity to move the prop to.}}<br />
{{CodeDocDetailParam|afAcceleration|float|acceleration in m/s^2}}<br />
{{CodeDocDetailParam|afMaxSpeed|float|the maximum speed of movement.}}<br />
{{CodeDocDetailParam|afSlowDownDist|float|the distance at which movement slows down.}}<br />
{{CodeDocDetailParam|abResetSpeed|bool|if all static movement for the prop should be stopped before starting this movement.}}<br />
{{CodeDocDetailParam|asCallback|[[../../tString|tString]]|callback when movement is done: void (const tString& in asPropName)}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_RemoveAttachedProp}}<br />
<syntaxhighlight lang="c++">void Prop_RemoveAttachedProp(tString &in asPropName,<br />
tString &in asAttachName)</syntaxhighlight><br />
{{CodeDocDetailBody|Removes an attached prop from a prop}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}}<br />
{{CodeDocDetailParam|asAttachName|[[../../tString|tString]]|the internal name of the attached prop}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_RotateToSpeed}}<br />
<syntaxhighlight lang="c++">void Prop_RotateToSpeed(const tString &in asPropName,<br />
float afAcc,<br />
float afGoalSpeed,<br />
const cVector3f &in avAxis,<br />
bool abResetSpeed,<br />
const tString &in asOffsetEntity)</syntaxhighlight><br />
{{CodeDocDetailBody|Rotates a prop to a target speed.<br/>the prop will rotate around its own axis.}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}}<br />
{{CodeDocDetailParam|afAcc|float|acceleration to target speed}}<br />
{{CodeDocDetailParam|afGoalSpeed|float|target speed}}<br />
{{CodeDocDetailParam|avAxis|[[../../cVector3f|cVector3f]]|axis to rotate around}}<br />
{{CodeDocDetailParam|abResetSpeed|bool|if the speed should be reset before beginning rotation.}}<br />
{{CodeDocDetailParam|asOffsetEntity|[[../../tString|tString]]|name of entity to rotate around. If left as "",}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_RotateToSpeed}}<br />
<syntaxhighlight lang="c++">void Prop_RotateToSpeed(const tString &in asPropName,<br />
float afAcc,<br />
float afGoalSpeed,<br />
bool abResetSpeed,<br />
const tString &in asOffsetEntity)</syntaxhighlight><br />
{{CodeDocDetailBody|Rotates a prop to a target speed. Using the up vector of offset entity as axis.<br/>If left as , the prop will rotate around its own up axis.}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}}<br />
{{CodeDocDetailParam|afAcc|float|acceleration to target speed}}<br />
{{CodeDocDetailParam|afGoalSpeed|float|target speed}}<br />
{{CodeDocDetailParam|abResetSpeed|bool|if the speed should be reset before beginning rotation.}}<br />
{{CodeDocDetailParam|asOffsetEntity|[[../../tString|tString]]|name of entity to rotate around along the entity up axis.}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_SetActiveAndFade}}<br />
<syntaxhighlight lang="c++">void Prop_SetActiveAndFade(const tString &in asPropName,<br />
bool abActive,<br />
float afFadeTime)</syntaxhighlight><br />
{{CodeDocDetailBody|Activates or deactivates a entity and fades the mesh in or out.}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}}<br />
{{CodeDocDetailParam|abActive|bool|true <nowiki>=</nowiki> activates prop - false <nowiki>=</nowiki> deactivates prop.}}<br />
{{CodeDocDetailParam|afFadeTime|float|time to fade over.}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_SetAllowMapTransfer}}<br />
<syntaxhighlight lang="c++">void Prop_SetAllowMapTransfer(const tString &in asPropName,<br />
bool abX)</syntaxhighlight><br />
{{CodeDocDetailBody|Sets if a prop should be transfered}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * supported.}}<br />
{{CodeDocDetailParam|abX|bool|should transfer be allowed}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_SetHealth}}<br />
<syntaxhighlight lang="c++">void Prop_SetHealth(const tString &in asPropName,<br />
float afHealth)</syntaxhighlight><br />
{{CodeDocDetailBody|Sets the health of a prop}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * supported.}}<br />
{{CodeDocDetailParam|afHealth|float|health to set.}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_SetStaticPhysics}}<br />
<syntaxhighlight lang="c++">void Prop_SetStaticPhysics(const tString &in asPropName,<br />
bool abX)</syntaxhighlight><br />
{{CodeDocDetailBody|Sets the physics of the object to static or dynamic}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}}<br />
{{CodeDocDetailParam|abX|bool|true <nowiki>=</nowiki> static physics - false <nowiki>=</nowiki> dynamic physics}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}<br />
<br />
{{CodeDocDetailTop|Prop_StopMovement}}<br />
<syntaxhighlight lang="c++">void Prop_StopMovement(const tString &in asPropName)</syntaxhighlight><br />
{{CodeDocDetailBody|Stops the static movement of a prop.}}<br />
{{CodeDocDetailParamStart}}<br />
{{CodeDocDetailParam|asPropName|[[../../tString|tString]]|name of the prop. Wildcard(s) * are supported.}}<br />
{{CodeDocDetailReturn|void|}}<br />
{{CodeDocDetailBottom}}</div>Abion47