SpriteGrid

Developer documentation

Error codes

A call that can't be done changes nothing. Its error message starts with one of these 29 codes and a colon, then says what was wrong and how to ask again.

no_document

No document is open in SpriteGrid. Make one with new_document or open one with open_document.

document_not_found

No open document matches the id, path or name given. get_status lists the open documents.

layer_not_found

The document has no layer with that id or name, or no layers at all. describe_document lists them.

ambiguous_layer

More than one layer has that name. Name the layer by its id instead; the message lists them.

layer_not_paintable

The layer isn't an image layer (it's a group, text or 3D layer, say), so it can't be drawn on. Draw on an image layer (add_layer makes one).

layer_locked

The layer is locked. Unlock it with update_layer (locked: false), or draw on another layer.

slice_not_found

The document has no slice by that name. describe_document lists the slices.

effect_not_found

No effect matches: either SpriteGrid has no effect of that kind (list_effects lists them), or the layer has no effect with that id (describe_document lists each layer's).

no_animation

The document isn't an animation, and the call needs one. Make it one with set_animation.

frame_held

That frame shows an earlier frame's drawing (it has none of its own), so drawing on it wouldn't stick. Give it its own with set_cel, or draw on the frame whose drawing it shows.

tile_not_found

The atlas has no such tile, or no tiles yet. describe_atlas lists them; add_tile makes one.

out_of_bounds

A position, area, frame or index is outside what the document has. The message says what the limits are.

too_large

The request is bigger than one call can take: too many pixels, cells or frames, or too big an image. Split it up, or ask for a smaller scale.

invalid_argument

A value can't be used as given: a malformed color, a grid whose rows don't match, an unknown option, and so on. The message says which and why.

revision_mismatch

The document changed since the expectedRevision given (the user edited it, say), so nothing was done. Look at it again, then retry.

user_busy

The user is drawing in SpriteGrid right now, and changes wait for them. Try again in a moment.

document_generating

Something is being generated for the document with Retro Diffusion, and it's locked until that finishes (usually under a minute). Try again then, or work in another document.

document_in_use

Another assistant is working on the document, so it's locked to everyone else until they release it or go quiet for 20 seconds. Work in another document, or wait; get_status says who's working on which.

document_taken_over

The user took the document over from this assistant, which can still look at it but not change it again. Work in another document, or ask the user.

dialog_open

SpriteGrid is showing a dialog, and the change waits until the user closes it. Try again in a moment.

file_exists

A file is already at that path. Pass overwrite: true to replace it, or pick another path.

file_not_found

There's no file at that path. Paths are full paths; a leading ~ is the home folder.

unsaved_changes

Closing or replacing the document would lose unsaved changes. Save it first (save_document), or pass discardChanges: true.

nothing_to_undo

There's nothing to undo (or redo).

not_the_assistants_step

The step to undo or join isn't this assistant's own: it's the user's or another assistant's. Pass includeUserSteps: true to undo the user's step anyway; only an assistant's own newest steps can be joined.

render_failed

SpriteGrid couldn't render the image just then. Try again.

not_connected

SpriteGrid isn't connected to a Retro Diffusion account, or the account's key was refused. The user connects in Generate ▸ Account.

not_enough_credit

The Retro Diffusion account doesn't have enough credit for the generation. The user can add funds in Generate ▸ Account.

failed

Something went wrong that the other codes don't cover, or SpriteGrid didn't answer in time. Nothing should have changed; check with describe_document.