Class: Game_Player

Game_Player

new Game_Player()

The game object class for the player. It contains event starting determinants and map scrolling functions.

Extends

Methods

advanceMoveRouteIndex()inherited

Advances the move route index

animationWait()numberinherited

Get the wait between animation frames
Returns:
TypeDescription
numberAmount to wait between animation frames

areFollowersGathered(True)

Check if followers are gathered
NameTypeDescription
Truebooleanif gathered

areFollowersGathering(True)

Check if player followers are gathering
NameTypeDescription
Truebooleanif gathering

blendMode()numberinherited

Get the blend mode of the character
Returns:
TypeDescription
numberThe character's blend mode

bushDepth()numberinherited

Get the character's bush depth
Returns:
TypeDescription
numberThe character's bush depth

canEncounter()boolean

Check if the player can encounter enemies
Returns:
TypeDescription
booleanTrue if can encounter

canMove()boolean

Check if the player can move
Returns:
TypeDescription
booleanTrue if the player can move

canPass(x, y, d)booleaninherited

Check if the character can pass a tile in front of them given x/y coordinates and direction
NameTypeDescription
xnumberThe x coordinate at the start of the move
ynumberThe y coordinate at the start of the move
dnumberThe direction of the move
Returns:
TypeDescription
booleanTrue if can pass

canPassDiagonally(x, y, horz, vert)booleaninherited

Check if the character can diagonally pass a tile in front of them given x/y coordinates and horizontal/vertical direction
NameTypeDescription
xnumberThe x coordinate at the start of the move
ynumberThe y coordinate at the start of the move
horznumberThe horizontal direction of the move
vertnumberThe vertical direction of the move
Returns:
TypeDescription
booleanTrue if can pass

canStartLocalEvents()boolean

Check if local events can start
Returns:
TypeDescription
booleanTrue if local events can start

center(x, y)undefined

Center on the given position
NameTypeDescription
xnumberThe x position to center on
ynumberThe y position to center on
Returns:
TypeDescription
undefinedUndefined is returned

centerX()number

Get the center x coordinate
Returns:
TypeDescription
numberCenter x coordinate

centerY()number

Get the center y coordinate
Returns:
TypeDescription
numberCenter y coordinate

characterIndex()numberinherited

Get the character's index (for character sheet image)
Returns:
TypeDescription
numberThe character index

characterName()stringinherited

Get the character's name (for character sheet image)
Returns:
TypeDescription
stringThe character name

checkEventTriggerHere(triggers)

Check event triggers on the player's location
NameTypeDescription
triggersArray.<number>The triggers to check for

checkEventTriggerThere(triggers)

Check event triggers one tile in front of the player
NameTypeDescription
triggersArray.<number>The triggers to check for

checkEventTriggerTouch(x, y)overrides

Check event triggers for touch
NameTypeDescription
xnumberThe x coordinate to check
ynumberThe y coordinate to check

checkEventTriggerTouchFront(d)inherited

Check for event trigger touch (in front of character)
NameTypeDescription
dnumberThe character's direction

checkStop(threshold)booleaninherited

Check if the character should stop
NameTypeDescription
thresholdnumberThe threshold after which the character should stop
Returns:
TypeDescription
booleanTrue if should stop

clearTransferInfo()

Clear player transfer data

copyPosition(character)inherited

Copies the position of another character
NameTypeDescription
characterGame_CharacterThe character to copy position from

deltaXFrom(x)numberinherited

Get the delta x from the given x and the character x
NameTypeDescription
xnumberThe given x
Returns:
TypeDescription
numberThe delta x

deltaYFrom(y)numberinherited

Get the delta y from the given y and the character y
NameTypeDescription
ynumberThe given y
Returns:
TypeDescription
numberThe delta y

direction()numberinherited

Get the direction of the character
Returns:
TypeDescription
numberThe character direction

distancePerFrame()numberinherited

Get the distance moved per frame
Returns:
TypeDescription
numberThe distance moved per frame

encounterProgressValue()number

Get the encounter progress value
Returns:
TypeDescription
numberThe encounter progress amount

endAnimation()inherited

End the animation

endBalloon()inherited

End the balloon animation

executeEncounter()boolean

Start an encounter
Returns:
TypeDescription
booleanTrue if encounter succeeded

executeMove(direction)

