Class in reactor_objects_map.js

Game_Character

52 public functions in 7 groups · show internal (_) functions

Everything here is tracked by Game Objects: the party, the map, its events.

Familiar territory. Game_Character keeps the RPG Maker MZ API, so existing MZ knowledge, tutorials and plugin code apply. Reactor's additions are marked with descriptions below.

Quick Reference

Setup & Creation 2

initialize() Sets up a new instance.
initMembers() Initializes the members.

Getting Information 1

findDirectionTo() Finds the direction to.

Checks (True / False) 1

isMoveRouteForcing() Whether it is move route forcing.

Actions 18

restoreMoveRoute() Restores the move route.
setMoveRoute() Sets the move route.
moveRandom() Move random.
moveTowardCharacter() Move toward character.
moveAwayFromCharacter() Move away from character.
turnTowardCharacter() Turn toward character.
turnAwayFromCharacter() Turn away from character.
turnTowardPlayer() Turn toward player.
turnAwayFromPlayer() Turn away from player.
moveTowardPlayer() Move toward player.
moveAwayFromPlayer() Move away from player.
moveForward() Move forward.
moveBackward() Move backward.
turnRight90() Turn right90.
turnLeft90() Turn left90.
turnRightOrLeft90() Turn right or left90.
turnRandom() Turn random.
swap() Swap.

Events, Commands & Input 2

processMoveCommand() Handles the move command.
processRouteEnd() Handles the route end.

Updating & Drawing 2

updateStop() Updates the stop each frame.
updateRoutineMove() Updates the routine move each frame.

Other 26

memorizeMoveRoute() Memorize move route.
forceMoveRoute() Force move route.
deltaXFrom() Delta x from.
deltaYFrom() Delta y from.
advanceMoveRouteIndex() Advance move route index.
turn180() Turn180.
searchLimit() Search limit.
walkScratch() The arrays every search uses, made once: a tile opened is a row in each.
reactorMoveToTile() A route's Move to Tile step: the character walks to the tile by path finding and the route stays on this step…
reactorWalkTo() The same walk from outside a route: a forced route of that one step, so the character's own route waits for i…
reactorTeleportTo() A route's Teleport to Tile step: the character stands on the tile at once, no walk and no path needed, and th…
walkRoute() The one-step route that walks to a tile (height and whole as reactorMoveToTile takes them).
reactorIsWalking() Whether a walk to a tile is under way.
reactorWalkArrived() Whether the character stands on the tile its walk is to, on the floor meant where one is named.
reactorWalkAllows() Whether a walk may take the step from (x, y) toward d: the character's own step rule.
reactorWalkStep() One step of a walk from tile (x, y), standing at height there (the level of a 3D map; 0 on a flat one): the h…
reactorWalkHeight() The height a walk starts from: where the character stands on a 3D map (on a ladder, the height it holds), 0 o…
reactorUpdateWalk() One frame of a walk to a tile, asked while the character stands: the next step of its path, or a slice of the…
reactorEndWalk() Reactor end walk.
reactorSearchWalk() The path to a tile, or null while it is still being looked for: one search runs at a time, a slice a frame, s…
reactorFindPath() The path to a tile, found at once: { directions, length, reached, exhausted, opened }, to the nearest tile re…
reactorBeginSearch() Reactor begin search.
walkLeft() The steps left from a tile to the goal at least: on another floor than the one meant, further by a stair's wo…
walkKey() A tile on a floor: two floors over one tile (a bridge and the road under it) are two places.
reactorRunSearch() Opens up to budget tiles of a search, or as many as milliseconds allow (never fewer than WALK_SLICE_FEWEST).
reactorFinishSearch() The steps from the start to the goal, or to the nearest tile reached where the goal was not.

Setup & Creation

initialize

method source
Game_Character.prototype.initialize()

Sets up a new instance. (Same as the RPG Maker MZ method of this name.)

initMembers

method source
Game_Character.prototype.initMembers()

Initializes the members. (Same as the RPG Maker MZ method of this name.)

Getting Information

findDirectionTo

method source
Game_Character.prototype.findDirectionTo(goalX, goalY)

Finds the direction to. (Same as the RPG Maker MZ method of this name.)

Checks (True / False)

isMoveRouteForcing

method source
Game_Character.prototype.isMoveRouteForcing()

Whether it is move route forcing. (Same as the RPG Maker MZ method of this name.)

Actions

restoreMoveRoute

method source
Game_Character.prototype.restoreMoveRoute()

Restores the move route. (Same as the RPG Maker MZ method of this name.)

setMoveRoute

method source
Game_Character.prototype.setMoveRoute(moveRoute)

Sets the move route. (Same as the RPG Maker MZ method of this name.)

