Utility Scripts · Physical Controls

Absolute Detents

Absolute detents belong to a specific logical angle including its turn and do not repeat automatically.

GML
control.set_absolute_detents(items)
control.get_absolute_detents()
control.get_absolute_detent()
ItemMeaning / default
itemsArray of up to 256 unique structs; [] disables.
angleRequired logical angle in degrees within ±10¹².
capture_angle / release_angle5° / 10°
max_torque / frequency / damping5 N·m / 8 Hz / 1

Require 0 < capture_angle < release_angle < 45°, torque/frequency > 0 and damping ≥ 0. Points at 90° and 450° are distinct positions. Duplicates are rejected; an invalid replacement leaves the previous list active. The list getter returns a copy.

Example#

GML
crank = jolt_control_crank({absolute_detents: [
    {angle: 90, max_torque: 3},
    {angle: 450, max_torque: 3}
]});
var held = crank.get_absolute_detent();
if (!is_undefined(held)) show_debug_message(held.angle);

get_absolute_detent() returns {index,angle}, with a zero-based input-order index, or undefined without an active point. Equal distances use input order. A captured absolute detent takes precedence over periodic detents and all motors. It is not a long-distance target motor: the control must first physically enter its capture area.

Verified operation contracts#

These contracts distinguish units, return values, errors and lifetime according to the current implementation. Check results: false, 0 and undefined can mean different things for different methods.

Symbol / ownerSignatureOperation contract
JoltControl.get_absolute_detentJoltControl.get_absolute_detent()Wheel/Crank: up to256 angle targets ±1e12°, 0<capture<release<45°, torque/frequency>0, damping>=0 (defaults 5/10°/5N·m/8Hz/1). Setter Boolean; copied list, active {index, angle} or undefined. [] disables.
JoltControl.get_absolute_detentsJoltControl.get_absolute_detents()Wheel/Crank: up to256 angle targets ±1e12°, 0<capture<release<45°, torque/frequency>0, damping>=0 (defaults 5/10°/5N·m/8Hz/1). Setter Boolean; copied list, active {index, angle} or undefined. [] disables.
JoltControl.set_absolute_detentsJoltControl.set_absolute_detents(options)Wheel/Crank: up to256 angle targets ±1e12°, 0<capture<release<45°, torque/frequency>0, damping>=0 (defaults 5/10°/5N·m/8Hz/1). Setter Boolean; copied list, active {index, angle} or undefined. [] disables.