EMCCV

Create Your Own Module

Turn your artwork into a module anyone can play with

So you want to create your own content? Maybe revive that old Kisekae set you put so much effort into, or come up with something completely new! Or maybe you just want to add your own styles to an existing module. Then this is where you begin.

Good to know: to load your own modules you'll need the desktop version of EMCCV, which is coming soon. The web version currently includes SailorXv3 only. Modules made for the old EMCCV Prototype work in the new version, too.

On this page

  1. The EMCCV mindset
  2. What you need
  3. The module folder
  4. Preparing your graphics
  5. The building blocks
  6. Your first module, step by step
  7. Choosing good IDs
  8. Layers and positions
  9. Making things depend on each other
  10. Attribute reference
  11. Testing your module
  12. Sharing your module

1. The EMCCV Mindset

The EMCCV is a viewer for modules, just like a word processor is a viewer for documents. It displays modules, offers tools for working with them, and generates the whole interface for you: the tabs, the checkboxes for turning things on and off, the style options and the colour pickers.

A module (in KiSS terms: a “doll”) consists of two things:

The final image is made of many semi-transparent, individually coloured images layered on top of each other. You decide how they are layered — and the EMCCV does the rest.

2. What You Need

The faster your computer, the more complex you can make your module.

3. The Module Folder

Each module lives in its own folder inside the EMCCV modules folder. A module folder contains:

modules/
  MyModule/
    config.xml      the config file
    data/           all graphic files (use as many subfolders as you like)
    entities/       saved characters (an .xml and a .png preview for each)
    images/         exported images

Only config.xml and data are needed to get started; the EMCCV fills the other folders as you save characters and export images.

4. Preparing Your Graphics

💡 Draw colourable parts in white. The EMCCV colours a file by multiplying it with the colour the user picks. White takes on the chosen colour exactly, greys become darker shades of it, and black stays black. So draw anything the user should be able to recolour in white, with grey shading and dark outlines — one file then works for every colour imaginable. Parts that should keep their own colours (like a printed pattern) can be marked colorizable="false".

5. The Building Blocks

A config file is written in XML, a simple language for storing data. If you've ever seen HTML, it will look familiar: data is described with tags in pointy brackets, like <aspect>, and attributes like title="leotard". Every tag you open must be closed again, either with a closing tag (</aspect>) or by ending it with a slash (<file />).

An EMCCV module uses five tags, always nested in this order:

module→ set→ aspect→ style→ file

Example: the file leotard/standard.png is only drawn when the style “standard” is selected and the aspect “leotard” is checked.

Two optional extras help you organise larger modules: <aspectgroup> groups aspects within a tab (shown with a divider line), and style groups split an aspect's styles into several independent groups — for example, “length” and “cut” for the same skirt. Wrap the styles of each group in a <stylegroup> element with its own id (unique, like every ID) and a short title such as “length”. Styles in an aspect that aren't in any style group form one more group, shown without a title.

6. Your First Module, Step by Step

Step 1: The module

Every config file starts with the same line, which simply declares the XML version. Then comes the module element. Everything else goes inside it.

<?xml version="1.0"?>
<module id="SailorXv3"
        title="Sailor X Generator"
        version="3"
        author="Diana"
        width="600"
        height="1016">
</module>

The width and height are the size of the final image. The version is usually a number — you could call it “LUNA” if you really wanted, but numbers are easier. ;)

Hooray, we have a module! It doesn't show anything yet, though. Let's add some content.

Step 2: A set and an aspect

For SailorXv3 I started with the body, because everything else is positioned relative to it. The body is an aspect — but an aspect always lives inside a set, otherwise the EMCCV wouldn't know which tab to put it in. So we add both, each with an id and a title:

<?xml version="1.0"?>
<module id="SailorXv3" title="Sailor X Generator">
  <set id="setBody" title="BODY">
    <aspect id="aBody" title="body">
    </aspect>
  </set>
</module>

To focus on what's new, the examples keep the module attributes short from here on — but you should always include all of them.

Loaded into the EMCCV, this gives us a tab called “BODY” with an aspect called “body”. We can check it and change its colour — but we won't see anything yet, because there are no graphic files.

Step 3: A style and a file

A file lives inside a style, which lives inside the aspect:

<?xml version="1.0"?>
<module id="SailorXv3" title="Sailor X Generator">
  <set id="setBody" title="BODY">
    <aspect id="aBody" title="body" visible="true">
      <style id="sBodyStandard" title="standard">
        <file src="body/standard.png" />
      </style>
    </aspect>
  </set>
</module>

W00t! A fully functional module! Now the body is drawn on the canvas, and changing the aspect's colour recolours it. Because we added visible="true", the body is shown straight away when the module loads — by default, aspects start hidden.

