Player Pickup Handler

From Frictional Wiki
< HPL3‎ | SOMA‎ | Scripting
Jump to navigation Jump to search

The Player Pickup Handler moves a prop toward a point in front of the camera over the requested pickup duration. It interpolates position and orientation, applies the resulting transform in PostUpdate and calls the named completion callback with the prop name.

Before you start

  1. Open the map script inside your own mod. Keep its generated includes, cScrMap : iScrMap class and callback structure. See Add your first script if you have not edited a map script yet.
  2. Add the helper include shown below alongside the script’s other includes.
  3. Read the stock example before copying its calls: named entities, voice subjects, materials and callbacks must belong to the map or resources you are using.

Use the helper

#include "helpers/helper_player.hps"

Player_PickupProp

Initializes and starts a "pickup" animation for a the prop passed as argument.

Parameter Meaning
asPropName name of the prop that will be animated.
asCallback name of the function that will be called when animation is done. Syntax "void MyFunc(const tString &in asEntity)".
afTimeToPickup the total time of the animation.

Check your change

Save the script and restart the map in development mode with F5. If the script fails, open F1 and use Show Error List or Show HPL Log. See the development loop for the launch and debugging steps.

Still to expand

The helper and module implementation explain interpolation and the completion callback, but a shipped campaign caller was not found. A complete pickup scene still needs verification.

See also