Adding accessories

You can add accessory objects to NPCs in Orchid Rain. They can be only aesthetic, but they also can even have code of their own! You should be careful about giving functionality to the accessories, because you can break the game for people using your mod. Try to be conservative with your added functionality. At the end of the day though, it's your mod.

We are going to make a new mod now, so we'll "empty" the Appearance Stats and Audio Clips fields in the child GameObject of ModelContainer.

Left click in the property box of Appearance Stats. You'll notice that the box now has a blue border, and that the Project window will also highlight briefly the file the field references. Be sure to not actually select the highlighted file.

While the field box is selected with the blue border, press the Delete key on your keyboard. This will "empty" the property without deleting the file. You don't want to delete your file now, as there's no way to undo such action.

Do the same for Audio Clips.

For this example, let's make NPCs have red spheres on their heads. To create a sphere, go to GameObject > 3D Object > Sphere in the menu bar. When your sphere gets created, remember to set its position to 0, 0, 0 in the Inspector window.

The sphere GameObject will be created below your ModelContainer, but not as its child. You are going to want your accessory to be child of the child of ModelContainer. In my case, the child GameObject of ModelContainer is called Test Mod, so the sphere has to be child of Test Mod.

Select Test Mod (or however you've called it) and open up the Bone Accessories properties field. Set its Size to 1.

Drag the sphere GameObject to Accessory Game Object under Element 0. After you do that, click on the Bone Type dropdown and select Head.

Bone Type will tell the game which bone the accessory will follow. Since we selected head, the sphere will be linked to the head bone of the modded NPC.

Also, this is a good time to uncheck Needs Hair. Since you will have a sphere covering the head, hair poking through might not be what you want.

You might be wondering why there's also a field called just Accessories. Bone accessories are for simple objects you want to link to a specific bone, like a helmet or a wrist band for example. Accessories are for skinned objects. A skinned object is a 3D model that has multiple bones, and because of that is deformable. Adding such accessories to characters is a more complicated process.

Now, at this point we have to position the sphere at the exact point we want it to be in relation with the game characters. For this purpose, I've provided you with a 3D model of a Doru. Inside the Examples folder, grab the GenericDoru file and drop it in the Hierarchy window.

You'll see something like this. Ensure that the GenericDoru GameObject's position is also set to 0 on X, Y and Z. As this GameObject will only serve you as a reference, you don't need to make it a child of anything. Leave it as it is in the Hierarchy.

Select the sphere GameObject and use the Move and Scale tools to place it in the head.

While having the sphere GameObject selected, go to the Inspector window and right click the name of the "Sphere Collilder" component. Then, click on "Remove Component". We don't want this sphere to have a collider, as it will inevitably mess with the gameplay, and in this we don't want that.

If you have a collider overlaping the head's hitbox (which is also a collider), you won't be able to shoot the modded NPC in the head, for example.

To give color to the sphere, we need to create a Material. To do that, right click on an empty spot in the Project window, and go to Create > Material.

With your new Material selected, click in the white color box next to the Albedo property, in the Inspector. That will open a small Color window. I'll select a red color.

Drag and drop the Material file right on the sphere GameObject in the Hierarchy window. You can also drag it to the sphere model itself in the Scene window.

In order to create a different mod without losing our previous ones, we'll make a new prefab out of our current one. In the Hierarchy window, right click the ModelContainer GameObject and select "Unpack Prefab Completely".

This will unlink the GameObject with its prefab.

After updating the mod's meta data, save it as a prefab in another folder. I'm not sure what will happen if you save this new ModelContainer right alongside the previous ModelContainer prefab. I don't want to risk losing the previous prefab, and since you cannot change the ModelContainer name, the only option is to save it in a different folder.

In the bottom part of the Inspector, give your mod a different name. Remember that this will be the name everybody will know your mod with.

Once you do that, build it and try it in game.

If you see the accessory not aligning with the bone (head, in this case) perfectly, re-enable it. A quirk of the main menu is that NPCs will spawn with a random animation position, something that won't be a problem in-game.