Class: Game_Vehicle

Game_Vehicle

new Game_Vehicle()

The game object class for a vehicle.

Extends

Methods

advanceMoveRouteIndex()inherited

Advances the move route index
Get the wait between animation frames
Returns:
TypeDescription
numberAmount to wait between animation frames
Get the blend mode of the character
Returns:
TypeDescription
numberThe character's blend mode
Get the character's bush depth
Returns:
TypeDescription
numberThe character's bush depth

canMove()boolean

Check if the vehicle can move
Returns:
TypeDescription
booleanTrue if 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
Get the character's index (for character sheet image)
Returns:
TypeDescription
numberThe character index
Get the character's name (for character sheet image)
Returns:
TypeDescription
stringThe character name

checkEventTriggerTouch()booleaninherited

Check for event trigger touch. Implemented by child classes
Returns:
TypeDescription
booleanWhen called from Game_CharacterBase, this always returns false

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

copyPosition(character)inherited

Copies the position of another character
NameTypeDescription
characterGame_CharacterThe character to copy position from
Get the delta x from the given x and the character x
NameTypeDescription
xnumberThe given x
Returns:
TypeDescription
numberThe delta x
Get the delta y from the given y and the character y
NameTypeDescription
ynumberThe given y
Returns:
TypeDescription
numberThe delta y
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
End the animation
End the balloon animation

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

forceMoveRoute(moveRoute)inherited

Forces a move route
NameTypeDescription
moveRouteObjectThe move route to force
Get off the vehicle
Get on the vehicle
Check if the character has a step animation
Returns:
TypeDescription
booleanTrue if has step animation
Check if the character has a walk animation
Returns:
TypeDescription
booleanTrue if has walk animation
Increase the character's steps
Initialize character variables

initMoveSpeed()

Initialize the vehicle move speed
Initialize the character

isAirship()boolean

Check if the vehicle is an airship
Returns:
TypeDescription
booleanTrue if the vehicle is an airship

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

isBoat()boolean

Check if the vehicle is a boat
Returns:
TypeDescription
booleanTrue if the vehicle is a boat

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
Check if the character is dashing
Returns:
TypeDescription
booleanTrue if dashing

isDebugThrough()booleaninherited

Check if the character is in the debug through state
Returns:
TypeDescription
booleanTrue if debug through

isDirectionFixed()booleaninherited

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

isHighest()boolean

Check if the vehicle is at the max altitude
Returns:
TypeDescription
booleanTrue if at max altitude
Check if the character is jumping
Returns:
TypeDescription
booleanTrue if jumping

isLandOk(x, y, d)boolean

Check if the vehicle can land
NameTypeDescription
xnumberThe x coordinate on the map
ynumberThe y coordinate on the map
dnumberThe direction of the vehicle
Returns:
TypeDescription
booleanTrue if landing is allowed

isLowest()boolean

Check if the vehicle is on the ground
Returns:
TypeDescription
booleanTrue if grounded

isMapPassable(x, y, d)booleanoverrides

Check if the map is passable for the vehicle
NameTypeDescription
xnumberThe x coordinate on the map
ynumberThe y coordinate on the map
dnumberThe direction of the vehicle
Returns:
TypeDescription
booleanTrue if 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
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

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
Check if the character is on a bush
Returns:
TypeDescription
booleanTrue if on bush tile
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

isShip()boolean

Check if the vehicle is a ship
Returns:
TypeDescription
booleanTrue if the vehicle is a ship
Check if the character is stopping
Returns:
TypeDescription
booleanTrue if stopping

isTakeoffOk()boolean

Check if the vehicle can take off
Returns:
TypeDescription
booleanTrue if can take off
Check if the character is through
Returns:
TypeDescription
booleanTrue if through
Check if the character is a tile
Returns:
TypeDescription
booleanTrue if tile
Check if the character is transparent
Returns:
TypeDescription
booleanTrue if transparent
Jumps the character
NameTypeDescription
xPlusnumberAmount to jump in the x direction
yPlusnumberAmount to jump in the y direction
Get the character's jump height
Returns:
TypeDescription
numberThe character's jump height

