@zaisma/character
A third-person character that feels good to play: snappy movement with a forgiving jump, a camera that turns freely, locks over the shoulder and zooms into first person, abilities that are cast, cool down and hit, and online play where your own moves answer at once. On the body, input and the online core; or with a game's own character.
- Kind
- Extension
- Built on
- @zaisma/standard
- Version
- 1.0.0
- Licence
- MIT, open source
- By
- btc7274
- Rated
- No ratings yet
ShellCopied
npx @zaisma/cli pieces add @zaisma/characterWhat it needs
- @zaisma/net^2.0.0 · 2.2.0 on the marketplace · Not testedPiece
- @zaisma/body^1.1.0 · 1.1.1 on the marketplace · Not testedPiece
- @zaisma/input^1.0.0 · 1.1.0 on the marketplace · Not testedPiece
- @zaisma/piece^1.0.0 · 1.1.0 on the marketplace · Not testedPiece
- three>=0.160.0 <1.0.0 · A library from npm · Not testedLibrary
Nothing: it stands on its own.
Fits is said only for what Zaisma ran together. Not tested means nobody at Zaisma has.
Settings and hooks
Everything a game can change without editing the piece, so it moves to a newer version and keeps the game's changes.
- walk_speed_m_per_secHow fast a character moves with its stick pushed all the way, metres a second. A character's own walkSpeedPct, in its state, scales it for one character (a slow, a haste).Number, 0 to 50, starts at 4.5Setting
- sprint_speed_pctHow much faster a character moves while its input says isSprinting, as a share of its walk.Number, 100 to 400, starts at 160Setting
- speed_up_duration_secHow long a character takes to reach full speed from standing on the ground: small is snappy, 0 is at once.Number, 0 to 2, starts at 0.06Setting
- slow_down_duration_secHow long a character takes to stop from full speed on the ground once its stick is let go.Number, 0 to 2, starts at 0.05Setting
- air_control_pctHow much a character in the air can change where it's going, as a share of what it can on the ground.Number, 0 to 100, starts at 85Setting
- turn_speed_deg_per_secHow fast a character turns to face where it's going, degrees a second.Number, 30 to 5000, starts at 1080Setting
- jump_height_mHow high a jump reaches, metres. A character's own jumpHeightPct, in its state, scales it for one character (a super jump).Number, 0 to 40, starts at 1.5Setting
- jump_rise_duration_secHow long a jump takes to reach its top: with jump_height_m it sets how hard things fall. Short is snappy, long is floaty.Number, 0.05 to 3, starts at 0.3Setting
- maximum_fall_speed_m_per_secThe fastest a character falls, metres a second.Number, 1 to 200, starts at 45Setting
- maximum_jump_countHow many jumps a character has before it lands again: 2 is a double jump.Whole number, 1 to 10, starts at 1Setting
- ledge_grace_duration_secHow long after running off a ledge a character can still jump as if it stood on it.Number, 0 to 1, starts at 0.12Setting
- jump_buffer_duration_secHow long before landing a jump press still counts: the jump comes the moment it lands.Number, 0 to 1, starts at 0.12Setting
- step_height_mThe highest step or kerb a character walks up without jumping.Number, 0 to 2, starts at 0.35Setting
- maximum_slope_degThe steepest ground a character stands and walks on; steeper slides it off.Number, 0 to 85, starts at 50Setting
- character_radius_mHow wide a character is to the level: the radius of the upright capsule it collides as.Number, 0.05 to 3, starts at 0.3Setting
- character_height_mHow tall a character is to the level, from its feet.Number, 0.2 to 10, starts at 1.5Setting
- maximum_health_point_countA character's health when it starts, and the most it has.Whole number, 1 to 100000, starts at 100Setting
- knockback_slow_down_duration_secHow long a knocked-back character takes to slide to a stop on the ground.Number, 0.01 to 5, starts at 0.45Setting
- camera_distance_mHow far behind the character the camera starts, metres. The player zooms it between the minimum and the maximum.Number, 0 to 200, starts at 7Setting
- camera_minimum_distance_mThe nearest the player zooms the camera. At it, with first_person_enabled, the view is the character's own eyes.Number, 0 to 50, starts at 0.5Setting
- camera_maximum_distance_mThe farthest the player zooms the camera.Number, 0 to 200, starts at 20Setting
- camera_zoom_step_mHow far one notch of the wheel zooms.Number, 0.1 to 20, starts at 1.5Setting
- camera_height_mHow high above the character's feet the camera looks, metres: about its eyes.Number, 0 to 20, starts at 1.3Setting
- camera_shoulder_offset_mHow far right of the character the camera sits while the shoulder is locked.Number, 0 to 5, starts at 0.7Setting
- camera_field_of_view_degHow wide the camera sees, degrees from top to bottom.Number, 20 to 120, starts at 70Setting
- camera_minimum_pitch_degHow far the camera looks down, degrees below level.Number, -89 to 0, starts at -80Setting
- camera_maximum_pitch_degHow far the camera looks up, degrees above level.Number, 0 to 89, starts at 80Setting
- camera_collision_enabledWhether the camera comes in front of a wall rather than going through it.On or off, starts onSetting
- first_person_enabledWhether zooming all the way in gives the character's own eyes, its body hidden from its player.On or off, starts onSetting
- shoulder_lock_modeThe shoulder lock: the camera over the character's shoulder, the mouse turning the view with no button held and the character facing where it looks, for fighting and aiming. toggle: its action turns it on and off; hold: on while held; always; off.One of toggle, hold, always, off; starts at toggleSetting
- before_castAsked in the step, wherever a character is stepped, before it starts an ability: (isAllowed, { characterId, abilityName, state }). Answer false to refuse it (no energy, a silence). Answer from the state alone, so every game and the game server answer the same.Decision
- cast_startedTold when a character starts an ability: { characterId, abilityName }. Once, in each game that steps it, never again on a replay.Event
- jumpedTold when a character leaves the ground in a jump: { characterId, jumpNumber }. Once, never again on a replay.Event
- landedTold when a character lands: { characterId, fallSpeedMPerSec }. Once, never again on a replay.Event
- fell_outTold when a character fell below the level's fallOutHeightM and was put back at a start: { characterId }.Event
- before_hitAsked where a hit is judged (the game server; with no server code, the game of the one who was hit) before it counts: (hit, { attackerId, targetId, abilityName, roomState }), hit being { damagePointCount, knockbackMPerSec, knockUpMPerSec, stunDurationSec }. Answer another hit (a block halves it, a team mate takes none), or null to let it pass.Decision
- hitTold where a hit is judged, once it counted: { attackerId, targetId, abilityName, damagePointCount, remainingHealthPointCount }.Event
- knocked_outTold where a hit is judged when it brings a character's health to 0: { attackerId, targetId, abilityName }. The character stands still until the game gives it health again (a respawn).Event
- hit_takenTold in every player's game when a character took a hit, as its state says: { characterId, healthPointCount }. For the flash, the sound, the number.Event
- hit_landedTold in the attacker's own game the moment its swing meets someone on its screen: { attackerId, targetId, abilityName }. For the feel only: whether it counts is judged where hits are.Event
- model_madeTold when the view made a character's model: { characterId, model }, model being the body or the game's own. Put a sword in its hand here.Event
None.
More extensions
More from btc7274
Versions
- 1.0.0Nov 30, 2026 · 12 files · 151 KBNewest
No version has passed its checks yet.





