Coding Basics
For Level Design
Alright poozers, time to expand your knowledge of the Creation Kit. We need more than dragging pretty dirt cliffs into the render window to make the world of Skywind feel alive.
So let us get started with some basics.
Linked Refs
Short for “Linked Reference”. A Linked Reference is a one-way link between references (object instances in the world, like a rock, tree, dirt cliff, weapon, NPC, etc. in the world.)
1. To link a reference to another, double click a reference and go to this window.
2. Right click in the empty list and select new. This window should pop up.From here you can either filter by cell and select from a list of objects in that cell or select manually.
3. The easiest way is to use “Select Reference in Render Window”. From there your cursor should change to a targeting reticle. When it turns white, your mouse is over a valid target. Double click the target you want and this window should update.
You’ve now selected an object as a Linked Reference (In this case an XMarker). Always make sure you’ve selected the correct object before testing.
This alone won’t do anything at all, but many scripts utilise this connection to run code on the Linked Ref.
The Xmarker is now a Linked Ref from the Box. The box has a script that does something on its Linked Ref, so the Xmarker will have something done to it. (Notice the arrow linking them)
Enable Parents
Enable Parents allow you to control whether an object is enabled or disabled using another object’s enable/disable state. This is very handy when you want to enable/disable many objects at once easily by just disabling/enabling a single object.
To set an object as an Enable Parent, double-click the object you want to follow its Enable Parent’s state, then go to this part:
Once again, I recommend ‘Select Reference in Render Window’. I set it to XMarker again.
So, now that it’s enable parent is the XMarker it will follow that XMarker’s enable state. Disable the XMarker, and the statue will follow right along it.
Linking one object at a time can be a time consuming process, especially if you have tens of objects to link. Luckily, CK has a batch window for this reason. Simply press - on your keyboard to open it:
As you can see, this window has quite a few options. To choose what objects you want to do actions on, simply select them and they’ll show up in the list to the left. (Don’t forget to hold CTRL to select multiple objects.) Then check the action you want to perform and select the Target Reference you want them to use as parent for the action, and click ‘Do’ in the bottom right corner. Some arrows should appear pointing to the parent. This means you’ve linked them successfully.
(Note: Setting “Initially Disabled” will make an object be disabled by default until enabled by something. Any “enable child” will follow its parent’s state as expected.)
(Note 2: You can set the enable state to be opposite of the parent. This just flips it over; if the parent is disabled, children will be enabled, and vice versa.)
Activate Parent
Setting up an Activate Parents work very similarly to Enable Parents, so I won’t go over it in too much detail.
Navigate to this on the object that should be activated when another object is activated. Right click the empty list and add new. Activate Ref Selection window should open, and from there you simply select the Activator Parent, with an optional activation delay.
Now when WETempActivator is activated, the box will be activated as well, and the box will run its OnActivation Event and the code within the event. In this example it disables the XMarker, and since the ash statues use that as their enable parent, they too will be disabled.
Script Properties
I won’t go too deeply into exactly what Properties are, only enough so you can use them. If you want to know more about Properties, see the CK wiki on Papyrus basics.
All you need to know is that they work kind of like “options” on the scripts for the premade scripts you most likely will use.
Properties are part of scripts that can be filled by various objects in the game. See it as a way for the script to reach out and interact with objects in the world. See for example the properties on this script.
These properties are declared inside a script that is attached to one of the gold pile misc. Object that you might have placed somewhere in the world.
The script is set up to add “amount” of the “Gold001” property when you activate it. In this instance, the “amount” property is set to 100, and “Gold001” is set to Gold001.
(Property name is set to Gold001 so you can just press Auto-Fill and CK will find the object automatically so you don’t have to scroll through a list of every single MiscObject in the game. Probably not important for you).This means that it will add 100 Gold001 when activated. But, if we’re feeling wacky, we can change Gold001 to give you another MiscObject instead.
Now you’ll get 100 Charcoals instead. Why? Because you’ve been naughty.
Properties can be set on the base Object itself, which will then inherit to all References of that Object placed in the world. You should not change properties on Object level, only on Reference level, ie. the object out in the world.
If you hover your mouse over a property or script, it will most of the time show a description of what it does and how to use it. If it doesn’t give you a non-generic description it doesn’t have one.
Premade Scripts to Use
(Will fill out later.)
If you want anything specific, DM or ping me in Coding (Thermo) and I’ll make it happen.
Example Cells
COC to these and view them in CK. (DON’T EDIT)
zz
zLand (cell shown above, will fill this out with more stuff to show how it’s set up in upcoming merges)
test (links to many different halls, not much in it alone)