Playable character calibration (Config pack)

From Moondust Wiki
Jump to navigation Jump to search

Playable character calibration - is the INI file config file which declares the per-frame setup of playable character hitbox over a sprite and also contains a set of animations. The editing tool that allows to create and edit them is the Player Calibrator which is a part of PGE Project. Player calibration files are used by PGE Engine where they are used as the main source of playable character sprite setup, and also by LunaLua and later by SMBX2 as the ability to customize hard-coded sprite setup of SMBX Engine. The X-Tech has the support of those files since the version 1.3.3.

Header

The "common" section is the file header that declares calibration global setup.

[common]
Parameter Allowed values Example value Description
width [>=0] width = 25 Hitbox width for the playable character.
height [>=0] height = 50 Hitbox height for the playable character for the regular standing state.
height-duck [>=0] height-duck = 30 Hitbox lowered height for the playable character for the sitting down "ducking" state.
grab-offset-x integer grab-offset-x = 0 Horizontal offset of a carrying item at the side position (by bottom corner of a carrying item).
grab-offset-y integer grab-offset-y = 0 Vertical offset of a carrying item at the center position (by bottom corner of a carrying item).
over-top-grab boolean over-top-grab = false Put grabbed objects over the head. Can't be affected by grab offset.
Notice Note: SMBX2 doesn't support the changing of a carried item location.

Frames

The Calibration do store multiple frame sections for specific X and Y sprite matrix cell position.

The format of frame section is next: frame-X-Y

  • X - the horizontal matrix cell index.
  • Y - the vertical matrix cell index.

One frame definition

[frame-*-*]
Parameter Allowed values Example value Description
offsetX integer offsetX = 25 The horizontal offset for the player hitbox at the left-top corner of the frame box.
offsetY integer offsetY = 11 The vertical offset for the player hitbox at the left-top corner of the frame box.
duck boolean duck = false Should this frame to use the lowered height?
isRightDir boolean isRightDir = false If true, playable character is faced to right. If false - to left.
showGrabItem boolean showGrabItem = false If the true, in the Player Calibrator the grabbed item position will be displayed for this frame.
used boolean used = true DEPRECATED AND IGNORED, mark the frame as enabled. Since changes made in 2019, this flag is useless now since the frame usage now detecting by the presence of the INI header in the file.
Notice Important note: This field is required for SMBX2, otherwise a frame will become ignored by the game.

Animations

The Calibration can store the set of various animations. For every animation entry there are two separated frame sequencies for each direction: left and right. The format of animation section is next: Animation_NAME_DIRECTION

  • Where the NAME - the name of animation, written by latin characters without spaces and special characters.
  • Where the DIRECTION - the direction marker, L for left, and R for right.
  • Example: Animation_Meowing_R. The animation for right direction with "Meowing" name.
Notice Note: SMBX2 doesn't support the player animation changes by the calibration.


[Animation_*_*]
Parameter Allowed values Example value Description
frames integer frames = 5 The count of animation frames.
frame0x integer frame0x = 4 The X cell number on the matrix at 0. Where * - the index of the frame in a list.
frame0y integer frame0y = 4 The Y cell number on the matrix at 0. Where * - the index of the frame in a list.
frame1x integer frame1x = 4 ...
frame1y integer frame1y = 5 ...
frame*x integer frame*x = 4 ...
frame*y integer frame*y = 6 ...