Knowledge from the fieldRedM

CreateVarString(10, 'LITERAL_STRING', text) — the VAR_STRING idiom required for all HUD/prompt/toast text

learning:49

CreateVarString(10, 'LITERAL_STRING', text) — the VAR_STRING idiom required for all HUD/prompt/toast text

Context

VAR_STRING (0xFA925AC00EB830B9) is documented (flags note), but two things aren't: its Lua aliases CreateVarString / VarString, and the magic argument idiom every RDR3 HUD/prompt/notification call uses.

The idiom

local s = CreateVarString(10, "LITERAL_STRING", text)
  • First arg 10 is the flag (bit 0 must NOT be set — 10 = 0b1010, valid).
  • "LITERAL_STRING" is a literal token, not your text.
  • Third arg is the actual string. When passing a precomputed hash instead of literal text, flags must be 0 (per the native's own note).

The trap

Prompt text, prompt-group titles, and the text fields inside UIFEED toast structs must be VAR_STRING-wrapped first. Passing a raw Lua string renders blank or garbled. The 64-bit result is then stuffed into DataView buffers via bigInt(...) (see the DataView marshalling finding).

Verified

prompt/client.lua:221 (PromptSetText(id, CreateVarString(10,"LITERAL_STRING",str))), prompt group title prompt/client.lua:20-24, toast text notification/client.lua:77,152. lookup_native({name:'CreateVarString'}) returns no match — only resolves under VAR_STRING, whose doc omits the alias and idiom.

Linked natives

  • VAR_STRING (0xFA925AC00EB830B9)

Tags: var-string, createvarstring, literal-string, hud, prompt, notification, string-encoding
Category: natives
Source: jo_libs-fleet
Created: 2026-05-31T09:39:21.809Z

Back to documentation