HPL3/SOMA/Scripting/Scripting Api/MoveObject

From Frictional Wiki
< HPL3‎ | SOMA‎ | Scripting‎ | Scripting Api
Revision as of 18:23, 30 May 2024 by Archivist (talk | contribs) (Fixed typo on afState's description (It's supposed to be the door's position, not a lock or unlocked state))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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!

Note: The official documentation for these functions had a typo where it wrongly documented the use of 'afState' in the function.

Summary

Return Type Function and Description
void MoveObject_SetState(const tString &in asName, float afState)
Sets the state of the move object
void MoveObject_SetStateExt(const tString &in asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed)
Sets the state of the move object

Function Detail

MoveObject_SetState

void MoveObject_SetState(const tString &in asName,
                         float afState)

Sets the state of the move object. This makes it move to a certain postion between
min or max pos (or outside of that is <0 or >1).

Parameters

  • asName (tString) — name of move object
  • afState (float) — the position of the door you want to set it to (between 0.0f and 1.0f).

Returns:

  • void

MoveObject_SetStateExt

void MoveObject_SetStateExt(const tString &in asName,
                            float afState,
                            float afAcc,
                            float afMaxSpeed,
                            float afSlowdownDist,
                            bool abResetSpeed)

Sets the state of the move object. This makes it move to a certain postion between
min or max pos (or outside of that is <0 or >1).
This will also set the speeed and acc at which the movement occurs.

Parameters

  • asName (tString) — name of move object
  • afState (float) — the position of the door you want to set it to (between 0.0f and 1.0f).
  • afAcc (float) — the acceleration of the movement
  • afMaxSpeed (float) — the max speed.
  • afSlowdownDist (float) — the distance from the state postion that it will start slowing to a halt.
  • abResetSpeed (bool) — if the previous speed should be reset.

Returns:

  • void