Free Hero Mesh

Check-in [b9ac4c0116]
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
Comment:Add some documentation files.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b9ac4c011659f6750f084e0001bee7499e732475
User & Date: user on 2020-12-15 05:21:02
Other Links: manifest | tags
Context
2020-12-16
00:08
Start the implementation of animations. check-in: 0f84344e70 user: user tags: trunk
2020-12-15
05:21
Add some documentation files. check-in: b9ac4c0116 user: user tags: trunk
03:23
Add some mode-independent binding commands check-in: df17ecd054 user: user tags: trunk
Changes

Added bindings.doc version [8ca36f207e].











































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
This document describes the format of the key/mouse bindings and the list
of the available commands that the binding can be set to.

The resource name for a binding consists of the following in order:
* The puzzle set name (can be "?" to apply to all puzzle sets)
* One of "editClick", "editKey", "gameClick", or "gameKey"
* Zero or more components for modifier keys (see below)
* Key name (or mouse button)

You cannot use "?" for keys, mouse buttons, or modifiers. You may,
however, use "?" in place of the edit/game selection.

Valid modifier keys are:
* shift
* ctrl
* alt
* meta
* numLock (cannot be combined with other modifiers except shift)

Most key names are lowercase, except alphabetic keys which are uppercase.
Mouse button names are "left", "middle", or "right".

The value specifies what action. The action can be one of the below:

It can be + (to advance) or - (to rewind) or = (to restart) followed by
the number of moves.

It can be ! followed by a system command.

It can be ' followed by a Hero Mesh key name, to input a move.

It can be ^ followed by one more character, to execute a command which
has ^ as the first character; if it requires an argument, the clicked
location will be used if it is clicked with the mouse.

Finally, it can be a single SQL statement. The result rows are treated as
commands to execute, where the first column is a string of two characters
(the possibilities are explained below) and the rest of the columns (if
any) are the arguments. You can use NULL for trailing arguments if you do
not need that many arguments.

SQL statements can also contain host parameters. The valid host parameters
are $X (clicked X coordinate), $Y (clicked Y coordinate), $LEVEL (level
order number), $LEVEL_ID (level ID number), and any name with : at first
to ask the user for the value to use.


=== Game commands ===

'' ' <key>
  Input a move.

'+ ' <count>
  Advance that many moves in the replay list.

'- ' <count>
  Rewind that many moves.

'= ' <count>
  Restart and replay that many moves.

'^o' <location>
  List objects at the specified coordinates.


=== Editor commands ===

'^c'
  Display the class selection menu.


=== Mode-independent commands ===

':!' <command>
  Execute a system command.

':;'
  Ignore the rest of the result rows of this SQL statement.

':?' <text>
  Write text to stdout.

':m' <text>
  Display text on the screen, wait to push enter to continue.

':x'
  Ask for a SQL statement, execute it, and display the results.

'^E'
  Switch to the editor.

'^P'
  Switch to the game play.

'^Q'
  Quit.

'go' <level>
  Go to the specified level. If the level number is negative, then it is
  a level order number, otherwise it is a level ID number.

Added sql.doc version [1e5a6a3c19].





























































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
This document explains the SQL functions and SQL tables which are
available for the user customization in Free Hero Mesh. (You cannot
use SQL to define the rules of the game.)


=== Functions ===

Asterisks denote aggregate/window functions.

BASENAME()
  The base name, which is a copy of the first command-line argument (not
  counting the switches or the program name).

CLASS_DATA(id,info)
  Returns data about a class.

CVALUE(number)
  Makes a game value of type 'class', given the class number.

HEROMESH_ESCAPE(blob)
  Converts blob representation of a game string into escaped format.

HEROMESH_TYPE(value)
  The type of a game value, given as a 64-bit integer. The types are
  'class', 'number', 'string', 'object', and 'sound'.

HEROMESH_UNESCAPE(text)
  Converts escaped representation of a game string into text format.

LEVEL()
  The one-based order number of the current level.

LEVEL_CACHEID()
  The cache ID number of this level in the user cache table.

LEVEL_ID()
  The ID number of the current level.

LEVEL_TITLE()
  The title of the current level, as a blob.

LOAD_LEVEL(level_id)
  Only valid when Free Hero Mesh is invoked with the -x switch. Loads
  the level with the specified ID number.

MVALUE(number)
  Makes a game value of type 'message'.