loadSystemSettings()

Load system settings for the vehicle
Locates the character to the given coordinates
NameTypeDescription
xnumberThe new x coordinate
ynumberThe new y coordinate

maxAltitude()number

Get the max altitude
Returns:
TypeDescription
numberMax altitude
Get the maximum pattern for animation
Returns:
TypeDescription
numberThe maximum pattern for animation
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
Moves backward

moveDiagonally(horz, vert)inherited

Moves diagonally in the given directions
NameTypeDescription
horznumberThe horizontal direction to move in
vertnumberThe vertical direction to move in
Moves forward
Get the move frequency of the character
Returns:
TypeDescription
numberThe character's movement frequency
Random move handling
Get the move speed of the character
Returns:
TypeDescription
numberThe character's movement speed
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
Moves toward the player
Get the opacity of the character
Returns:
TypeDescription
numberThe character's opacity
Get the current animation pattern
Returns:
TypeDescription
numberThe current animation pattern
Plays the vehicle bgm
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
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
Processing when move route ends
Get the real movement speed for the character (factor in dashing or other effects)
Returns:
TypeDescription
numberThe actual move speed of the character
Refresh the vehicle
Refresh the character for bush depth change
Get the region id the character is on
Returns:
TypeDescription
numberThe region id

resetDirection()

Resets the direction of the vehicle
Resets the animation pattern
Resets the stop count
Restores a memorized move route
Reverse the character's direction
NameTypeDescription
dnumberThe direction to reverse from
Get the character screen x value
Returns:
TypeDescription
numberThe screen x value
Get the character screen y value
Returns:
TypeDescription
numberThe screen y value
Get the character screen z value
Returns:
TypeDescription
numberThe screen z value
Get the character scrolled x value
Returns:
TypeDescription
numberThe scrolled x value
Get the character scrolled y value
Returns:
TypeDescription
numberThe scrolled y value
The maximum amount of tiles to search for finding direction
Returns:
TypeDescription
numberThe search limit
Sets the vehicle bgm
NameTypeDescription
bgmObjectThe new vehicle bgm

setBlendMode(blendMode)inherited

Set the blend mode of the character
NameTypeDescription
blendModenumberThe character's new blend mode
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

setLocation(mapId, x, y)

Set the vehicle location
NameTypeDescription
mapIdnumberThe map id of the new location
xnumberThe x coordinate on the map
ynumberThe y coordinate on the map

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
Set the opacity of the character
NameTypeDescription
opacitynumberThe character's new opacity
Set the current animation pattern
NameTypeDescription
patternnumberThe new current animation pattern
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
Set the character through flag
NameTypeDescription
throughbooleanNew through flag
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

shadowOpacity()number

Get the shadow opacity
Returns:
TypeDescription
numberShadow opacity

shadowX()number

Get the shadow x coordinate on the screen
Returns:
TypeDescription
numberShadow x coordinate

shadowY()number

Get the shadow y coordinate on the screen
Returns:
TypeDescription
numberShadow y coordinate
Get the amount to shift the character's y value
Returns:
TypeDescription
numberAmount to shift the y value by
Start the animation
Start the character balloon animation
Straighten the character
Swap location with the given character
NameTypeDescription
characterGame_CharacterThe character to swap with

syncWithPlayer()

Sync the vehicle with the player
Get the terrain tag the character is on
Returns:
TypeDescription
numberThe terrain tag
Get the character's tile id
Returns:
TypeDescription
numberThe character's tile id
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
Turn left 90 degrees
Turn in a random direction
Turn right 90 degrees
Randomly turn right or left 90 degrees

turnTowardCharacter(character)inherited

Turns toward the given character
NameTypeDescription
characterGame_CharacterThe character to turn toward
Turns toward the player
Update the character

updateAirship()

Update the airship

updateAirshipAltitude()

Update the airship altitude
Update the character's animation
Update the animation count
Update the character's jump
Update the character's move
Updates the animation pattern
Updates move route
Update the character's stop

vehicle()Object | null

Get the vehicle data object
Returns:
TypeDescription
Object|nullThe vehicle data object, null if no vehicle