Namespace in reactor_vehicles_drive.js

Drive

17 functions in 4 groups · hide internal

Rideable vehicles from the Prop Builder.

Quick Reference

Checks (True / False) 1

isDriving() Aboard a new vehicle and seated, on a 3D map (a forced route's tile steps included).

Actions 1

leave() A vehicle that is parked or left: nothing of the ride stays on what is drawn of it.

Updating & Drawing 1

tick() Tick.

Other 14

yawOf() A facing (1..9) as a heading in radians: 8 is north (0), 6 east, 2 south, 4 west.
dir8Of() The nearest of the eight facings to a heading.
dir4Of() The nearest of the four directions to a heading.
axles() Where a vehicle's two axles are, in tiles from its middle along its heading, and its circles' radius and the…
board() The mover's state for a ride that begins on event: its heading, a standstill, the ground under it, the dry pl…
seat() The ground under both axles read again where the player is now, at a standstill (after locate, a transfer, a…
state() $gamePlayer._rrDrive while driving, every field a number; else null.
scheme() "third": throttle, brake and steering.
viewYaw() The heading "up on the screen" is, in radians, where a held direction is driven toward.
input() The keys and the pad as the mover's input.
probe() What would refuse a vehicle a step, for a tool, a validator or a test: its middle at world (x, z), state shap…
resting() Where a vehicle rests over three reads of the ground (under its front axle, its middle and its rear axle), by…
solidAhead() Whether anything built stands between the heights lo and hi on the level line from (ox, oz) along the unit di…
shape() The shape the tests use for the ridden vehicle: { front, rear, radius, height } in tiles.

Checks (True / False)

isDriving

static source
Drive.isDriving()

Aboard a new vehicle and seated, on a 3D map (a forced route's tile steps included).

Actions

leave

static source
Drive.leave(event)

A vehicle that is parked or left: nothing of the ride stays on what is drawn of it.

Updating & Drawing

tick

static source
Drive.tick(sceneActive)

Tick.

Other

yawOf

static source
Drive.yawOf(direction)

A facing (1..9) as a heading in radians: 8 is north (0), 6 east, 2 south, 4 west.

dir8Of

static source
Drive.dir8Of(yaw)

The nearest of the eight facings to a heading.

dir4Of

static source
Drive.dir4Of(yaw)

The nearest of the four directions to a heading.

axles

static source
Drive.axles(event, type, out)

Where a vehicle's two axles are, in tiles from its middle along its heading, and its circles' radius and the room it needs overhead.

Details

Where a vehicle's two axles are, in tiles from its middle along its heading, and its circles' radius and the room it needs overhead. Without the model's own answer: 35% of its length each way.

board

static source
Drive.board(event)

The mover's state for a ride that begins on event: its heading, a standstill, the ground under it, the dry place here.

seat

static source
Drive.seat(player)

The ground under both axles read again where the player is now, at a standstill (after locate, a transfer, a route).

state

static source
Drive.state()

$gamePlayer._rrDrive while driving, every field a number; else null.

scheme

static source
Drive.scheme()

"third": throttle, brake and steering.

Details

"third": throttle, brake and steering. "point": a held direction is driven toward (the fixed, top-down and isometric views).

viewYaw

static source
Drive.viewYaw()

The heading "up on the screen" is, in radians, where a held direction is driven toward.

input

static source
Drive.input(out)

The keys and the pad as the mover's input.

Details

The keys and the pad as the mover's input. Third person: up and the right trigger are the throttle, down and the left trigger the brake (the brake wins), left and right steer. The fixed views: the held direction is a heading through the camera's yaw; the vehicle steers toward it, and turns where it stands first when it points the other way. A kind that cannot turn where it stands drives round on full lock instead.

probe

static source
Drive.probe(state, x, z, length, type)

What would refuse a vehicle a step, for a tool, a validator or a test: its middle at world (x, z), state shaped as the mover's ({ yaw, alt, gf, gr, air }, and gm where known), going length tiles along its heading (backward when negative).

Details

What would refuse a vehicle a step, for a tool, a validator or a test: its middle at world (x, z), state shaped as the mover's ({ yaw, alt, gf, gr, air }, and gm where known), going length tiles along its heading (backward when negative). Answers a name of REFUSALS, "" when it may go. type is a filled type record (the motorcycle's numbers without one). The world is asked exactly as the tick asks it.

resting

static source
Drive.resting(front, middle, rear, out)

Where a vehicle rests over three reads of the ground (under its front axle, its middle and its rear axle), by the step of the type last ridden or probed: its height into out.alt, each axle's into out.front and out.rear.

Details

Where a vehicle rests over three reads of the ground (under its front axle, its middle and its rear axle), by the step of the type last ridden or probed: its height into out.alt, each axle's into out.front and out.rear. A wheel more than a step under the line of the other two hangs.

solidAhead

static source
Drive.solidAhead(mapData, ox, oz, gx, gz, far, lo, hi)

Whether anything built stands between the heights lo and hi on the level line from (ox, oz) along the unit direction (gx, gz) for far tiles.

Details

Whether anything built stands between the heights lo and hi on the level line from (ox, oz) along the unit direction (gx, gz) for far tiles.

shape

static source
Drive.shape()

The shape the tests use for the ridden vehicle: { front, rear, radius, height } in tiles.

Details

The shape the tests use for the ridden vehicle: { front, rear, radius, height } in tiles. Read it, do not keep it.