Move the player
NameTypeDescription
directionnumberThe direction to move

fadeType()number

Get the fade type of a transfer
Returns:
TypeDescription
numberThe fade type

findDirectionTo(goalX, goalY)numberinherited

Find the direction to a given x/y coordinate
NameTypeDescription
goalXnumberThe goal x coordinate
goalYnumberThe goal y coordinate
Returns:
TypeDescription
numberThe direction to the goal coordinates

followers()Game_Followers

Get the player's followers
Returns:
TypeDescription
Game_FollowersThe game followers object

forceMoveForward()

Force the player to move forward

forceMoveRoute(moveRoute)inherited

Forces a move route
NameTypeDescription
moveRouteObjectThe move route to force

gatherFollowers()

Gather player followers

getInputDirection()number

Get the direction of input
Returns:
TypeDescription
numberThe direction of input

getOffVehicle(True)

Processing for getting off a vehicle
NameTypeDescription
Truebooleanif get off started

getOnOffVehicle(True)

Processing for getting on or off a vehicle
NameTypeDescription
Truebooleanif get on/off started

getOnVehicle(True)

Processing for getting on a vehicle
NameTypeDescription
Truebooleanif get on started

hasStepAnime()booleaninherited

Check if the character has a step animation
Returns:
TypeDescription
booleanTrue if has step animation

hasWalkAnime()booleaninherited

Check if the character has a walk animation
Returns:
TypeDescription
booleanTrue if has walk animation

hideFollowers()

Hide player followers

increaseSteps()inheritedoverrides

Increase the character's steps

initMembers()inheritedoverrides

Initialize character variables

initialize()inheritedoverrides

Initialize the character

isAnimationPlaying()booleaninherited

Check if the animation is playing
Returns:
TypeDescription
booleanTrue if animation playing

isBalloonPlaying()booleaninherited

Check if the character balloon animation is playing
Returns:
TypeDescription
booleanTrue if balloon animation playing

isCollided(x, y)boolean

Check if the player is collided with
NameTypeDescription
xnumberThe x coordinate to check for collision
ynumberThe y coordinate to check for collision
Returns:
TypeDescription
booleanTrue if collided

isCollidedWithCharacters(x, y)booleaninherited

Check if the character collided with other characters
NameTypeDescription
xnumberThe x coordinate to check
ynumberThe y coordinate to check
Returns:
TypeDescription
booleanTrue if collided

isCollidedWithEvents(x, y)booleaninherited

Check if the character collided with event characters
NameTypeDescription
xnumberThe x coordinate to check
ynumberThe y coordinate to check
Returns:
TypeDescription
booleanTrue if collided

isCollidedWithVehicles(x, y)booleaninherited

Check if the character collided with vehicle characters
NameTypeDescription
xnumberThe x coordinate to check
ynumberThe y coordinate to check
Returns:
TypeDescription
booleanTrue if collided

isDashButtonPressed()boolean

Check if dash button is being pressed
Returns:
TypeDescription
booleanTrue if dash button is pressed

isDashing()booleanoverrides

Check if the player is dashing
Returns:
TypeDescription
booleanTrue if dashing

isDebugThrough()booleanoverrides

Check if the player is through as a result of debug inputs
Returns:
TypeDescription
booleanTrue if in debug through mode

isDirectionFixed()booleaninherited

Check if the character has a fixed direction
Returns:
TypeDescription
booleanTrue if has fixed direction

isInAirship()boolean

Check if the player is in the airship
Returns:
TypeDescription
booleanTrue if in airship

isInBoat()boolean

Check if the player is in the boat
Returns:
TypeDescription
booleanTrue if in boat

isInShip()boolean

Check if the player is in the ship
Returns:
TypeDescription
booleanTrue if in ship

isInVehicle()boolean

Check if the player is in any vehicle
Returns:
TypeDescription
booleanTrue if in vehicle

isJumping()booleaninherited

Check if the character is jumping
Returns:
TypeDescription
booleanTrue if jumping

isMapPassable(x, y, d)booleaninheritedoverrides

Check if the map is passable between two tiles
NameTypeDescription
xnumberThe x coordinate at the start of the move
ynumberThe y coordinate at the start of the move
dnumberThe direction of the move
Returns:
TypeDescription
booleanTrue if map is passable

