Skip to main content

State Files

Structure

State files are .csv files designed to define placement values for assets within the game engine.

Data Table

This is the first part of the state file. It is essentially a TSV (Tab separated values) table.

It's rows and columns are mostly auto generated so you don't have to worry too much about this section.

The two most useful columns to consider are the ZIndex and Layer columns.

ZIndex

This specifies the order at which an asset is rendered by the engine. The higher the ZIndex value, the higher the asset is rendered

Layer

This classifies an asset into layers. Layering assets allows the game to x-ray them properly

Available layers are as follows:

  • clothing|c Layer: This is invisible when partial x-ray is active
  • underwear|u Layer: This is invisible when full x-ray is active
  • naked|n Layer: Always visible
  • face|f Layer: Always visible

Declarations

This section starts after a line of 10 dashes ----------. It allows you to structure emotions, poses, clothing and group assets to into one.

Structuring characters

It is important to break down each group of assets into it's smallest possible form.

For example:

Underwear is often made up of bra and panties. You can't further break down either of those.

bra:
  body_clothes_bra

panties:
  body_clothes_panty

Another example would be the top portion of a character. You can break that down into body, arms and maybe even shirt.

body:
  body1

arms:
  arm1
  arm2

shirt:
  body_c_shirt
Variants

Once you've defined each part at the most basic level you can add variations to this parts. For example if a character has two different bra types: purple and pink.

bra:
  pink = body_clothes_bra
  purple = body_clothes_bra_purple

To mark which variant should be selected if none is specified add a caret ^ before the suitable variant.

bra:
  pink = body_clothes_bra
  # Default is purple
  ^purple = body_clothes_bra_purple

The reserved keyword default can also be used for this purpose.

bra:
  pink = body_clothes_bra
  # Default is purple
  default = body_clothes_bra_purple
Nesting

Since the overall look of a character would be made up of all these basic body parts, you would need to nest them to build the whole character. To reference another asset declaration use @declaration_name.

For example to define underwear

underwear:
  @bra
  @panties

Using the above declaration you can define a couple of outfits

party_dress:
  @underwear
  body_necklace

casual:
  @underwear
  @top
  @bottom
Putting it all together

You can combine these simple concepts together to create rich and predictable asset build ups.

# /characters/jo/data.csv

eyeroll:
  @outfit
  face_eyeroll

outfit:
  ^casual = @casual
  party = @party_dress

Relationship with milk language

When the state of a character, location or item is set, it is re-rendered using the information from it's state files. From the example above, setting a character like jo's state to eyeroll will render her with the predefined expression.

@state jo eyeroll

To futher change things about a character you can use their accessor in relationship with what has been defined in their state files

// Change to outfit to predefined party dress
$jo:outfit = party

// Make jo braless
$jo:braless = yes

Actions like this can span multiple state files, essentially wherever your braless or outfit or whatever_prop_name property is defined, the rendering of the target character will be affected.

This way, setting the braless property for jo in the example above will mean be she won't wear a bra in her scenes, background activities and dialog. To do this, the braless property must be well defined across all state files

# /jo/jo_pose2/data.csv
bra:
  default = season1_body_u_bra
  braless =
# /scenes/jo_morning_kiss/data.csv
^jo:
  @jo_bra

jo_bra:
  default = b_bra_and_panty_bra
  braless =
# /locations/kitchen/data.csv

^jo:
  ^news = @jo_news
  counter = @jo_counter

jo_counter:
  jocounter_xray_full
  default = jocounter_xray
  default = jocounter
  braless = jocounter_xray_braless
  braless = jocounter_braless