Methods
Character:alert(duration: number?, options: (table|"callback"|"layer"|"offset_x"|"offset_y"...(+2))?)
Creates an alert bubble (tiny !) above this character.
@param duration
— The number of frames to show the bubble for. (Defaults to 20
)
@param options
— A table defining additional properties to control the bubble.
options:
| "play_sound" -- Whether the alert sound will be played. (Defaults to `true`)
| "sprite" -- The sprite to use for the alert bubble. (Defaults to `"effects/alert"`)
| "offset_x" -- The x-offset of the icon.
| "offset_y" -- The y-offset of the icon.
| "layer" -- The layer to put the icon on. (Defaults to `100`)
| "callback" -- A callback that is run when the alert finishes.
Arguments:
duration: number? | The number of frames to show the bubble for. (Defaults to |
options: (table|"callback"|"layer"|"offset_x"|"offset_y"...(+2))? | A table defining additional properties to control the bubble. |
Returns:
1: Sprite |
Character:doMoveAmount(type: any, amount: any, other_amount: any)
Arguments:
type: any | |
amount: any | |
other_amount: any |
Returns:
1: boolean | |
2: boolean|unknown |
Character:flash(sprite: any, offset_x: any, offset_y: any, layer: any)
Arguments:
sprite: any | |
offset_x: any | |
offset_y: any | |
layer: any |
Character:jumpTo(x: number, y: number, speed: number?, time: number?, jump_sprite: string?, land_sprite: string?)
Moves the character to a new position with a jumping arc motion.
@param x
— The x-coordinate to move the character to.
@param y
— The y-cooridinate to move the character to.
@param marker
— The name of a marker in the map to move the character to.
@param speed
— The speed, as upwards velocity of the character when they start the jump. Defaults to 0
.
@param time
— The time, in seconds, that the jump will take. Defaults to 1 second.
@param jump_sprite
— The sprite that will be used whilst the character is in midair.
@param land_sprite
— The sprite that will be used just as the character leaves the ground and as they land.
Arguments:
x: number | The x-coordinate to move the character to. |
y: number | The y-cooridinate to move the character to. |
speed: number? | The speed, as upwards velocity of the character when they start the jump. Defaults to |
time: number? | The time, in seconds, that the jump will take. Defaults to 1 second. |
jump_sprite: string? | The sprite that will be used whilst the character is in midair. |
land_sprite: string? | The sprite that will be used just as the character leaves the ground and as they land. |
Character:move(x: any, y: any, speed: any, keep_facing: any)
Arguments:
x: any | |
y: any | |
speed: any | |
keep_facing: any |
Returns:
1: boolean |
Character:moveX(amount: any, move_y: any)
Arguments:
amount: any | |
move_y: any |
Returns:
1: boolean | |
2: boolean|unknown |
Character:moveY(amount: any, move_x: any)
Arguments:
amount: any | |
move_x: any |
Returns:
1: boolean | |
2: boolean|unknown |
Character:play(speed: any, loop: any, reset: any, on_finished: any)
Arguments:
speed: any | |
loop: any | |
reset: any | |
on_finished: any |
Character:resetSprite()
Resetss the character's to their default animation or sprite.
Character:setFacing(dir: string)
Makes the character face in the direction specified by dir
.
@param dir
— The direction the character should face. Must be "up", "down", "left", or "right".
Arguments:
dir: string | The direction the character should face. Must be "up", "down", "left", or "right". |
Character:shake(x: any, y: any, friction: any, delay: any)
Arguments:
x: any | |
y: any | |
friction: any | |
delay: any |
Character:shakeSelf(x: any, y: any, friction: any, delay: any)
Arguments:
x: any | |
y: any | |
friction: any | |
delay: any |
Character:spin(speed: number)
Makes the character start spinning.
@param speed
— The spin speed to set on the character. Negative numbers = anticlockwise, positive numbers = clockwise. Higher value = slower spin.
Arguments:
speed: number | The spin speed to set on the character. Negative numbers = anticlockwise, positive numbers = clockwise. Higher value = slower spin. |
Character:statusMessage(type: any, arg: any, color: any, kill: any)
Arguments:
type: any | |
arg: any | |
color: any | |
kill: any |
Returns:
1: unknown |
Character:walkPath(path: string|table, options: table|"after"|"ease"|"facing"|"keep_facing"...(+7))
Walks the character along a given path.
@param path
— The name of a path in the current map file, or a table defining several points (as additional tables) that constitute a path.
@param options
— A table defining additional properties to control the walk.
options:
| "facing" -- The direction the character should face when they finish their walk. If `keep_facing` is `true`, they will instead face way immediately.
| "keep_facing" -- If `true`, the facing direction of the character will be preserved. Otherwise, they will face the direction they are walking. (Defaults to `false`)
| "time" -- The amount of time, in seconds, that the object should take to travel along the full path.
| "speed" -- The speed at which the object should travel along the path, in pixels per frame at 30FPS.
| "ease" -- The ease type to use when travelling along the path. Unused if `speed` is specified instead of `time`. (Defaults to "linear")
| "after" -- A function that will be called when the end of the path is reached. Receives no arguments.
| "relative" -- Whether the path should be relative to the object's current position, or simply set its position directly.
| "loop" -- Whether the path should loop back to the first point when reaching the end, or if it should stop.
| "reverse" -- If true, reverse all of the points on the path.
| "skip" -- A number defining how many points of the path to skip.
| "snap" -- Whether the object's position should immediately "snap" to the first point, or if its initial position should be counted as a point on the path.
Arguments:
path: string|table | The name of a path in the current map file, or a table defining several points (as additional tables) that constitute a path. |
options: table|"after"|"ease"|"facing"|"keep_facing"...(+7) | A table defining additional properties to control the walk. |
Returns:
1: nil |
Character:walkTo(x: number, y: number, time: number?, facing: string?, keep_facing: boolean?, ease: any, after: fun( Character)?)
Walks this character to a new x
and y
over time
seconds.
@param x
— The new x
value to approach.
@param y
— The new y
value to approach.
@param marker
— A map marker whose position the object should approach.
@param time
— The amount of time, in seconds, that the slide should take. (Defaults to 1 second)
@param facing
— The direction the character should face when they finish their walk. If keep_facing
is true
, they will instead face way immediately.
@param keep_facing
— If true
, the facing direction of the character will be preserved. Otherwise, they will face the direction they are walking. (Defaults to false
)
@param after
— A callback function that is run after the character has finished walking.
@return success
— Whether the walking will occur. False if the character's current position is already at the specified position, and true otherwise.
Arguments:
x: number | The new |
y: number | The new |
time: number? | The amount of time, in seconds, that the slide should take. (Defaults to 1 second) |
facing: string? | The direction the character should face when they finish their walk. If |
keep_facing: boolean? | If |
ease: any | |
after: fun( Character)? | A callback function that is run after the character has finished walking. |
Returns:
success: boolean | Whether the walking will occur. False if the character's current position is already at the specified position, and true otherwise. |
Character:walkToSpeed(x: number, y: number, speed: number?, facing: string?, keep_facing: boolean?, after: fun( Character)?)
Walks this character to a new x
and y
at speed
pixels per frame.
@param x
— The new x
value to approach.
@param y
— The new y
value to approach.
@param marker
— A map marker whose position the object should approach.
@param speed
— The amount that the object's x
and y
should approach the specified position, in pixels per frame at 30FPS. (Defaults to 4
)
@param facing
— The direction the character should face when they finish their walk. If keep_facing
is true
, they will instead face way immediately.
@param keep_facing
— If true
, the facing direction of the character will be preserved. Otherwise, they will face the direction they are walking. (Defaults to false
)
@param after
— A callback function that is run after the character has finished walking.
@return success
— Whether the walking will occur. False if the character's current position is already at the specified position, and true otherwise.
Arguments:
x: number | The new |
y: number | The new |
speed: number? | The amount that the object's |
facing: string? | The direction the character should face when they finish their walk. If |
keep_facing: boolean? | If |
after: fun( Character)? | A callback function that is run after the character has finished walking. |
Returns:
success: boolean | Whether the walking will occur. False if the character's current position is already at the specified position, and true otherwise. |
Fields
Undocumented
Character.jump_progress: integer
if (landsprite == spr_kris_dw_landed) -- If it's the Kris kneeling one, { self.x = self.x - 4 self.y = self.y + 2 self.false_end_x = self.false_end_x - 8 self.jump_start_x = self.jump_start_x - 8 self.jump_start_y = self.jump_start_y - 8 } if (landsprite == spr_susie_dw_landed) { self.x = self.x - 8 self.false_end_x = self.false_end_x - 8 self.jump_start_x = self.jump_start_x + 12 self.jump_start_y = self.jump_start_y - 12 } if (landsprite == spr_teacup_ralsei_land) { self.y = self.y + 4 self.jump_start_y = self.jump_start_y + 8 self.jump_start_x = self.jump_start_x - 12 self.false_end_x = self.false_end_x - 6 self.false_end_y = self.false_end_y + 4 } if (jumpsprite == spr_ralsei_jump) { shadowoffx = shadowoffx - 10 shadowoffy = shadowoffy - 4 } }
Character.jump_use_sprites: boolean
dark = (global.darkzone + 1)
Character.party: nil
The party member id represented by this character