Characters
People in PokeLoom are flat pictures standing in a 3D world, as in the DS games: each is a card, a rectangle drawn with one frame of its sheet, standing at the middle of its cell. How the hardware draws such cards, and why they look right from a tilted camera, is on Billboards and shadows. This page is how you add and move them.
Character sheets
Section titled “Character sheets”A sheet is graphics/characters/<name>.png: four rows (facing down, left, right, up)
of four frames (stand, step, stand, other step). It is the layout of sheets made for
Pokémon Essentials, so community sheets drop in. A sheet of 128 × 128 pixels (frames
of 32 × 32, 16 colours) is used as it is; any other size is fitted, its figures
centred in 32 × 32 frames with their feet on row 29. ploom sheet in.png out.png does
the same to a file.
graphics/sprites.toml lists the sheets. From the sample:
shadow = "shadow"characters = ["player", "watchman", "townswoman", "old_man", "pickup", "player_bike", "player_surf", "small_tree", "boulder", "rock", "fruit_tree", "player_fish"]not_people = ["pickup", "player_bike", "player_surf", "small_tree", "boulder", "rock", "fruit_tree", "player_fish"]bike = "player_bike"surf = "player_surf"fish = "player_fish"emotes = "emotes"effects = ["grass_card", "tall_grass_card", "footprint_sand", "footprint_snow", "splash", "mud_splash", "ring", "dust"]charactersare numbered from 0 in this order; sheet 0 is the player’s.bike,surf,fish(anddive) are the player’s sheets while cycling, surfing, fishing and diving.not_peopleare sheets that are not people: things a field move clears, a dropped item, the player on a bicycle.no_shadowlists sheets drawn with no shadow (small things that lie about).- A sheet marked lit (
[textures.<name>]withlit = true) keeps its colours under any tint and casts no shadow: it is a light.
Every person is one height
Section titled “Every person is one height”In the first frame of each row, a person’s feet end on row 29 of the 32 × 32 frame and
the head begins on row 6: 24 rows. Hair or a hat may rise 3 rows above that; nothing
else may. Age and build are drawn as style, never as height. ploom check measures
every sheet except not_people and no_shadow, and a person of another height is an
error naming the facing and the rows it found. own_height lists sheets made for
another game, which keep their own height and are only noted.
The rule exists because the camera, the rails that hide legs and the shadows are all tuned to one figure. A taller person would poke through a counter built for everyone else.
How many sheets
Section titled “How many sheets”A game may have 255 sheets. Each map loads only the sheets its people use, plus the
player’s, and at most 24 a map: sheets share the map’s 256 KB of video memory
with its textures. In a game with a follower, the follower’s sheet takes one of the
24. ploom check names a map that uses too many, and ploom build prints what each
map takes of video memory.
Map people
Section titled “Map people”A person is an actor object on the map’s events layer (see Maps):
| Property | Meaning |
|---|---|
sprite |
A sheet’s name from sprites.toml, or "none" for a character the map draws itself |
facing |
down, left, right or up |
mover |
How it moves by itself (below) |
param |
A number for the mover |
upper |
true: on the cell’s upper floor, a bridge’s deck |
obstacle |
cut, smash or boulder: something a field move clears |
The sample’s town has a watchman with sprite = "watchman", facing = "right",
mover = "pace" and param = 4: he walks four cells each way along his beat.
Movers
Section titled “Movers”| Mover | The person | param |
|---|---|---|
still |
stands as left | |
face |
faces one way and turns back to it | the direction |
look |
turns now and then | which ways it may face |
spin |
turns a quarter clockwise at a steady pace | |
pace |
walks to and fro the way it faces | cells each way |
wander |
takes a step now and then | how far from where it is |
range |
wanders within a box | its size across and down |
circuit, circuit_back |
walks round a rectangle, turning right or left | its size |
A script changes a mover with mover who, kind, param, and moves anyone with
move; while a script holds the game with lock, nobody moves by a mover. See
Scripts and events.
Facing
Section titled “Facing”By default a card stands upright on its cell, like a cut-out. A game whose
originals draw true billboards (cards that turn to face the camera, as the
generation-4 games do) sets character_facing = true. Then a frame shows its rows on
the screen wherever the person stands, and a card leans back over the cell behind.
Three more [world] keys fit the card to a game’s look, each in sixteenths of a cell:
[world]character_facing = true # cards face the cameracharacter_size = 32 # how much of a cell a 32-pixel frame spanscharacter_dip = 0 # how much lower a card is drawn as the camera tilts downcharacter_south = 0 # how far in front of the cell's middle it standsThe defaults are the engine’s own look. An import writes the original’s values.
Shadows
Section titled “Shadows”Every character casts a shadow, graphics/shadow.png, a soft blob on the ground under
it. A map can turn shadows off with shadows = false in its map.toml, as a dim cave
might. The generation-4 games widen the shadow by day and fade it at night, and
[world.shadow] does the same: a row from each hour, with the shadow’s opacity and
size.
[world.shadow]hours = [6, 9, 18, 21] # each row starts at its hour; the first also before italpha = [12, 20, 16, 8] # opacity, 0 to 31width = [16, 20, 18, 16] # size across, in sixteenths of its owndepth = [16, 16, 16, 16] # size alongWithout the table the shadow is the same all day. Every key is under
[world.shadow].
Ground effects
Section titled “Ground effects”The ground reacts to whoever walks on it, by the cell’s behaviour. effects in
sprites.toml names the eight pictures it draws, in this order: the grass card, the
tall grass card, a footprint on sand, one on snow, the puddle splash, the mud splash,
the ring on shallow water and landing dust.
| Behaviour | What shows |
|---|---|
grass |
a card of blades over the legs |
tall_grass |
a taller card that shakes; a step sound |
sand |
footprints |
snow |
footprints; a step sound |
deep_snow, deeper_snow, deepest_snow |
the figure sinks; no running, then slower |
puddle |
a splash |
shallows |
a ring on the water |
mud, deep_mud |
a splash; the figure sinks |
Without effects none of these pictures is drawn. The sample’s town has textures
for sand, snow, puddles, mud and shallows to try them on.
Followers
Section titled “Followers”With [world.followers] in game.toml, the first creature of the party walks one cell
behind the player. A game without the table has no follower and spends nothing on one.
- It takes each cell the player has just left, at the player’s pace; it hops ledges after them and goes round corners the way they went.
- It is never in the way: the player walks through it, others stop for it, and it does not block a trainer’s line of sight.
- Through a door it steps into the doorway after the player; after any warp it comes out behind the player’s first step.
- It stays in when the lead cannot follow (an egg, fainted, no sheet), on a map whose
map.tomlsaysfollowers = false, and after a script’shide follower.
Its picture is follow.png in the species’ folder of graphics/creatures/: two
frames a facing, side by side, in the rows down, left, right, up, frames of 32 × 32 or
64 × 64 for a large creature, 15 colours and the transparent one. follow_shiny.png is
the same drawing in its rare colours. A species without one follows with the game’s
graphics/creatures/follow.png, or not at all.
Talking to it runs the map’s on follower hook, or the one in scripts/common.pfs,
with self meaning the follower:
on follower { lock faceplayer emote self, glad say "It shakes the dew off its tail." release}Without a hook the engine says one of three lines of its own, by how fond the creature is of the player.
Trainer sight
Section titled “Trainer sight”A person sees the player with an on sight event: looking the way it faces, it fires
when the player is straight ahead within range cells with nothing solid between.
It fires once, and not again until the player has left its sight. From the sample’s
town, after the station bells have rung:
on sight beat_watch, 5 when STORY >= 5 && !BEAT_GATE_WATCH { lock emote self, alert approach trainerbattle NIGHT_WATCH, "Harl", 0, intro: "The station's been robbed and here you are.", defeat: "Go on, then. I never saw you." ...}emote self, alert shows the mark over the watcher’s head, approach walks it up to
the player, and trainerbattle starts the battle. The same event with no battle is a
guard who sends the player home: the sample’s watch does that before the bells. See
Battles for trainers and their teams.
Planned
Section titled “Planned”Planned (plan 25): the follower finished: modes per map, tall and hovering creatures, moods and things it finds, and a person as a follower (an escort, a partner trainer).
Planned (plan 25): reflections of characters in water and shiny floors.
Planned (plan 25): disguised people (a trainer hidden as a rock or under the sand).
Planned (plan 20, parked): crowds of walkers in lanes for big cities: spawned off screen, with no script and no save state, under a cap on visible walkers.