Free Hero Mesh

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

Differences From Artifact [04a1165740]:

To Artifact [f6921ebc9a]:


267
268
269
270
271
272
273








274
275
276
277
278
279
280
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288







+
+
+
+
+
+
+
+







  can optionally specify a second number, which is the background colour
  for the inventory; if not specified, uses the same colour for both.

(CodePage <number>)
  Define the code page, from 1 to 65535. If not specified, then the
  default code page is used.

(Control <definitions...>)
  Define the control class. The format is the same like other class
  definitions, except that Image and Abstract are not allowed. An
  object of this class is automatically created when initializing the
  level, at X and Y coordinates both zero, and cannot otherwise be
  created, destroyed, or moved. It still receives broadcast messages
  normally, and can also be addressed specifically.

(CollisionLayers <userflags...>)
  Define user flags as CollisionLayers bits; the first defined flag is
  bit0. Up to 8 flags can be defined in this way.

(Misc4 <userflags...>)
  Define user flags as Misc4 bits; the first defined flag is bit0. Up to
  32 flags can be defined in this way.
316
317
318
319
320
321
322
323


324
325
326
327
328
329
330
324
325
326
327
328
329
330

331
332
333
334
335
336
337
338
339







-
+
+







  the specified dimensions. The maximum number of rows is 64, and the
  maximum number of columns is 1024, and the maximum number of cells in
  all arrays in total is 65534. All elements are initialized to zero when
  the level starts.

(<message> <code...>)
  Defines a default message code for all classes which do not specify
  their own code for this message.
  their own code for this message. (It is recommended to not use this
  block, and to use subclassing instead.)

(&<name> <code...>)
  Define a user-defined function. User-defined functions may take any
  number of inputs from the stack and leave any number of outputs on the
  stack, but may not access user-defined local variables. (It may still
  access standard local variables, and all global variables, though.)

1301
1302
1303
1304
1305
1306
1307




1308
1309
1310
1311
1312
1313
1314
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327







+
+
+
+







  object is in the bizarro world and the other one isn't.

,Coloc  ( obj1 obj2 -- bool )
  True if the two specified objects are in the same place, or false
  otherwise. Always false if the object is destroyed, or if one object
  is in the bizarro world and the other one isn't.

Control  ( -- obj )
  Push the control object to the stack. (If no control class is defined,
  then there will be no control object and this will be zero.)

CopyArray  ( src dest -- ) **
  Copy one array to another. It is OK if the two references overlap.

count  ( mark ... -- mark ... count )
  Count how many values are above the mark on the stack.

Create  ( class x y image dir -- obj ) **
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523












2524
2525
2526
2527
2528






2529
2530
2531
2532
2533
2534
2535
2519
2520
2521
2522
2523
2524
2525











2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555







-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+





+
+
+
+
+
+







=== Order of execution ===

You can specify the order of execution of objects by class by a global
(Order) block. Inside of this block is a list of sub-lists; each sub-list
is delimited by parentheses.

Each sub-list starts with a flag name, which may be a user flag, or Input,
or Player. This matches only classes that have that flag (changing that
flag at run time has no effect on order of execution). The remaining
elements are optional; if they are present, they are used to break ties.
First, the second item breaks ties if there is one, and then if there is
still a tie then the third item breaks ties, etc. These extra elements
can be one of the following, with or without a comma: Misc1, Misc2, Misc3,
Misc4, Misc5, Misc6, Misc7, Temperature, Density, Xloc, Yloc, Image. If
there is no comma, they are lowest to highest, but a comma reverses the
order to be highest to lowest instead. These values are treated as signed,
and the values after INIT or CREATE message returns is used. If any of
the values is not a number, then it is an error.
or Player, or Control. This matches only classes that have that flag
(changing that flag at run time has no effect on order of execution).

The remaining elements are optional; if they are present, they are used to
break ties. First, the second item breaks ties if there is one, and then
if there is still a tie then the third item breaks ties, etc. These extra
elements can be one of the following, with or without a comma: Misc1,
Misc2, Misc3, Misc4, Misc5, Misc6, Misc7, Temperature, Density, Xloc, Yloc,
Image. If there is no comma, they are lowest to highest, but a comma
reverses the order to be highest to lowest instead. These values are
treated as signed, and the values after INIT or CREATE message returns is
used. If any of the values is not a number, then it is an error.

The order of execution is then first all objects not listed in the (Order)
block, and then for each sub-list in the (Order) block, the objects that
meet that criteria, in that order. (If it meets multiple criteria, only
the first one that meets that criteria is used.)

Objects not listed in the (Order) block are executed in the reverse order
of their creation. The control object is created after all objects placed
in the level editor but before any other objects, while objects placed in
the editor are created in the order by their coordinates (which is not
necessarily the same order they were put in by the author).

Note: If a value used for the criteria changes after the INIT or CREATE
message of that object returns, then it can result in an unstable (but
still fully deterministic) order when new objects are created. For this
reason, you should only use criteria based on values which don't change.