isMoveRouteForcing()booleaninherited

Check if move route is forcing
Returns:
TypeDescription
booleanTrue if forcing

isMovementSucceeded()booleaninherited

Check for movement success
Returns:
TypeDescription
booleanTrue if movement succeeded

isMoving()booleaninherited

Check if the character is moving
Returns:
TypeDescription
booleanTrue if moving

isNearTheScreen()booleaninherited

Check if the character is near the screen
Returns:
TypeDescription
booleanTrue if near the screen

isNormal()boolean

Check if the player is normal
Returns:
TypeDescription
booleanTrue if normal

isNormalPriority()booleaninherited

Check if the character is normal priority
Returns:
TypeDescription
booleanTrue if normal priority

isObjectCharacter()booleaninherited

Check if the character is an object character
Returns:
TypeDescription
booleanTrue if object character

isOnBush()booleaninherited

Check if the character is on a bush
Returns:
TypeDescription
booleanTrue if on bush tile

isOnDamageFloor(True)

Check if the player is on a damage floor
NameTypeDescription
Truebooleanif on damage floor

isOnLadder()booleaninherited

Check if the character is on a ladder
Returns:
TypeDescription
booleanTrue if on ladder

isOriginalPattern()booleaninherited

Check if the pattern is in the original state
Returns:
TypeDescription
booleanTrue if in original state

isStopping()booleaninheritedoverrides

Check if the character is stopping
Returns:
TypeDescription
booleanTrue if stopping

isThrough()booleaninherited

Check if the character is through
Returns:
TypeDescription
booleanTrue if through

isTile()booleaninherited

Check if the character is a tile
Returns:
TypeDescription
booleanTrue if tile

isTransferring()boolean

Check if the player is transferring
Returns:
TypeDescription
booleanTrue if transferring

isTransparent()booleaninherited

Check if the character is transparent
Returns:
TypeDescription
booleanTrue if transparent

jump(xPlus, yPlus)inheritedoverrides

Jumps the character
NameTypeDescription
xPlusnumberAmount to jump in the x direction
yPlusnumberAmount to jump in the y direction

jumpHeight()numberinherited

Get the character's jump height
Returns:
TypeDescription
numberThe character's jump height

locate(x, y)inheritedoverrides

Locates the character to the given coordinates
NameTypeDescription
xnumberThe new x coordinate
ynumberThe new y coordinate

makeEncounterCount()

Make the encounter count for the player

makeEncounterTroopId()number

Get a troop id to encounter
Returns:
TypeDescription
numberThe troop id to encounter

maxPattern()numberinherited

Get the maximum pattern for animation
Returns:
TypeDescription
numberThe maximum pattern for animation

meetsEncounterConditions(encounter)boolean

Check if an encounter meets conditions
NameTypeDescription
encounterObjectThe encounter object to check
Returns:
TypeDescription
booleanTrue if conditions are met

memorizeMoveRoute()inherited

Memorizes the character move route

moveAwayFromCharacter(character)inherited

Moves away from the given character
NameTypeDescription
characterGame_CharacterThe character to move away from

moveAwayFromPlayer()inherited

Moves away from the player

moveBackward()inherited

Moves backward

moveByInput()

Move the player with input

moveDiagonally(horz, vert)inheritedoverrides

Moves diagonally in the given directions
NameTypeDescription
horznumberThe horizontal direction to move in
vertnumberThe vertical direction to move in

moveForward()inherited

Moves forward

moveFrequency()numberinherited

Get the move frequency of the character
Returns:
TypeDescription
numberThe character's movement frequency

moveRandom()inherited

Random move handling

moveSpeed()numberinherited

Get the move speed of the character
Returns:
TypeDescription
numberThe character's movement speed

moveStraight(d)inheritedoverrides

Moves straight in the given direction
NameTypeDescription
dnumberThe direction to move in

moveTowardCharacter(character)inherited

Moves toward the given character
NameTypeDescription
characterGame_CharacterThe character to move toward

moveTowardPlayer()inherited

Moves toward the player

newMapId()number

Get the new map id of a transfer
Returns:
TypeDescription
numberThe new map id

opacity()numberinherited

Get the opacity of the character
Returns:
TypeDescription
numberThe character's opacity

pattern()numberinherited

Get the current animation pattern
Returns:
TypeDescription
numberThe current animation pattern

