The Grapple Component and the Grapple Object store the exact moment at which some events occur in so called timestamp variables. The following Timestamps are stored:
On Grapple Component
These timestamps are mainly meant for internal use on the Grapple Component
|Timestamp - Grapple Settings Applied/Reverted||The time function Apply/ Revert - All Pending Grapple Data was used.|
|Timestamp - Last Grapple Attempt Tick||The last time a Grapple Attempt was performed in every tick mode.|
On Grapple Object
These timestamps can be accessed using function Get Timestamp on the Grapple Object.
|Timestamp - Last User Command Received||Refers to the time the last User Command was received by this Grapple Object.|
|Timestamp - Grapple Sequence Initiated||Refers to the time the Grapple Sequence based on this Object was initiated.|
|Timestamp - Custom||A custom timestamp that can be set using function Set Custom Timestamp based on Current Time or by directly accessing variable Timestamp - Custom.|
|Timestamp - Last Participant Update||Refers to the time function Update Participants was last used on this Grapple Object.|
The following functions can be used to access and modify timestamps.
On Grapple component
|Calculate Delay Since||Calculates the delay since the input time. Returns 0 if an invalid timestamp (i.e. one with a value smaller than 0) negative value is provided.|
|Make Timestamp from Current Time||Get the current server world time from the Game State|
|Generate Timestamp if Invalid||Generates a timestamp if the input timestamp is not valid (value smaller than 0).|
On Grapple Object
|Get Timestamp||Gets the stored time based on a timestamp slot.|
|Get Delay Since Timestamp||Returns the time that has passed since the specified timestamp.|
|Set Custom Timestamp based on Current Time||Set the value of variable Timestamp - Custom based on the current time.|
Replication on Input Functions
Many Input Functions provide the option to specify a timestamp. This can be useful in case the Input Function is replicated. If an invalid timestamp (i.e. a negative value) is provided, the Grapple Component will generate a timestamp on the server and replicate it to all Clients. This is the optimal way to manage timestamps, so it is recommended to leave the timestamp parameter on input functions at its default value (-1).
Corrections when applying Grapple Data
When applying Grapple Data, the Grapple Component can make the following corrections in order to compensate latency between different connections:
- Increase the animation start time. To enable or disable this behaviour, modify variable Apply Timestamp to Animation Start Time in the Global Grapple Dataof your Grapple Object.
- Shorten the duration of the Reposition. To enable or disable this behaviour, modify variable modify variable Apply Timestamp to Reposition Duration in the Global Grapple Data of your Grapple Object.
Corrections to Queued Event delays
Users can make use of timestamps when adding Queued Events. When using function Add Queued Event, set input parameter Timeframe to the timestamp you wish to use.
To use a custom (user-defined) timestamp, call function Set Custom Timestamp based on Current Time or modify variable Timestamp - Custom before adding the Queued Event.
If you want to add a Queued Event without any compensation based on timestamps, set the Timeframe to 'current time'.