Body Type
In Staxel, *.bodytype files are used to specify how something should move, and the various properties surrounding this. In particular, these files specify how the animations should link up to the model, as well as specifying collision with other objects.
Contents
Creating a *.bodytype file
A *.bodytype file mostly contains properties which specify certain characteristics of how it should move, though it does contain references to Bone Animations. The following is a basic file that is used for Staxel's player models.
{ "code" : "staxel.bodyType.HumanoidFemale", "shoulderHeight" : 1.34375, "bodyHeight" : 2.125, "bodyRadius" : 0.65625, "riserRadius" : 0.46875, "riserHeight" : 1.140625, "tposeEmote" : "tpose", "boneAnimations" : "avatar", "centerBias" : { "x" : 0.0, "y" : 0.0, "z" : -0.5 }, "layers" : [ "Torso", "Head", "Shoulder_Right", "UpperArm_Right", "LowerArm_Right", "Hand_Right", "Item_Right", "Shoulder_Left", "UpperArm_Left", "LowerArm_Left", "Hand_Left", "Item_Left", "Thigh_Right", "UpperLeg_Right", "LowerLeg_Right", "Thigh_Left", "UpperLeg_Left", "LowerLeg_Left" ] }
These properties are explained below. With a file like this, it can then be used in a species file to define how they move.
Config Options
"code"
Valid options (String): A unique string which identifies what Body Type this is.
Default Value: No default value is specified. Always need to provide your own.
This option is required to uniquely identify any Body Type. This string must be unique to all other codes, but does not have any other requirements.
"bodyHeight"
Valid options (Float): A positive decimal number. A value of 1 is a single block high.
Default Value: No default value is specified. Always need to provide your own.
This defines the total height of the model from the centre. This is for things such as collision with objects and other players.
"bodyRadius"
Valid options (Float): A positive decimal number. A value of 1 is a single block wide.
Default Value: No default value is specified. Always need to provide your own.
This defines the total radius of the model from the centre. This essentially allows the model to have a capsule collision box. This is for things such as collision with objects and other players.
"boneAnimations"
Valid options (String): Any valid string that leads to an Bone Animation.
Default Value: No default value is specified. Always need to provide your own.
This provides the actual animation data to the body type. These animations are used to move models for things that implement Body Type.
"centerBias"
Valid options (Vector 3 - Float): { "x": 0, "y": 0, "z": 0 }
Default Value: No default value is specified. Always need to provide your own.
This provides the information of how much should the model be off centre compared to the body type. Most commonly this is used to make sure the model lines up with the animations.
"layers"
Valid options (List of Strings): A list of valid strings. These need to correspond to layers.
Default Value: No default value is specified. Always need to provide your own.
This is a list of all layer names the animation has, or therefore any implementing model should have.
"riserHeight"
Valid options (Float): A positive decimal number. A value of 1 is a single block high.
Default Value: No default value is specified. Always need to provide your own.
This defines the total height of the riser collision. The riser defines the collision with moving up and down objects like stairs.
"riserRadius"
Valid options (Float): A positive decimal number. A value of 1 is a single block wide.
Default Value: No default value is specified. Always need to provide your own.
This defines the total radius of the rise. The riser defines the collision with moving up and down objects like stairs.
"shoulderHeight"
Valid options (Float): A positive decimal number. A value of 1 is a single block wide.
Default Value: No default value is specified. Always need to provide your own.
This defines how high the shoulders are in the model. This is for things such as camera position etc.
"topHeadOffset"
Valid options (Float): A positive decimal number. A value of 1 is a single block wide.
Default Value: No default value is specified. Always need to provide your own.
This is the offset of the head compared to the model. Used to position Expressions that Animals and NPC's play.
"tposeEmote"
Valid options (String): Any valid string that leads to an Bone Animation's timelines code. This timeline must be present in the specified Bone Animation
Default Value: No default value is specified. Always need to provide your own.
This provides the default animation that the body type should use when no other information is avaliable. In most cases this is the "T-Pose" animation.