Mounts

Adds rideable creatures: a mount is a document with walk, trot and gallop speeds, turning, stamina, jump and saddlebags; the player walks up to ride, dismounts with the same key and whistles to call it.

Source: module-kits:kits/mount_ride/usage/en.mdView Markdown source

Also read offline — CLI: grip-forge docs mount-rideMCP tool: gripforge_docs { "topic": "mount-ride" }

Mounts (mount.ride) #

What it is for #

Adds rideable creatures: a mount is a document with walk, trot and gallop speeds, turning, stamina, jump and saddlebags; the player walks up to ride, dismounts with the same key and whistles to call it.

It needs input.actions, character.control, physics.port, 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: "mount.ride" }
gripforge_gamekit_configure { project_id: "gkp_…", id: "mount.ride",
                              config: { "reach": 3, "rideLabel": "Ride {name}" } }

First example #

The kit has no dedicated test yet; this installs it and sets two of its settings to their defaults.

gripforge_gamekit_install   { project_id: "gkp_…", id: "mount.ride" }
gripforge_gamekit_configure { project_id: "gkp_…", id: "mount.ride",
                              config: { "reach": 3, "rideLabel": "Ride {name}" } }

Settings and defaults #

Descriptions come from the kit manifest and stay in English.

SettingTypeDefaultRange or valuesMeaning
reachnumber31–10How close the player stands to ride (interaction prompt and mount(entity)).
rideLabelstring"Ride {name}"Prompt on a mount; {name} is its name.
callRangenumber800–1000A mount within this distance walks to the player when called; further away it appears behind the player (0: never appears, only…
recoverRationumber0.30–1An exhausted mount gallops again once its stamina is back to this share of the maximum.
gravitynumber201–60Fall acceleration while riding (m/s²).
bagsLabelstring"Saddlebags"Name of the saddlebag container (storage.containers).
arriveDistancenumber2.50.5–50A called mount stops this far from the player.
appearDistancenumber61–100How far behind the player a mount called from beyond callRange appears.
dismountSidenumber1.30–5How far to the left of the mount the rider stands after getting off.
reverseRationumber0.60–1Backing speed as a share of the walk speed.

Services, events, variables #

  • Service mount.ride: mounts(), riding() → view|null, mount(entity), dismount(), call(entity?), gait(), stamina(entity?), owned(), spawn(mount, at, opts?), bags(entity?), openBags(), gallop(on) → held from a button as the sprint key.
  • Events emitted:
    • mount.mounted (entity, mount, rider)
    • mount.dismounted (entity, mount, rider)
    • mount.gait (entity, gait)
    • mount.jumped (entity)
    • mount.exhausted (entity) — The gallop emptied the stamina: trot only until recoverRatio is back.
    • mount.recovered (entity)
    • mount.called (entity, distance, teleported)
    • mount.arrived (entity)
    • mount.refused (entity, mount, rider, decision, reason) — A tap of one of the kit's hooks cancelled a decision (never emitted without a tap).
  • Events listened to: interaction.requested, entity.spawned
  • Variables:
    • mount.riding (boolean) — Riding
    • mount.name (string) — Mount name
    • mount.gait (string) — Mount gait
    • mount.stamina (number) — Mount stamina
    • mount.stamina.max (number) — Mount stamina maximum
    • mount.speed (number) — Mount speed
  • Verbs of the scripting layer:
    • spawn_mount (action) — Stand a mount in the world (default: beside the player).
    • dismount (action) — The player gets off the mount.
    • is_riding (condition) — The player rides (a mount of that document when given).
  • Input actions: mount_call

Hooks and modding #

  • Hooks (a game or a mod can intercept them):
    • mount.mount (cancellable) — The player is about to get on the mount entity (document mount), in reach and free; owned says it is already the player's.
    • mount.dismount (cancellable) — The rider is about to get off (the interact key when it is pressed, the dismount action, dismount()); gait and speed are the mount's now.
    • mount.jump (fields a tap may change: speed, cost; cancellable) — The ridden mount is about to jump (the jump key was pressed, it stands on the ground and has the stamina of its document): speed is the take-off speed in m/s, cost the stamina spent.
    • mount.gallop (cancellable) — The ridden mount is about to break into a gallop (sprint held, not exhausted).
    • mount.call (fields a tap may change: teleport; cancellable) — The player calls the mount entity, distance metres away.
  • Moddable settings: reach, rideLabel, callRange, recoverRatio, gravity, bagsLabel, arriveDistance, appearDistance, dismountSide, reverseRatio
  • Moddable collections: mounts
  • Components: mount

Engines #

Declared targets: web, rust. gripforge kit api mount.ride lists the exact settings and services of your version.

Versions #

Kit version 1.3.0.