FB2Action_BookRead
Overview
- BookRead action. Override the OnPlay/OnFinish/OnPaused/OnCanceled/OnTick timing hooks in Lua.
Metadata
| Field | Value |
|---|---|
| Kind | action |
| Environment | B2 - Simulation |
| Category | actions |
| Extends | FB2Action_PlayAnim |
| Require | require('Actions.B2Action_BookRead') |
Properties (6)
| Name | Type | Description |
|---|---|---|
BookAnimId | string | Book-side animation id (from Action.S2), used to resolve the book object's montage |
BookAnimMontageName | string | Resolved montage row id for the book object's animation, used to play the montage |
BookDtId | string | Book data table id of the target carriable book, resolved at init and used for all book table lookups |
BookReadTickTime | integer | Accumulated elapsed reading time in ticks, compared against the book's TotalReadTime to know when to end the loop |
PrevTickTime | integer | Timestamp (game ticks) of the last tick update, used to compute the elapsed-tick delta added to BookReadTickTime |
ProgressTime | number | Total time this reading session should take, computed from the book's TotalReadTime and current game time scale |
Functions (3)
| Function | Parameters | Returns | Description |
|---|---|---|---|
OnFinish | - | - | Callback invoked on Finish. |
OnPlay | - | - | Callback invoked on Play. |
OnTick | DeltaTime: number, CurrentTime: FDateTime, GameDeltaMinutes: number | - | Callback invoked on Tick. |
Override points (3)
Implement these in Lua as FB2Action_BookRead.Override_Name = function(...) end.
| Function | Parameters | Returns | Description |
|---|---|---|---|
Override_OnFinish | - | - | Timing hook called when the action finishes. |
Override_OnPlay | - | - | Timing hook called when the action starts (play). Override in Lua to replace the start behavior. |
Override_OnTick | DeltaTime: number, CurrentTime: FDateTime, GameDeltaMinutes: number | - | Timing hook called every tick while the action runs. (performance-sensitive) |