Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Global objectClient APIGenerated

ActionHint

const ActionHint: object

Defined in: client/api.d.ts:3581

“Press [key] to …” hints, drawn by the game’s own HUD beside its own, with a handler run when the player presses the key.

A hint names one of the game’s keys by its control – primary_action, jump and the rest of keys() – and never a physical key: the glyph is whatever the player has bound to that control, keyboard or pad, and follows a rebind. A press hint fires on the press; a hold hint draws the game’s ring and fires once it fills.

Hints are drawn while the player is in control of their character, on foot or in the saddle, and the game takes them down in dialogue, minigames and menus. Two hints on one key stack: the newest is drawn and gets the press, and removing it brings back the one under it. A hint normally leaves the game’s own action on that key enabled. chat_focus_follow_init replaces the native focus/follow toggle while its hint is shown, so a scripted Follow action receives one press.

Client-only and local: a hint is shown to the player at this machine. Hints go when the resource that made them stops.

create(options, handler): number

Puts a hint up. It is drawn from the next frame the player is in control.

key is one of keys(). text is what the HUD writes beside the key, as written, at most 256 bytes. mode is “press” by default. holdDuration is how long a hold hint’s ring takes to fill, 0.2 to 10 seconds, 1 by default. enabled false draws the hint greyed out and keeps the handler from running.

boolean

number

string

"press" | "hold"

string

ActionHintHandler

Run with the hint’s id each time it fires.

number

The hint’s id. Throws when an option is out of range or the key is not one of keys().

keys(): string[]

The controls a hint can be put on.

string[]

Control names, in a fixed order.

remove(hint): boolean

Takes a hint down for good.

number

An id from create.

boolean

False when it was already gone.

setEnabled(hint, enabled): boolean

Greys a hint out, or brings it back.

number

An id from create.

boolean

False greys the hint out and its handler stops running.

boolean

False when the hint is gone.

setText(hint, text): boolean

Rewrites a hint’s text in place.

number

An id from create.

string

The new text, as written, at most 256 bytes.

boolean

False when the hint is gone or the text is too long.