Slicetree n n.reld

From OHRRPGCE-Wiki
Jump to navigation Jump to 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, and the type is Null.
    • each slice data node contains property nodes (see below)
    • children node (if there are any children)
      • one or more nodes containing slice data - node name is empty
        • each slice data node contains property nodes (see below)
        • each slice with children contains a children node
          • one or more slice nodes
            • (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 in user-defined slice collections, but can be anything. This root slice is not shown in the slice editor by default, but is shown and can be edited by pressing F5. All slices can be of any standard slice type, although there are some restriction on user-created slice collections (for example, they can't contain Special, Map, or (currently) Layout slices). 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
children null Parent node to the child slices (Only present if there are children)
x int
y int
w int
h int
vis bool
mobile bool Obsolete. Was present, but was never false. Can be ignored. Replaced with paused
paused bool If paused, slice velocity isn't applied.
clip bool
vx int Velocity (pixels per tick)
vy int
vtickx int Ticks left for vx to run
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 Fill Parent
fillmode int Whether fill, if true, applies in horizontal, vertical or both dimensions: One of the values:

sliceFillFull = 0
sliceFillHoriz = 1
sliceFillVert = 2

cover int Cover Children; one of:

coverNone = 0
coverHoriz = 1
coverVert = 2
coverFull = 3

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 name of the specific slice type, one of: "Root" (obsolete, should be loaded as a Special slice), "Special", "Container", "Rectangle", "Line", "Sprite", "Text", "Map", "Grid", "Ellipse", "Scroll", "Select", "Panel", "Layout"
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.
editorhidechildren bool Collapse this subtree in the slice editor

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, Special, Root Slices[edit]

Container and Special slices have no additional properties.

Root slices are obsolete, they should be loaded as Special slices.

Rect Slices[edit]

name type details default
style int -1 for none, 0-14 for one of the Box Styles. fg, bg and border are ignored unless style is -1 -1
fg int 0 to 255 color index in master palette for the rect edges, or -n - 1 for UI color n
bg int 0 to 255 color index in master palette for the rect body, or -n - 1 for UI color n
border int -2 for no border, -1 for a line-only border, or n >= 0 to use the same border as box style n. Doesn't normally appear if raw_box_border is present. -1
raw_box_border int Box border spriteset number to use, or -1 to use border' instead (but doesn't normally appear if border is present). -1
trans int Background: 0=solid, 1=fuzzy, 2=hollow (none), 3=blended (transparent)
fuzzfactor int trans=fuzzy and trans=blended rects only: Percentage "fuzziness" or opacity of the background (as a value from 0-100) 50
fz_stationary bool trans=fuzzy rects only: whether to draw the fuzzy pattern relative to top-left of screen instead of top-left of slice false
fz_zoom int trans=fuzzy rects only: size of each pixel in the fuzzy pattern (>= 1) 1

Line Slices[edit]

name type details default
col int 0 to 255 color index in master palette for the rect body, or -n - 1 for UI color n

Ellipse Slices[edit]

Revise.png
This article or section is not complete. If you wish, you may finish it, and remove this tag when you are done.

Sprite Slices[edit]

name type details default
sprtype int the group of sprites, -1 for an asset sprite, 0-8 for PT#, 9 for backdrops, 10 for enemies. If sprtype=-1 then rec, pal, frame are ignored and shouldn't be present.
asset string Only if sprtype=-1. Name of an image file to load from the data/ directory. Can include a path within the data directory, but does not include the "data/" prefix. Case sensitive on Unix, and the / separator must be used, not \. Can be a BMP, GIF, or JPEG image.
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 true
scaled bool If true, the sprite is stretched to the w and h of this slice, rather than the size of the slice being determined by the image size. (Not fully supported) (This incomplete feature is not in nightlies)
dissolving bool Whether to apply a 'dissolve' filter to the sprite
d_type int Which dissolve filter to apply. Offset by 1 from the enemy death animations at DT1:

0=Random pixels
1=Crossfade
2=Diagonal vanish
3=Sink into ground
4=Squash
5=Melt
6=Vapourise
7=Phase out
8=Squeeze
9=Shrink
10=Flicker
11=Shrink to center
12=Fade
13=ghostly fade
14=Fade to white
15=Puff
16=Fade up
17=Blip

d_tick int The "amount" of the dissolve filter is the ratio d_tick/d_time, or if d_back is true, (d_time - d_tick)/d_time
d_time int
d_back bool Whether dissolving backwards, from nothing at d_tick=0 up to the unmodified sprite
d_auto bool Whether to animate the dissolve, advancing d_tick "automatically" by one each tick until it hits d_time
... #Draw Options Blending and opacity settings

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.

Map Slices[edit]

Map slices have no type-specific saveable data (although they ought to save/load #Draw Options, they don't yet).

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.

Layout Slices[edit]

name type details default
dir0 int Primary direction, 0: up, 1: right, 2: down, 3: left
dir1 int Secondary direction, 0-3. Must be orthogonal to primary
padding0 int Pixels of padding between children, along the primary direction
padding1 int Pixels of padding between rows, along the secondary direction
min_breadth int Minimum 'breadth'/width (in secondary dir) of a row
skip_hidden bool Space isn't allocated for hidden children
justified bool Extra padding added in each row to space out children along it (in primary dir)
last_row_justified bool Also justify the final row (applies only if justified=true)
row_align int How to align whole rows, in primary direction (applies only if justified=false):

alignLeft = 0
alignMiddle = 1
alignRight = 2

cell_align int How to align children within the breadth of the row (in secondary dir), if they're thinner:

alignLeft = 0
alignMiddle = 1
alignRight = 2

Panel Slices[edit]

Revise.png
This article or section is not complete. If you wish, you may finish it, and remove this tag when you are done.

Select Slices[edit]

Revise.png
This article or section is not complete. If you wish, you may finish it, and remove this tag when you are done.

Scroll Slices[edit]

Revise.png
This article or section is not complete. If you wish, you may finish it, and remove this tag when you are done.

Draw Options[edit]

Some slice types (currently Sprite, although Map ought to too) can have the following additional common attributes for transparency and blending:

name type details default
blend bool Whether drawing using blend_mode and opacity is enabled. Even if it's disabled, other data members are still loaded and saved if non-default. false
blend_mode int How the sprite's colors are mixed into the destination:

0 - Normal
1 - Add
2 - Multiply

0
opacity float A value from 0.0 to 1.0, unlike the value in the slice editor which is 0-100 1.0