Interaction feedback
Makes interactions visible without deciding any of them: the designated object lights up, nearby interactive objects get a discreet hint, and an attached prompt shows the action and the key of the active device.
Interaction feedback (interaction.feedback) #
What it is for #
Makes interactions visible without deciding any of them: the designated object lights up, nearby interactive objects get a discreet hint, and an attached prompt shows the action and the key of the active device.
It needs game.engine; installing it brings them in.
Turn it on #
Install the kit in a project, then change a setting (the values shown are its defaults):
gripforge_gamekit_install { project_id: "gkp_…", id: "interaction.feedback" }
gripforge_gamekit_configure { project_id: "gkp_…", id: "interaction.feedback",
config: { "style": "default", "highlight": true } }
First example #
<!-- test: kits/game_engine/host/tests/interaction_feedback.rs::the_attached_prompts_are_off_by_default --> This is the body of the passing test the_attached_prompts_are_off_by_default; the helper functions it calls are defined at the top of the same test file.
#[test]
fn the_attached_prompts_are_off_by_default() {
// 1.4.0: no key on screen by default — the prompt on the object and at the wheel only when the game turns them on.
let mut s = session(json!({}));
assert_eq!(
call(&mut s, "interaction.feedback", "drawsPrompt", json!([])),
json!(false)
);
let view = call(&mut s, "interaction.feedback", "view", json!(["en"]));
assert_eq!(view["elements"]["worldPrompt"], json!(false));
assert_eq!(view["elements"]["vehicleExit"], json!(false));
assert_eq!(view["elements"]["highlight"], json!(true));
}
Settings and defaults #
Descriptions come from the kit manifest and stay in English.
| Setting | Type | Default | Range or values | Meaning |
|---|---|---|---|---|
style | string | "default" | Id of a feedback_styles document: default, subtle, bold, retro, or the game's own. | |
highlight | boolean | true | Light up the designated interactive. | |
nearbyHint | boolean | false | A discreet hint over the interactives near the player. | |
worldPrompt | boolean | false | The prompt attached to the designated interactive, with its key (ui.prompts then leaves its context row to it). | |
cursor | boolean | false | The cursor of the kind under the pointer (click games). | |
holdGauge | boolean | true | A gauge while the action is held. | |
confirm | boolean | true | A pulse when a use happens. | |
fail | boolean | true | A pulse and the reason when a use is refused (too far, locked). | |
sound | boolean | true | The sounds of the kinds (audio.core). | |
moveMarker | boolean | false | A marker on the ground for a move order (when ui.cursor does not mark it). | |
orderMarker | boolean | false | A marker on the target of an order. | |
vehicleExit | boolean | false | Off by default (1.4.0, it shows a key). | |
vehicleScheme | string | "vehicle" | 1.1.0: the input.scheme scheme of a player at the wheel. | |
hintRadius | number | 6 | 1–30 | Metres around the player where interactives get a hint. |
maxHints | integer | 6 | 0–16 | At most this many hints, nearest first. |
intensity | number | 1 | 0–1 | Strength of every effect (the player may lower it further). |
confirmSeconds | number | 0.45 | 0.1–3 | |
failSeconds | number | 1.4 | 0.2–5 | |
markerSeconds | number | 0.6 | 0.15–3 |
Services, events, variables #
- Service
interaction.feedback: view(lang) — what every renderer draws (focus with its role, nearby, cursor, pulses, markers, style, elements); drawsPrompt(); attached(); kinds(); styles(); kindOf(entity); pulse(entity, type, reason). - Service
interaction.feedback.settings: The player's settings (keys, get, set): intensity 0..1 and each element 1 on / 0 off; saved. - Events emitted:
interaction.feedback.pulse(entity,type,reason) — A use (confirm) or a refusal (fail, with its reason) was shown on an entity.fx.ground_marker(position,color,seconds,size,style) — moveMarker: a move order marked on the ground (the renderers draw it).
- Events listened to:
interaction.completed,interaction.requested,interaction.refused,access.blocked,vehicle.entered,vehicle.exited,pointer.command,input.intent.issued,engine.data.changed,engine.config.changed - Variables:
interaction.feedback.focus(string) — Interaction feedback targetinteraction.feedback.cursor(string) — Interaction cursor
Hooks and modding #
- Moddable settings:
style,highlight,nearbyHint,worldPrompt,cursor,holdGauge,confirm,fail,sound,moveMarker,orderMarker,vehicleExit,hintRadius,maxHints,intensity,confirmSeconds,failSeconds,markerSeconds,vehicleScheme - Moddable collections:
interaction_kinds,feedback_styles - Components:
interaction_feedback
Engines #
Declared targets: web, rust. gripforge kit api interaction.feedback lists the exact settings and services of your version.
Versions #
Kit version 1.4.0.