MODSTATE()
  The SDL keyboard modifier state.

MOVENUMBER()
  Return the number of moves executed so far since the level restarted.

NVALUE(number)
  Makes a game value of type 'number'. Same as ZERO_EXTEND.

OVALUE(number)
  Makes a game value of type 'object'. The argument is the ID number of
  the object in the OBJECTS table.

PICTURE_SIZE()
  Tell you the picture size.

READ_LUMP_AT(offset,ptr)
  Used internally; there is no way to use this in user SQL codes.

RESOURCE(...)
  Given the list of resource names, read a value from the X resource
  manager. Returns null if there is no such resource value.

SIGN_EXTEND(number)
  Sign extends a 32-bit number to 64-bits.

TRACE_OFF()
  Disables tracing when called.

TRACE_ON()
  Enables tracing when called.

ZERO_EXTEND(number)
  Zero extends a 32-bit number to 64-bits. Same as NVALUE.


=== Tables ===

Asterisks denote virtual tables.

CREATE TABLE "CLASSES"("ID" INTEGER PRIMARY KEY, "NAME" TEXT, "EDITORHELP"
TEXT, "HELP" TEXT, "INPUT" INT, "QUIZ" INT, "TRACEIN" INT, "TRACEOUT" INT,
"GROUP" TEXT, "PLAYER" INT); *
  A list of classes in the current puzzle set; mostly read-only. Only
  QUIZ, TRACEIN, and TRACEOUT are writable. If TRACEIN is true then it
  will trace messages received by this class (if tracing is enabled). If
  TRACEOUT is true then it will trace messages sent by this class (if
  tracing is enabled).

CREATE TABLE "MESSAGES"("ID" INTEGER PRIMARY KEY, "NAME" TEXT, "TRACE"
INT); *
  The list of messages in the current puzzle set; mostly read-only. Only
  TRACE is writable; if true, this message will be traced.

CREATE TABLE "OBJECTS"("ID" INTEGER PRIMARY KEY, "CLASS" INT, "MISC1" INT,
"MISC2" INT, "MISC3" INT, "IMAGE" INT, "DIR" INT, "X" INT, "Y" INT, "UP"
INT, "DOWN" INT, "DENSITY" INT HIDDEN); *
  List of objects. Read-only during the game, writable in the editor.
  CLASS is a class number (the ID in the CLASSES table), DIR is the
  direction (where 0 is east, 7 is southeast), and MISC1, MISC2, MISC3
  are the game values for the initial Misc values of this object; they
  must be numbers, classes, messages, or strings. Once an object is
  created, you cannot change its class; you must delete it and then add
  a new object of the correct class. DENSITY is read-only, but you can
  use ORDER BY DENSITY to sort in the stacking order of the objects.
  UP and DOWN are also read-only.

CREATE TEMPORARY TABLE "PICTURES"("ID" INTEGER PRIMARY KEY, "NAME" TEXT
COLLATE NOCASE, "OFFSET" INT);
  List of all pictures available in this puzzle set.

CREATE TABLE "USERCACHEDATA"("ID" INTEGER PRIMARY KEY, "FILE" INT,
"LEVEL" INT, "NAME" TEXT COLLATE NOCASE, "OFFSET" INT, "DATA" BLOB,
"USERSTATE" BLOB);
  Contains the user cache data for the .level and .solution files of each
  puzzle set, in order to speed up loading and saving. The DATA will be
  null unless the data has changed, in which case the new data is stored
  here; it will later rewrite the Hamster archive with the new data and
  then it will be set to null again. USERSTATE contains user data such as
  the list of moves made by the player. FILE is the ID in the user cache
  index, and indicates which Hamster archive file this lump belongs to.

CREATE TABLE "USERCACHEINDEX"("ID" INTEGER PRIMARY KEY, "NAME" TEXT,
"TIME" INT);
  The user cache index; contains one record for each .level and .solution
  file of all puzzle sets which have been loaded. NAME is the full path,
  and TIME is the UNIX timestamp. If you want to delete a record, then
  you should also delete all records from USERCACHEDATA whose FILE value
  is the same as the ID value in this table for which it is deleted. You
  should not touch it while Free Hero Mesh is running, though.

CREATE TEMPORARY TABLE "VARIABLES"("ID" INTEGER PRIMARY KEY, "NAME" TEXT);
  List of all global and local user variables used in the game.