The file tag is the smallest building block. Nothing goes inside it, so it closes itself with a slash. Files don't need an ID; the only thing they must have is src, the location of the graphic inside the data folder.

As long as an aspect has only one style, the style's title isn't shown anywhere. It's still good practice to add one, because chances are you (or someone else) will add more styles later.

Step 4: More styles

Let's say we have an open hand and a fist. That means two styles — each with its own files:

<aspect id="aBody" title="body" visible="true">
  <style id="sBodyHandOpen" title="open">
    <file src="body/standard.png" />
    <file src="body/hand/open.png" />
  </style>
  <style id="sBodyHandFist" title="fist">
    <file src="body/standard.png" />
    <file src="body/hand/fist.png" />
  </style>
</aspect>

WHOA! This is a whole different game. :) Both styles use the same body file, but different hand files. The first style is selected by default, and the user can switch between them in the style menu.

7. Choosing Good IDs

The id attribute uniquely identifies everything in your config file (except files). No two elements in a module may share the same ID, and no two modules may share the same module ID.

It quickly gets tedious to keep inventing unique IDs, so here's what helps:

8. Layers and Positions

Layers

Files are drawn from the lowest layer number to the highest, so higher layers end up on top. The default is 0 — typically the main part of your image, like the body.

Positions and sizes

By default a file is drawn at the top left corner of the canvas (x="0" y="0") at its original size. Use x and y to move it, w and h to resize it, and relx/rely to shift it relative to an inherited position.

Inheritance saves time

Many attributes are inherited down the hierarchy: if a file doesn't define a layer, it uses its style's layer, which falls back to its <stylegroup>'s (if it has one), then the aspect's, then the set's. So instead of repeating layer="5" on twenty files, put it on their aspect once. The reference below shows which attributes are inherited.

9. Making Things Depend on Each Other

Parent conditions

The parent attribute makes an aspect, style or file depend on other elements. For example, high heels should only be available when shoes are visible:

<aspect id="aHeels" title="heels" parent="aShoes">

An aspect or style with an unmet parent condition can't be selected; a file with an unmet condition isn't drawn. Conditions can combine several IDs:

ConditionMeaning
aShoesThe aspect with the ID “aShoes” must be visible (and its own conditions must be met).
sBootsThe style must be selected (and its aspect must be visible and its conditions met).
!aCapeThe “!” is a negation: the cape must not be visible.
aA and aB
aA, aB
The keyword “and” and the comma do the same thing: both aA and aB must be active (active = visible and/or selected).
aA or aBAt least one of them must be active.
(aA or aB) and aCParentheses group conditions. Without them, “and” is evaluated before “or”.

Example: gloves that follow the hand pose

Remember our body with an open hand and a fist? Now we want gloves — and of course the glove has to match the hand pose. There are two ways to do this, and both work.

Version 1: one glove style per hand pose. Each glove style has the matching hand style as its parent:

<aspect id="aGlove" title="glove">
  <style id="sGloveOpen" title="open" parent="sBodyHandOpen">
    <file src="clothes/gloves/standard_open.png" />
  </style>
  <style id="sGloveFist" title="fist" parent="sBodyHandFist">
    <file src="clothes/gloves/standard_fist.png" />
  </style>
</aspect>

This works, but the user has to pick the matching glove style themselves: switch the hand to a fist while the “open” glove is selected, and the glove disappears until they select the “fist” glove too. It also multiplies quickly: three glove designs for two hand poses already means six styles.

Version 2: parent conditions on the files (recommended). One style per glove design, with one file per hand pose:

<aspect id="aBody" title="body" visible="true">
  <style id="sBodyHandOpen" title="open">
    <file src="body/body.png" />
    <file src="body/hand/open.png" />
  </style>
  <style id="sBodyHandFist" title="fist">
    <file src="body/body.png" />
    <file src="body/hand/fist.png" />
  </style>
</aspect>

<aspect id="aGlove" title="glove">
  <style id="sGloveStandard" title="standard">
    <file src="clothes/gloves/standard_open.png" parent="sBodyHandOpen" />
    <file src="clothes/gloves/standard_fist.png" parent="sBodyHandFist" />
  </style>
</aspect>

Now the glove simply follows the hand: whichever pose is selected, the right file is drawn, and the user only chooses the glove's design. This version is more flexible and future-proof: a new glove design is just one more style, and a new hand pose is one more file in each glove style — nothing else needs to change.

Borrowing colour and opacity

colormaster="aHead" makes an element use the colour of another aspect. SailorXv3 uses this so the eyelids keep matching the skin, even when the eyes are coloured blue. Put it on the aspect, and the aspect won't get its own (useless) colour picker. opacitymaster works the same way for transparency — AFH uses one “shading” aspect to control all shading files.

Mirroring

