Class: Game_CharacterBase

Game_CharacterBase

new Game_CharacterBase()

The superclass of Game_Character. It handles basic information, such as coordinates and images, shared by all characters.
Properties:
NameTypeDescription
xnumberThe x coordinate of the character
ynumberThe y coordinate of the character

Methods

animationWait()number

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

blendMode()number

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

canPass(x, y, d)boolean

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)boolean

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

characterIndex()number

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

characterName()string

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

checkEventTriggerTouch()boolean

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

checkEventTriggerTouchFront(d)

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

checkStop(threshold)boolean

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

copyPosition(character)

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

direction()number

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

distancePerFrame()number

Get the distance moved per frame
Returns:
TypeDescription
numberThe distance moved per frame
End the animation
End the balloon animation

hasStepAnime()boolean

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

hasWalkAnime()boolean

Check if the character has a walk animation
Returns:
TypeDescription
booleanTrue if has walk animation
Increase the character's steps
Initialize character variables
Initialize the character

isAnimationPlaying()boolean

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

isBalloonPlaying()boolean

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

isCollidedWithCharacters(x, y)boolean

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)boolean

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)boolean

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

isDashing()boolean

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

isDebugThrough()boolean

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

isDirectionFixed()boolean

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

isJumping()boolean

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

isMapPassable(x, y, d)boolean

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

isMovementSucceeded()boolean

Check for movement success
Returns:
TypeDescription
booleanTrue if movement succeeded

isMoving()boolean

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

isNearTheScreen()boolean

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

isNormalPriority()boolean

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

isObjectCharacter()boolean

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

isOnBush()boolean

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

isOnLadder()boolean

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

isOriginalPattern()boolean

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

isStopping()boolean

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

isThrough()boolean

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

isTransparent()boolean

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

jump(xPlus, yPlus)

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

jumpHeight()number

Get the character's jump height
Returns:
TypeDescription
numberThe character's jump height
Locates the character to the given coordinates
NameTypeDescription
xnumberThe new x coordinate
ynumberThe new y coordinate

maxPattern()number

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

moveDiagonally(horz, vert)

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

moveFrequency()number

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

moveSpeed()number

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
Get the opacity of the character
Returns:
TypeDescription
numberThe character's opacity
Get the current animation pattern
Returns:
TypeDescription
numberThe current animation pattern

pos(x, y)boolean

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)boolean

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

realMoveSpeed()number

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

refreshBushDepth()

Refresh the character for bush depth change
Get the region id the character is on
Returns:
TypeDescription
numberThe region id
Resets the animation pattern
Resets the stop count
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

scrolledX()number

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

scrolledY()number

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

setBlendMode(blendMode)

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)

Set the character direction fix flag
NameTypeDescription
directionFixbooleanNew direction fix flag

setImage(characterName, characterIndex)

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

setMoveFrequency(moveFrequency)

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

setMoveSpeed(moveSpeed)

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

setMovementSuccess(success)

Set movement success
NameTypeDescription
successbooleanWhether movement succeeded

setOpacity(opacity)

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

setPattern(pattern)

Set the current animation pattern
NameTypeDescription
patternnumberThe new current animation pattern

setPosition(x, y)

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

setPriorityType(priorityType)

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

setStepAnime(stepAnime)

Set the character step animation flag
NameTypeDescription
stepAnimebooleanNew step animation flag

setThrough(through)

Set the character through flag
NameTypeDescription
throughbooleanNew through flag

setTileImage(tileId)

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

setTransparent(transparent)

Set the transparent flag
NameTypeDescription
transparentbooleanNew transparent flag

setWalkAnime(walkAnime)

Set the character walk animation flag
NameTypeDescription
walkAnimebooleanNew walk animation flag
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

terrainTag()number

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
Update the character

updateAnimation()

Update the character's animation

updateAnimationCount()

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