Grapple and swing
Adds anchor-and-rope traversal with slack and taut ropes, steering, moving anchors, bounded reeling and a release that keeps momentum, from one shared Rust core.
Grapple and swing (movement.grapple) #
What it is for #
Adds anchor-and-rope traversal with slack and taut ropes, steering, moving anchors, bounded reeling and a release that keeps momentum, from one shared Rust core.
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: "movement.grapple" }
gripforge_gamekit_configure { project_id: "gkp_…", id: "movement.grapple",
config: { "minLength": 1, "maxLength": 60 } }
First example #
<!-- test: kits/movement_grapple/tests/movement_grapple.rs::attach_records_the_rope_length_from_the_distance --> This is the body of the passing test attach_records_the_rope_length_from_the_distance; the helper functions it calls are defined at the top of the same test file.
#[test]
fn attach_records_the_rope_length_from_the_distance() {
let mut s = rope(json!({}));
assert_eq!(
req(&mut s, KIT, json!({"op": "status"})),
json!({"attached": false, "rope": null})
);
let st = attach(&mut s);
assert_eq!(st["attached"], true);
assert!(near(&st["rope"]["length"], 10.0));
assert_eq!(st["rope"]["anchor"], json!([0.0, 10.0, 0.0]));
}
Settings and defaults #
Descriptions come from the kit manifest and stay in English.
| Setting | Type | Default | Range or values | Meaning |
|---|---|---|---|---|
minLength | number | 1 | 0.01–1000 | Minimum rope length; must not exceed maxLength. |
maxLength | number | 60 | 0.01–10000 | Maximum attachment distance and rope length. |
reelSpeed | number | 8 | 0–100 | Rate of rope shortening or extension. |
steeringAcceleration | number | 12 | 0–200 | Full tangential steering acceleration. |
Services, events, variables #
- Service
movement.grapple: Named instances: create(id, config), request(id, command), remove(id), ids(). Optional move(id, entity, command) uses PhysicsPort. Commands: attach, step, release; status, config, preview, save, load. Default instance uses installed config. - Events emitted:
movement.grapple.created(instance,preset) — An instance was created.movement.grapple.removed(instance) — An instance was removed.movement.grapple.changed(instance,op,result) — A decided command applied to an instance (never a read or a fixed step).movement.grapple.refused(instance,op,by,reason) — A tap of movement.grapple.request cancelled a command.
- Verbs of the scripting layer:
movement_grapple_request(action) — Send a command to an instance of the kit (through the request hook).movement_grapple_exists(condition) — The instance exists (default: default).
Hooks and modding #
- Hooks (a game or a mod can intercept them):
movement.grapple.create(fields a tap may change:config; cancellable) — An instance is about to be created (create(id, config)).movement.grapple.request(fields a tap may change:command; cancellable) — A decided command (every op but the reads and the fixed steps) is about to apply to an instance.
- Moddable settings:
minLength,maxLength,reelSpeed,steeringAcceleration - Moddable collections:
movement_grapple_presets
Engines #
Declared targets: rust, web. gripforge kit api movement.grapple lists the exact settings and services of your version.
Versions #
Kit version 1.1.0.