ゲームの入力アクションを読み込み中
この説明は今のところ英語のみです。
What a prompt is
The "hold E to ..." boxes in the bottom right of RDR2 are prompts. You register each one on an input action, give it a text and a mode, and put it in a group. The group only shows in a frame where your script calls_UI_PROMPT_SET_ACTIVE_GROUP_THIS_FRAME, which is why the Lua checks the distance every frame while you stand near the spot and sleeps otherwise.
Modes
- Press: fires when the key goes down. Fire on release waits until it comes up.
- Hold (game timing): uses one of the game's own hold types from
prompts.meta, the same timings the game's own prompts use. The file defines eight, from 250 ms (SHORT_TIMED_EVENT_MP) through 300 ms (SHORT_TIMED_EVENT), 600 ms (MEDIUM_TIMED_EVENT) and 1,500 ms (LONG_TIMED_EVENT) up to 5,000 ms (RUSTLING_CALM_TIMING), plus KEYBOARD_DELETE at 5,000,000 ms, which nobody finishes holding. - Hold (your own time): any length in milliseconds.
- Mash: the player has to press the key a set number of times.
Why the Lua calls natives by hash
Many RDR3 natives have no settled name yet, and names have changed between native database versions. A hash does not change, so every prompt native is called with Citizen.InvokeNative and commented with its current name. Text goes through VAR_STRING with the game's LITERAL_STRING label, which the game's own text table defines as "print the string you are given".
Keys
The input list is the game's common.meta: every action with its hash and the controller buttons it reads. The key in the preview is only for the preview; in game RDR2 draws whatever the player has bound.