Free Hero Mesh

Update of "SQL tables"
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.
Overview

Artifact ID: ea5b402f839fed18850b266952d05c4603deadb7
Page Name:SQL tables
Date: 2018-06-02 23:25:44
Original User: zzo38
Parent: 41d74d5cccd83f8db920eb3080ac5a973e187825 (diff)
Next 47f88ed51cbe20b5a7e4fe8545d5a28ed45d45a3
Content

This document is a list of the available SQL tables and views that you can use in the customization of Free Hero Mesh. See also: SQL functions.

(Note: This is only a draft and is likely to change in future.)

An asterisk in the heading indicates a virtual table; you cannot define triggers on a virtual table.

CLASSES *

This table is read-only.

INVENTORY *

This table is read-only.

LEVELS *

MOVES *

OBJECTS *

This table is read-only in game mode; it can be written in edit mode.

PICTURES

CREATE TEMPORARY TABLE "PICTURES"("ID" INTEGER PRIMARY KEY, "NAME" TEXT, "OFFSET" INT);

A list of all of the pictures that are available; loaded from the .xclass file. Probably only the NAME column is useful to the user; it is the lump name without the .IMG suffix.

While it is possible to write to this table, there is probably no use to do so.

USERCACHEDATA

CREATE TABLE "USERCACHEDATA"("ID" INTEGER PRIMARY KEY, "FILE" INT, "LEVEL" INT, "NAME" TEXT, "OFFSET" INT, "DATA" BLOB, "USERSTATE" BLOB);

Data of user cache. The following columns are available:

Tampering with the data in this table can have unexpected consequences; you should only use this to clear the user state, or to clear the cache entirely (which should not be done while this puzzle set is currently loaded).

USERCACHEINDEX

CREATE TABLE "USERCACHEINDEX"("ID" INTEGER PRIMARY KEY, "NAME" TEXT, "TIME" INT);

Index for user cache. The name is the full path to that file, after all symlinks have been followed. The time is the mtime or ctime (as a UNIX timestamp value), whichever is more recent.

The user cache is used to store the offsets for the .level and .solution files, as well as data that is waiting to be written to those files.

Tampering with the data in this table can have unexpected consequences; you should only use this if you want to clear the cache entirely, or if you have renamed the file and want the cache to continue to work (neither should be done while the puzzle set is currently loaded; use the sqlite3 command-line instead of doing it within Free Hero Mesh).

VARIABLES

CREATE TEMPORARY TABLE "VARIABLES"("ID" INTEGER PRIMARY KEY, "NAME" TEXT);

List of all global and local variables. The ID is the class number left shifted by sixteen bits (the class number is zero for global variables), and then the low sixteen bits have the variable number. The name omits the @ or % prefix.