moveRandom

method source
Game_Character.prototype.moveRandom()

Move random. (Same as the RPG Maker MZ method of this name.)

moveTowardCharacter

method source
Game_Character.prototype.moveTowardCharacter(character)

Move toward character. (Same as the RPG Maker MZ method of this name.)

moveAwayFromCharacter

method source
Game_Character.prototype.moveAwayFromCharacter(character)

Move away from character. (Same as the RPG Maker MZ method of this name.)

turnTowardCharacter

method source
Game_Character.prototype.turnTowardCharacter(character)

Turn toward character. (Same as the RPG Maker MZ method of this name.)

turnAwayFromCharacter

method source
Game_Character.prototype.turnAwayFromCharacter(character)

Turn away from character. (Same as the RPG Maker MZ method of this name.)

turnTowardPlayer

method source
Game_Character.prototype.turnTowardPlayer()

Turn toward player. (Same as the RPG Maker MZ method of this name.)

turnAwayFromPlayer

method source
Game_Character.prototype.turnAwayFromPlayer()

Turn away from player. (Same as the RPG Maker MZ method of this name.)

moveTowardPlayer

method source
Game_Character.prototype.moveTowardPlayer()

Move toward player. (Same as the RPG Maker MZ method of this name.)

moveAwayFromPlayer

method source
Game_Character.prototype.moveAwayFromPlayer()

Move away from player. (Same as the RPG Maker MZ method of this name.)

moveForward

method source
Game_Character.prototype.moveForward()

Move forward. (Same as the RPG Maker MZ method of this name.)

moveBackward

method source
Game_Character.prototype.moveBackward()

Move backward. (Same as the RPG Maker MZ method of this name.)

turnRight90

method source
Game_Character.prototype.turnRight90()

Turn right90. (Same as the RPG Maker MZ method of this name.)

turnLeft90

method source
Game_Character.prototype.turnLeft90()

Turn left90. (Same as the RPG Maker MZ method of this name.)

turnRightOrLeft90

method source
Game_Character.prototype.turnRightOrLeft90()

Turn right or left90. (Same as the RPG Maker MZ method of this name.)

turnRandom

method source
Game_Character.prototype.turnRandom()

Turn random. (Same as the RPG Maker MZ method of this name.)

swap

method source
Game_Character.prototype.swap(character)

Swap. (Same as the RPG Maker MZ method of this name.)

Events, Commands & Input

processMoveCommand

method source
Game_Character.prototype.processMoveCommand(command)

Handles the move command. (Same as the RPG Maker MZ method of this name.)

processRouteEnd

method source
Game_Character.prototype.processRouteEnd()

Handles the route end. (Same as the RPG Maker MZ method of this name.)

Updating & Drawing

updateStop

method source
Game_Character.prototype.updateStop()

Updates the stop each frame. (Same as the RPG Maker MZ method of this name.)

updateRoutineMove

method source
Game_Character.prototype.updateRoutineMove()

Updates the routine move each frame. (Same as the RPG Maker MZ method of this name.)

Other

memorizeMoveRoute

method source
Game_Character.prototype.memorizeMoveRoute()

Memorize move route. (Same as the RPG Maker MZ method of this name.)

forceMoveRoute

method source
Game_Character.prototype.forceMoveRoute(moveRoute)

Force move route. (Same as the RPG Maker MZ method of this name.)

deltaXFrom

method source
Game_Character.prototype.deltaXFrom(x)

Delta x from. (Same as the RPG Maker MZ method of this name.)

deltaYFrom

method source
Game_Character.prototype.deltaYFrom(y)

Delta y from. (Same as the RPG Maker MZ method of this name.)

advanceMoveRouteIndex

method source
Game_Character.prototype.advanceMoveRouteIndex()

Advance move route index. (Same as the RPG Maker MZ method of this name.)

turn180

method source
Game_Character.prototype.turn180()

Turn180. (Same as the RPG Maker MZ method of this name.)

searchLimit

method source
Game_Character.prototype.searchLimit()

Search limit. (Same as the RPG Maker MZ method of this name.)

walkScratch

static source
Game_Character.walkScratch()

The arrays every search uses, made once: a tile opened is a row in each.

reactorMoveToTile

method source
Game_Character.prototype.reactorMoveToTile(x, y, height, whole)

A route's Move to Tile step: the character walks to the tile by path finding and the route stays on this step until it stands there.

Details

A route's Move to Tile step: the character walks to the tile by path finding and the route stays on this step until it stands there. Where the tile cannot be reached it goes as near as it can; a route with Skip If Cannot Move then goes on to its next step, and any other tries again at intervals, as a blocked step does. A second call replaces the first. height names the floor of a 3D map the tile is meant on (without it, whichever floor of the tile is come to first); whole takes the whole way or none: no walk to somewhere near (a number: nor a way of more steps than that).