performTransfer()

Processing when the transfer occurs

pos(x, y)booleaninherited

Check if the character's position is equal to the passed coordinates
NameTypeDescription
xnumberThe x coordinate to check
ynumberThe y coordinate to check
Returns:
TypeDescription
booleanTrue if coordinates match

posNt(x, y)booleaninherited

Check if the character's position is equal to the passed coordinates, and it's (n)ot (t)hrough
NameTypeDescription
xnumberThe x coordinate to check
ynumberThe y coordinate to check
Returns:
TypeDescription
booleanTrue if coordinates match and the character is not through

processMoveCommand(command)inherited

Processes a given move command
NameTypeDescription
commandObjectThe move command

processRouteEnd()inherited

Processing when move route ends

realMoveSpeed()numberinherited

Get the real movement speed for the character (factor in dashing or other effects)
Returns:
TypeDescription
numberThe actual move speed of the character

refresh()

Refresh the player

refreshBushDepth()inherited

Refresh the character for bush depth change

regionId()numberinherited

Get the region id the character is on
Returns:
TypeDescription
numberThe region id

requestMapReload()

Request the map to reload

reserveTransfer(mapId, x, y, d, fadeType)

Reserve a transfer
NameTypeDescription
mapIdnumberThe map id to transfer to
xnumberThe x coordinate to transfer to
ynumberThe y coordinate to transfer to
dnumberThe direction to face after transfer
fadeTypenumberThe type of fade for the transfer

resetPattern()inherited

Resets the animation pattern

resetStopCount()inherited

Resets the stop count

restoreMoveRoute()inherited

Restores a memorized move route

reverseDir(d)inherited

Reverse the character's direction
NameTypeDescription
dnumberThe direction to reverse from

screenX()numberinherited

Get the character screen x value
Returns:
TypeDescription
numberThe screen x value

screenY()numberinherited

Get the character screen y value
Returns:
TypeDescription
numberThe screen y value

screenZ()numberinherited

Get the character screen z value
Returns:
TypeDescription
numberThe screen z value

scrolledX()numberinherited

Get the character scrolled x value
Returns:
TypeDescription
numberThe scrolled x value

scrolledY()numberinherited

Get the character scrolled y value
Returns:
TypeDescription
numberThe scrolled y value

searchLimit()numberinherited

The maximum amount of tiles to search for finding direction
Returns:
TypeDescription
numberThe search limit

setBlendMode(blendMode)inherited

Set the blend mode of the character
NameTypeDescription
blendModenumberThe character's new blend mode

setDirection(d)inherited

Set the direction of the character
NameTypeDescription
dnumberThe character's new direction

setDirectionFix(directionFix)inherited

Set the character direction fix flag
NameTypeDescription
directionFixbooleanNew direction fix flag

setImage(characterName, characterIndex)inherited

Set the character's image properties (character name and index)
NameTypeDescription
characterNamestringThe new character name
characterIndexnumberThe new character index

setMoveFrequency(moveFrequency)inherited

Set the move frequency of the character
NameTypeDescription
moveFrequencynumberThe character's new movement frequency

setMoveRoute(moveRoute)inherited

Sets a move route
NameTypeDescription
moveRouteObjectThe move route to set

setMoveSpeed(moveSpeed)inherited

Set the move speed of the character
NameTypeDescription
moveSpeednumberThe character's new movement speed

setMovementSuccess(success)inherited

Set movement success
NameTypeDescription
successbooleanWhether movement succeeded

setOpacity(opacity)inherited

Set the opacity of the character
NameTypeDescription
opacitynumberThe character's new opacity

setPattern(pattern)inherited

Set the current animation pattern
NameTypeDescription
patternnumberThe new current animation pattern

setPosition(x, y)inherited

Sets the position of the character
NameTypeDescription
xnumberThe new x coordinate
ynumberThe new y coordinate

setPriorityType(priorityType)inherited

Set the priority type of the character
NameTypeDescription
priorityTypenumberThe character's new priority type

setStepAnime(stepAnime)inherited

Set the character step animation flag
NameTypeDescription
stepAnimebooleanNew step animation flag

setThrough(through)inherited

Set the character through flag
NameTypeDescription
throughbooleanNew through flag

setTileImage(tileId)inherited

