Tutorial 2: My Chair, Now with More Cowbell


Download the finished result of following this tutorial, for reference. Try creating the plug-in yourself first!

Download
Skill Level: Intermediate

This tutorial relies on knowledge gained in previous tutorials, and requires understanding the basics of navigating the Creation Kit.

In the last tutorial, we created a basic portable camping chair. We’re now going to make our chair even cooler, and add a lantern (with a working light source), pelt rug, and a small pile of wood. Should make for a fitting addition to any campsite.

In Campfire, we use a what you see is what you get-style system of putting objects together that will be placed as a group, and removed as a group.

To do this, we will introduce a new concept: the position reference. A position reference is an object in a “staging” cell that is placed just the way we want things to look. We will then point our script at these position references, and it will make our placed objects look exactly like the arrangement of position references, without having to mess with coordinates or angles ourselves.

This plug-and-play approach also allows you to tweak and fine-tune your creations very quickly by simply moving things around in the Creation Kit render window.

The Staging Cell

After opening the Creation Kit and loading your chair plug-in from the previous tutorial, in the Cell View window, double-click the _Camp_ModPlaceableObjectCell. This is a special cell for modders to stage the appearance of their placeable objects.

After it loads, you should see something like this:

As you can see, this cell is a blank slate for you to use as you like.

If you can’t see anything, press the A key on your keyboard with the Render Window selected to change the lighting to full brightness.
The following sections assume you know the general controls for navigating the Render Window of the Creation Kit. If you haven’t done this before, or need a refresher, consult this page, “Navigating the Render Window”.

Adding the Center Object

First, we will drag the center object position reference into the Render Window. This represents the object the player interacts with, and all of our objects will be placed around it. In our case, it’s a chair. Drag CommonChair01 into the Render Window and position it similarly to what’s shown. (You don’t have to be exact.)

Do NOT drag your placeable object chair into the staging cell! If you do this, you will have added a placeable object to the world without having spawned it from an inventory item, and Campfire may get confused. Use the base chair object CommonChair01 instead!

Cluttering It Up

Now that we have our chair, we can add some things around it that will be placed with it.

Drag the following Static objects into the render window:

  • CandleLanternwithCandle01
  • GoatPeltStatic
  • FirewoodPileSmall01

Arrange them around the chair similarly to what’s shown below, or feel free to put them where you like. Try to keep them close to the chair.

For a final bit of detail, drag the Light object DefaultCandleLight01NS into the Render Window and position it near the lantern as shown.

You may have to turn on Light Markers in the Creation Kit to see it by selecting View, and checking Markers and Light Markers.


Naming References

It’s a good practice to give our position references unique reference names so we can find them easily later. We will use the following names:

  • _Tutorial_PosRef_Chair
  • _Tutorial_PosRef_Pelt
  • _Tutorial_PosRef_Wood
  • _Tutorial_PosRef_Lantern
  • _Tutorial_PosRef_Light

Double click each object in the Render Window and set their names as shown below.


CampPlaceableObjectEx

To hook everything up, we need to give our placeable object chair a new, more powerful script. Open your placeable object chair in the Furniture category and remove the CampPlaceableObject script, and attach CampPlaceableObjectEx instead. As you might guess, this is an “extended” version of CampPlaceableObject, with extra features.

Open the Properties of CampPlaceableObjectEx and…

Woah! That’s a lot of properties!

Don’t panic. Most of them are optional, and we are only going to set a few of them.

Start by setting Asset_ExtraLight1 to DefaultCandleLight01NS. Then, set Asset_ExtraStatic1, 2, and 3 to CandleLanternWithCandle01, GoatPeltStatic, and FirewoodPileSmall01, respectively.

Scroll down, and set PositionRef_ExtraLight1 to your Light position reference (use the button to select it from the Render Window, or select it from the drop downs).

Set PositionRef_ExtraStatic1, 2, and 3 to your lantern, pelt, and firewood pile position references, respectively.

Make sure to match the order of the position references with the order you filled out the asset properties; if you put the Pelt static in Asset_ExtraStatic1, then your pelt position reference belongs in PositionRef_ExtraStatic1.

Lastly, set _RequiredPositionRef_CenterObject to your chair position reference. You can also set Setting_Flammable to True if you like.

The Asset properties determine what to place.

The PositionRef properties determine where to place them.

After you’ve filled out your properties, you’re done! Hit OK to close out the properties window and the chair object, save your plug-in, and try it out in-game.


Testing It Out

We place our chair in game, and… sweet! Exactly the way we laid it out in the staging cell.

A camping chair fit for a king.

In this tutorial, you learned:

  • What a position reference is
  • How to use the modder’s staging cell to set up your creations
  • How to use CampPlaceableObjectEx to add extra visual appeal and functionality to your existing chair

We now have enough knowledge to create tents. In the next tutorial, we will create a simple wooden shelter.