reactorWalkTo

method source
Game_Character.prototype.reactorWalkTo(x, y, skippable = true)

The same walk from outside a route: a forced route of that one step, so the character's own route waits for it and isMoveRouteForcing says whether it is still on its way.

Details

The same walk from outside a route: a forced route of that one step, so the character's own route waits for it and isMoveRouteForcing says whether it is still on its way. skippable false keeps trying where the tile cannot be reached.

reactorTeleportTo

method source
Game_Character.prototype.reactorTeleportTo(x, y)

A route's Teleport to Tile step: the character stands on the tile at once, no walk and no path needed, and the route goes straight on.

Details

A route's Teleport to Tile step: the character stands on the tile at once, no walk and no path needed, and the route goes straight on. Any walk under way ends; the player's camera and followers come along (Game_Player.locate).

walkRoute

static source
Game_Character.walkRoute(x, y, skippable = true, height, whole)

The one-step route that walks to a tile (height and whole as reactorMoveToTile takes them).

Details

The one-step route that walks to a tile (height and whole as reactorMoveToTile takes them).

reactorIsWalking

method source
Game_Character.prototype.reactorIsWalking()

Whether a walk to a tile is under way.

reactorWalkArrived

method source
Game_Character.prototype.reactorWalkArrived()

Whether the character stands on the tile its walk is to, on the floor meant where one is named.

reactorWalkAllows

method source
Game_Character.prototype.reactorWalkAllows(x, y, d)

Whether a walk may take the step from (x, y) toward d: the character's own step rule.

reactorWalkStep

method source
Game_Character.prototype.reactorWalkStep(x, y, d, height)

One step of a walk from tile (x, y), standing at height there (the level of a 3D map; 0 on a flat one): the height stood at on the next tile, or NaN where the step cannot be taken.

Details

One step of a walk from tile (x, y), standing at height there (the level of a 3D map; 0 on a flat one): the height stood at on the next tile, or NaN where the step cannot be taken. The character is asked as if it stood on that tile at that height, so the slopes, ledges and floors of a 3D map are judged by the rule its own steps are.

reactorWalkHeight

method source
Game_Character.prototype.reactorWalkHeight()

The height a walk starts from: where the character stands on a 3D map (on a ladder, the height it holds), 0 on a flat one.

reactorUpdateWalk

method source
Game_Character.prototype.reactorUpdateWalk()

One frame of a walk to a tile, asked while the character stands: the next step of its path, or a slice of the search for one.

Details

One frame of a walk to a tile, asked while the character stands: the next step of its path, or a slice of the search for one. True once the walk is over (the character stands on the tile, or cannot get nearer and its route skips what cannot be done), with the movement success set to whether it arrived.

reactorEndWalk

method source
Game_Character.prototype.reactorEndWalk(arrived)

Reactor end walk. (Same as the RPG Maker MZ method of this name.)

reactorSearchWalk

method source
Game_Character.prototype.reactorSearchWalk(goalX, goalY, goalHeight, limit)

The path to a tile, or null while it is still being looked for: one search runs at a time, a slice a frame, so a long way round never holds a frame.

reactorFindPath

method source
Game_Character.prototype.reactorFindPath(goalX, goalY, goalHeight)

The path to a tile, found at once: { directions, length, reached, exhausted, opened }, to the nearest tile reached where reached is false.

Details

The path to a tile, found at once: { directions, length, reached, exhausted, opened }, to the nearest tile reached where reached is false. For scripts and tests; a walk searches in slices.

reactorBeginSearch

method source
Game_Character.prototype.reactorBeginSearch(goalX, goalY, goalHeight, limit)

Reactor begin search. (Same as the RPG Maker MZ method of this name.)

walkLeft

static source
Game_Character.walkLeft(x, y, height, goalX, goalY, goalHeight)

The steps left from a tile to the goal at least: on another floor than the one meant, further by a stair's worth.

walkKey

static source
Game_Character.walkKey(x, y, height)

A tile on a floor: two floors over one tile (a bridge and the road under it) are two places.

reactorRunSearch

method source
Game_Character.prototype.reactorRunSearch(search, budget, milliseconds)

Opens up to budget tiles of a search, or as many as milliseconds allow (never fewer than WALK_SLICE_FEWEST).

Details

Opens up to budget tiles of a search, or as many as milliseconds allow (never fewer than WALK_SLICE_FEWEST). True once it is over: search.path is then the way.

reactorFinishSearch

method source
Game_Character.prototype.reactorFinishSearch(search)

The steps from the start to the goal, or to the nearest tile reached where the goal was not.