Set the character's image properties when it's a tile character
NameTypeDescription
tileIdnumberThe tile id to use for the image

setTransparent(transparent)inherited

Set the transparent flag
NameTypeDescription
transparentbooleanNew transparent flag

setWalkAnime(walkAnime)inherited

Set the character walk animation flag
NameTypeDescription
walkAnimebooleanNew walk animation flag

setupForNewGame()

Set up when a new game is started

shiftY()numberinherited

Get the amount to shift the character's y value
Returns:
TypeDescription
numberAmount to shift the y value by

showFollowers()

Show player followers

startAnimation()inherited

Start the animation

startBalloon()inherited

Start the character balloon animation

startMapEvent(x, y, triggers, normal)

Start an event on the map
NameTypeDescription
xnumberThe x coordinate of the event
ynumberThe y coordinate of the event
triggersArray.<number>The event's triggers
normalbooleanIf the priority should be normal or not

straighten()inherited

Straighten the character

swap(character)inherited

Swap location with the given character
NameTypeDescription
characterGame_CharacterThe character to swap with

terrainTag()numberinherited

Get the terrain tag the character is on
Returns:
TypeDescription
numberThe terrain tag

tileId()numberinherited

Get the character's tile id
Returns:
TypeDescription
numberThe character's tile id

triggerAction()boolean

Check if action is triggered
Returns:
TypeDescription
booleanTrue if action is triggered

triggerButtonAction()boolean

Check if button input triggered action
Returns:
TypeDescription
booleanTrue if action is triggered

triggerTouchAction()boolean

Check if touch triggered action
Returns:
TypeDescription
booleanTrue if action is triggered

triggerTouchActionD1(x1, y1)boolean

Check if touch action should trigger on the given coordinates
NameTypeDescription
x1numberThe x coordinate to check for trigger
y1numberThe y coordinate to check for trigger
Returns:
TypeDescription
booleanTrue if action is triggered

triggerTouchActionD2(x2, y2)boolean

Check if touch action should trigger on the given coordinates
NameTypeDescription
x2numberThe x coordinate to check for trigger
y2numberThe y coordinate to check for trigger
Returns:
TypeDescription
booleanTrue if action is triggered

triggerTouchActionD3(x2, y2)boolean

Check if touch action should trigger on the given coordinates
NameTypeDescription
x2numberThe x coordinate to check for trigger
y2numberThe y coordinate to check for trigger
Returns:
TypeDescription
booleanTrue if action is triggered

turn180()inherited

Turn 180 degrees (turn around)

turnAwayFromCharacter(character)inherited

Turns away from the given character
NameTypeDescription
characterGame_CharacterThe character to turn away from

turnAwayFromPlayer()inherited

Turns away from the player

turnLeft90()inherited

Turn left 90 degrees

turnRandom()inherited

Turn in a random direction

turnRight90()inherited

Turn right 90 degrees

turnRightOrLeft90()inherited

Randomly turn right or left 90 degrees

turnTowardCharacter(character)inherited

Turns toward the given character
NameTypeDescription
characterGame_CharacterThe character to turn toward

turnTowardPlayer()inherited

Turns toward the player

update(sceneActive)overrides

Update the player
NameTypeDescription
sceneActivebooleanIf the scene is active

updateAnimation()inherited

Update the character's animation

updateAnimationCount()inherited

Update the animation count

updateDashing()

Update dash

updateEncounterCount()

Update the encounter count

updateJump()inherited

Update the character's jump

updateMove()inherited

Update the character's move

updateNonmoving(wasMoving, sceneActive)

Update when not moving
NameTypeDescription
wasMovingbooleanIf the player just stopped moving
sceneActivebooleanIf scene is active

updatePattern()inherited

Updates the animation pattern

updateRoutineMove()inherited

Updates move route

updateScroll(lastScrolledX, lastScrolledY)

Update scroll
NameTypeDescription
lastScrolledXnumberThe last scroll x position
lastScrolledYnumberThe last scroll y position

updateStop()inherited

Update the character's stop

updateVehicle()

Update player vehicle

updateVehicleGetOff()

Update getting off a vehicle

updateVehicleGetOn()

Update getting on a vehicle

vehicle()Game_Vehicle

Get the vehicle the player is in
Returns:
TypeDescription
Game_VehicleThe vehicle the player is in