Many things come in matching pairs or sets: shoulders, eyes, earrings — whatever your module needs. To let users edit them all at once, give the matching aspects the same mirror value, and give their matching styles the same mirror value, too. This example is from SailorXv3:

<aspect id="aBorderShoulderLeft" title="BORDER (shoulder, left)" mirror="BorderShoulder">
  <style id="sBorderShoulderThinLeft" title="thin" mirror="BorderShoulderThin">…</style>
  <style id="sBorderShoulderThickLeft" title="thick" mirror="BorderShoulderThick">…</style>
</aspect>
<aspect id="aBorderShoulderRight" title="BORDER (shoulder, right)" mirror="BorderShoulder">
  <style id="sBorderShoulderThinRight" title="thin" mirror="BorderShoulderThin">…</style>
  <style id="sBorderShoulderThickRight" title="thick" mirror="BorderShoulderThick">…</style>
</aspect>

When the user turns on the Mirror Link tool, showing, hiding or recolouring one shoulder border does the same to the other, and selecting “thick” on one selects it on the other as well. With the tool off, each can be edited separately.

10. Attribute Reference

“Inherited” means the value is taken from the parent element if you don't set it.

Module

AttributeDefaultWhat it does
id—Required. Unique module ID, e.g. SailorXv3.
title—The module's name, shown to users.
version1.0Your module's version.
authorUnknownWho created the module.
description—A short description.
width, height800Size of the final image in pixels.

Set, aspect, stylegroup, style and file

AttributeUsed onDefaultWhat it does
idset, aspect, stylegroup, style—Required. Unique within the module.
titleset, aspect, stylegroup, style—The name shown in the interface.
srcfile—Required. Path to the graphic, inside the data folder.
visibleset, aspectfalseShown when the module loads.
alwaysonset, aspectfalseAlways visible; the checkbox can't be unchecked.
lockedaspectfalseVisibility can't be changed by the user or by randomizing.
incognitoaspectfalseWorks normally but isn't listed in the sidebar — useful as a hidden condition for other elements.
colorset, aspect, file#FFFFFF (set)Starting colour as a hex code. Inherited from set to aspect.
colorizableset, aspect, stylegroup, style, filetrueSet to false to keep a file's original colours. On a set or aspect it also removes the aspect's colour picker. Inherited.
colormasterset, aspect, style, file—ID of an aspect whose colour to use instead. Inherited.
opacityset, aspect, style, file2550 (invisible) to 255 (fully opaque). Inherited.
opacitymasterset, aspect, style, file—ID of an aspect whose opacity to use. Inherited.
layerset, aspect, stylegroup, style, file0Drawing order; higher is on top. Decimals and negatives allowed. Inherited.
x, yset, aspect, stylegroup, style, file0Position on the canvas. Inherited.
w, hset, aspect, style, fileoriginal sizeWidth and height to draw the file at. Inherited.
relx, relyset, aspect, style, file0Offset relative to the inherited position. Inherited.
flippedset, aspect, style, filefalseMirror the graphic horizontally. Inherited.
parentaspect, stylegroup, style, file—Condition that must be met (see above).
probabilityset, aspect75Chance (in %) that the aspect is visible after randomizing. Inherited.
randomizeset, aspect—A letter that becomes a keyboard shortcut for randomizing just this set or aspect.
stylegroupstyledefaultOlder shorthand for style groups: styles with the same group name are mutually exclusive, and the name is shown as the group's title. Prefer <stylegroup> elements, which have their own ID and title.
selectedstylefirst styleWhich style is selected when the module loads.
disabledstylefalseThe style is shown but can't be selected.
mirroraspect, style—Links matching elements for the Mirror Link tool (see above).
blendmodefileblendblend, multiply, screen or add — how the file mixes with what's below it.
brifile0Brightness adjustment, from -255 to 255.

Reserved for the future

These attributes are part of the EMCCV plans. The current version ignores them, so you can already add them to your module and it will be ready when they arrive:

AttributeUsed onWhat it will do
authoridmoduleYour username on EMCCV.com, so people can find all modules by the same creator.
sDesc, lDescmoduleA short and a long description of your module, shown in the module directory on EMCCV.com.
adultonlyall elements, including filesMarks content as adults-only. Users will be asked to confirm their age before such content is shown.

11. Testing Your Module

Load your module often while you work — small steps make mistakes easy to find. When something doesn't look right:

💡 Learn by example: the template module MyMod01 walks you through four lessons — layers and positions, styles and parent conditions, colormaster, and mirroring — with comments explaining every line. It will be included with the desktop version.

12. Sharing Your Module

Created something you're proud of? I'd love to see it! Get in touch and tell me about your module. In the future, EMCCV.com will have a directory where you can publish your modules for others to discover — and until then, you'll find community creations on the Modules & Credits page.