Creating Custom Part Rigblocks - emd4600/SporeModder-FX GitHub Wiki

This is a small guide to show you how to create a part definition (rigblock) for your custom parts. This tutorial assumes you already have a RW4 model for the part; if you don't, go check the Blender add-ons tutorial.

Rigblock files define the properties for the part, such as the model and textures they use, the name, abilities, cost, etc; they are Property Lists (.prop), this page assumes you already have some familiarity with that format.

Part rigblock files usually go in the creature_rigblock~, building_rigblock~, etc folders.

Remember it's recommended you use a prefix (your mod name, for example) in your new file names so they don't collide with other mods.

Once you have created your parts, check this tutorial to ensure they get saved: "Saving with custom parts".

You can also generate a thumbnail icon for your part: "Generating perfect part thumbnails".

Template

The first thing to do is choose the part type. Is it a mouth, a grasper? A roof, a detail? You can choose by setting the parent property to one of the available templates; that will make your file inherit all its properties. For example, if my part is a carinvore mouth, I will add:

key parent CreatureEditorTemplates!CreatureMouthCarnivoreTemplate

Model and textures

Model

Now you must specify which model and textures your part uses. The RW4 models are usually placed in the editor_rigblock~ folder; you must also place a copy into part_models_lod1~ (that's the model that will be used in-game). Then use the modelMeshLOD0 property to say which model you are using:

key modelMeshLOD0 editor_rigblocks~!ce_mouth_jaw_carnivore_02.rw4

Textures (for creatures, cells and plants)

Creatures, cells and plants use a certain texture system known as skinpaint. Each part has to provide 3 different textures:

  • Diffuse: The diffuse map is just the raw color that gets applied to the model.
  • SpecBump: The alpha channel of this texture is used to define specularity, that is, which areas of your model look brighter. The color of the texture is used to simulate bumpiness for the model.
  • TintMask: This texture is used to decide which regions of the model use the creature base/coat/detail paint. In order to understand this texture, you have to look at each color channel individually: red -> base, green -> coat, blue -> detail

Part skin textures are usually placed in the skinPaint_texture~ folder. They use the DDS format, which you can export with Gimp or Photoshop (with a plugin). When you save the file, you must specify the extension to be .rw4.dds so SporeModder FX can convert it to Spore's format.

The texture dimensions are usually powers of 2; Spore uses 128x128 pixels for its parts. You can use higher resolutons, but keep in mind that when the creation is saved they all get baked into a single, fixed-size texture (512x512 by default) so the textures will get downscaled; if your texture is very big, it will take a lot of space in the baked texture and will make the other parts look blurry.

key skinpaintDiffuseTexture skinPaint_texture~!ce_mouth_jaw_carnivore_02__diffuse.rw4
key skinpaintSpecBumpTexture skinPaint_texture~!ce_mouth_jaw_carnivore_02__specBump.rw4
key skinpaintTintMaskTexture skinPaint_texture~!ce_mouth_jaw_carnivore_02__tintMask.rw4

Name

The name displayed in the part is controlled by the blockName property.

texts blockName
	"Canine Jaw"
end

You can use .locale files to provide different translations to your mod; in that case, you can specify the table and instance ID to use a translation:

texts blockName
	(CreatureRigblocks!0x050d2811) "Canine Jaw"
end

Abilities

In this file you can define the abilities your part has. Each ability has an int32 property associated with it; just add that property specifying the ability level. Check this List of Part Capabilities. For example, vocalize level 1 and bite level 3:

int32 modelCapabilityVocalize 1
int32 modelCapabilityBite 3

Scaling

With the modelMaxScale and modelMinScale you can control how much the user can scale the part. The base value is 1.0; a max scale of 2.0, for example, means the part can be scaled up to twice its size; a min scale of 0.2 means the part can be scaled down only to 1/5 of its size. For example:

float modelMaxScale 2
float modelMinScale 0.5

There's also the property modelScale, which applies an scaling factor to the model itself. If you see the part looks too big/small by default, you can use this property to fix it.

Transformations

These things are optional, but sometimes they are useful. It is possible to apply transformations (scale, position and rotation) to the model.

float modelScale 2.0  # make the model twice as big
vector3 modelOffset (0, 0, 1.5)  # move model 1.5 units upwards
vector3 modelRotation (90, 0, 0)  # rotation 90 degrees on the X axis

Effects

It's possible to add effects to your parts. Use modelEffect to list all the effects you want to display in the model; modelRuntimeEffect is the same, but those will be the effects shown in-game.

keys modelEffect
	be_detail_house_04_editor
end
keys modelRuntimeEffect
	be_detail_house_04
end

Additional properties

If you want your part to feel more integrated into spore, it's good to keep gameplay in mind. Add a price for it:

int32 modelPrice 75

You can also specify the complexity:

int32 modelComplexityScore 2

I don't know if this has any effect, but it might be a good idea to specify how many bones your part has:

int32 modelRunTimeBoneCount 9

For audio purposes, you might also want to take a look at the foottype, weapontype, mouthtype and mouthPriority properties. Their usage is quite unknown, however, so you will have to look at existing Spore parts.

Symmetries

Creature parts can have different versions depending on whether they are on the left, right, or center side of the creature. There's one main rigblock file, the one you put into the palette page; then that part, using the modelCenterFile, modelRightFile and modelLeftFile, specifies other rigblock .prop files to be used. These symmetric parts usually set the base part as a parent, and only change a few properties like the rotation or the model. An example of a symmetric part:

key parent creature_rigblock~!ce_cell_movement_flagella_03
key modelMeshLOD0 editor_rigblock~!ce_cell_movement_flagella_01-symmetric.rw4