Slicetree n n.reld

From OHRRPGCE-Wiki
Jump to: navigation, search

Naming Scheme[edit]

Saved slice collections are stored in the RPG file with the naming scheme:

slicetree_#_#.reld

Where the first # is the slice collection group, and the second # is the slice collection number. The collection numbers do not have to be sequential. There can be gaps. (The slice collection editor will not save any file for a completely empty slice collection)

number collection group description
0 user defined collections Can be loaded in plotscripts
 ? undefined other groups will be defined later for builtin menus, screens, and other layouts.

Data Format[edit]

The data in a slicetree_#_#.reld file is stored in RELOAD format. The root node of the document is a slice; there no top level structure to the file.

  • "Root" Node - The name of this node is empty like all other slice nodes.
    • children node
      • one or more nodes containing slice data
        • each slice data node contains property nodes (see below)
        • each slice with children contains a children node
          • one or more nodes containing slice data
            • each slice data node contains property nodes (see below)
            • each slice with children contains a children node
              • (tree structure continues as deep as necessary)

The arrangement of slices and slice children will be different for every collection. There is no limit on the total number of slices, nor is there any limit on the number of child slices any parent slice can contain.

The root slice is typically a container slice. This root slice is not shown in the slice editor. All other slices can be of any standard slice type. There are no restrictions on which slice types can be parents and children.

Slice Properties[edit]

  • All slice nodes have empty names, and the names are ignored anyway.
  • Default values for missing properties are 0 (false) unless otherwise noted.
  • Property nodes may appear in any order. Don't expect them to always appear in the same order they are listed here!

All Slices[edit]

name type details
x int
y int
w int
h int
vis bool
mobile bool Defaults to true if not present
clip bool
vx int
vy int
vtickx int
vticky int
ttick int Number of ticks to move to target, 0 means no movement
tx int Target x
ty int Target y
alignh int 0=left, 1=center, 2=right
alignv int 0=top, 1=center, 2=bottom
anchorh int 0=left, 1=center, 2=right
anchorv int 0=top, 1=center, 2=bottom
padt int
padl int
padr int
padb int
fill bool
sort int Sorting priority
autosort int One of the values:

slAutoSortNone = 0
slAutoSortCustom = 1
slAutoSortY = 2
slAutoSortTopY = 3
slAutoSortCenterY = 4
slAutoSortBottomY = 5

type string the short name of the specific slice type
fill bool
extra0 int
extra1 int
extra2 int
lookup int Lookup code
tableslot_handle int A positive integer equal to the slice handle. No two slices in the file will have the same handle. This is only saved in saved games.

NOTE: x, y, w, h, padt, padl, padr, padb, tx, ty are all pixel values. Any signed 32-bit integer value must be allowed, even if it would be insane for a pixel distance, since games sometimes use these values as meta-data for other purposes on non-visible slices.

Container Slices[edit]

Container slices have no special properties

Rect Slices[edit]

name type details default
style int -1 for none, 0-14 for the styles -1
fg int 0 to 255 color index in master palette for the rect edges.
bg int 0 to 255 color index in master palette for the rect body.
trans int 0=solid, 1=fuzzy, 2=hollow
border int -1 for none 0+ for thickness -1

Sprite Slices[edit]

name type details default
sprtype int the group of sprites, 0-8 for PT#, 9 for MXS
rec int record number of the sprite within its sprite group
pal int 16 color palette index, or -1 to use the default palette for this sprite (absent for non-paletted sprites -1
frame int current frame, for sprite groups that allow multiple frames
fliph bool true if the sprite is horizontally flipped
flipv bool true if the sprite is vertically flipped
trans bool true if colour 0 of the sprite is to be transparent 1

Text Slice[edit]

name type details default
s string A string of text. There are no limits on the length of the string.
col int 0 to 255 color index in master palette for the text.
outline bool true if the text should be drawn with a black outline
wrap bool true if the text should wrap within the chosen slice width.
bgcol int 0 to 255 color index in master palette for the background box around the text (no effect if outline is true)

When a Text Slice is set to wrap, the width and height can be manually adjusted, and the wrapping will be updated. When a Text Slice is not set to wrap, its width and height will be automatically set.

Grid Slices[edit]

name type details default
cols int number of columns in the grid. Node that 0 is a legal value, but will still be treated like 1 column.
rows int number of rows in the grid. Node that 0 is a legal value, but will still be treated like 1 row.
show bool true if the grid edges should be drawn, false if the grid is invisible just like the Container slice.