Lemmings DS

Mathew Carr

Lemmings DS Graphical Objects - June 2007

Graphical objects are files containing parameters and graphical data for a single 'active' object. There are six types of 'graphical object':

Graphical object files are named <type>_<n>.lgo (where n is from zero upwards), and should be placed in the /LemmingsDS/standard_graphical_objects/ directory.

The u32 <type>_genus_junction fields in a Lemmings DS .lds level specify what graphical objects should be loaded in order to play the level. If the highest bit is set, then a 'custom' graphical object from the level set's 'custom_graphical_objects' directory should be loaded.

Graphical object tool:

Graphical objects are created using the lemmings_graphical_object command-line utility. lemmings_graphical_object is designed to take a series of 16 colour 8-bit PNGs and output a single .lgo based on the parameters you specify. (Each PNG must contain the same palette in the same order. The PNGs must only use the first 16 of their 256 colour palette, excluding the transparent colour which can appear anywhere.)

lemmings_graphical_object A B C D E F G H I J K L M N O P

A - SOURCE_DIRECTORY      A path which the program can lop 00.png onto to find
                          your images.
B - GRAPHICAL_OBJECT_TYPE [ 0          exit | 1      entrance | 2         trap ]
                          [ 3        hazard | 4 uninteractive | 5        water ]
C - NO_IMAGES             How many images are there in total?
D - NO_PRIMARY_IMAGES     (TRAPS) How many images in the primary animation?
E - NO_SECONDARY_IMAGES   (TRAPS) How many images in the secondary animation?
F - REPRESENTING_FRAME    What frame should be used as preview in LDS Builder?
G - TRANSPARENT_COLOUR    Which is the transparent colour in the source images?
H - HANDLE_X              Identify the active coordinate within the object.
I - HANDLE_Y              Identify the active coordinate within the object.
J - ACTIVE_ZONE_X1        Identify the active zone for exits, traps and hazards.
K - ACTIVE_ZONE_Y1        Identify the active zone for exits, traps, hazards and water.
L - ACTIVE_ZONE_X2        Identify the active zone for exits, traps and hazards.
M - ACTIVE_ZONE_Y2        Identify the active zone for exits, traps, hazards and water.
N - FLAGS                 Special flags describing the behaviour of the graphical object
O - DESCRIPTIVE_NAME      15 character description for the object. (NO SPACES)
P - OUTPUT_FILE_NAME      Specify a .LGO output file name.

Hotspots are always given measured from the top left of an image.

FLAGS are as follows: (use OR for combinations)
  1: Lemmings are killed by this TRAP's active region when they are on the ground.
  2: Lemmings are killed by this TRAP's active region when they are are falling or floating.
  

Example usage:

                            A                     B   C   D   E   F   G   H   I   J   K    L   M   N   O              P

lemmings_graphical_object object_sources\o00_01_  1   10  10  0   0   16  23  12  0   0    0   0   0   ENT_soil       entrance_0.lgo
   

This command will create an entrance graphical object with 10 frames. (from object_sources\o00_01_00.png to object_sources\o00_01_09.png)
In the editor it will be shown as frame 0.
Colour 16 will be used as the transparent colour.
The handle will be placed at (23, 12) (Lemmings hotspots will be generated from this pixel)
In the editor it will be described as ENT_soil.
The file generated will be called entrance_0.lgo

                            A                     B   C   D   E   F   G   H   I   J   K    L   M   N   O               P

lemmings_graphical_object object_sources\o00_08_  2   17  1   16  1   16  6   36  -1  -1   2   0   1   T_soil_rocktrap trap_1.lgo
   

This command will create an trap graphical object with 17 frames. (from object_sources\o00_08_00.png to object_sources\o00_06_16.png)
The idle animation consists of 1 frame.
The active (killing) animation consists of 16 frames.
In the editor it will be shown as frame 1.
Colour 16 will be used as the transparent colour.
The handle will be placed at (6, 36) (The active zone is described relative to this pixel.)
The Lemming hotspot must be within the rectangle described by (-1, -1) (2, 0)
Lemmings can be killed when GROUNDED within this region.
In the editor it will be described as T_soil_rocktrap.
The file generated will be called trap_1.lgo

The diagram below shows how the hotspot is calculated:

A Lemming's hotspot must lie within the red rectangle for the trap to activate. (The trap must also not be currently playing its active animation. While a trap is active, Lemmings can pass through it without danger.)