Player Pickup Handler
|
This article or section is a stub. You can help by adding to it. |
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.
Contents
Before you start
- Open the map script inside your own mod. Keep its generated includes,
cScrMap : iScrMapclass and callback structure. See Add your first script if you have not edited a map script yet. - Add the helper include shown below alongside the script’s other includes.
- 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.