Skip to content

SKSE: Getting Started

alexdunn edited this page Sep 5, 2014 · 8 revisions
  1. Download the SKSE installer and install it. This will put all of SKSE's runtime files into the right place.
  2. Download the SKSE archive. Copy all the files from the archive's Data\Scripts\Source to your computer's Skyrim\Data\Scripts\Source\ folder. This puts all of SKSE's source Papyrus files where the Papyrus compiler can find them.
  3. Download and install Microsoft Visual Studio Express 2013 for Windows Desktop (free)
  4. Download the example project, which is a minimal, yet complete Visual Studio project with everything required to build an example plugin.
  5. Open the .sln file included in the example project and right click on plugin_example in the right-hand pane -> Build. You should see at the end, "3 succeeded, 0 failed." You just built the plugin_example.dll into the project's directory: plugin_example\Debug. Now copy that .dll into your Skryim\Data\skse\plugins\ folder (You may have to create those folders).
  6. Copy the plugin_example project's plugin_example\scripts\MyPluginScript.psc into your Skyrim\Data\Scripts\Source\ folder. This file tells Papyrus about the MyTest() function that's defined in MyPlugin.cpp. Last, you'll need to compile that script so Skyrim can use it at runtime. See Papyrus: Getting Started.
  • Each time you add a function to your SKSE plugin that you want to be able to access in Papyrus, you'll have to declare that function in a .psc script like this one so that Papyrus knows it exists.

That's it! SKSE will now load your plugin the next time you start the SKSE Skyrim Loader and you can now use the MyTest() Papyrus function in any function inside any Papyrus script. First, just do an import MyPlugin at the top of your Papyrus script. Then, choose where you want to call your SKSE function, such as inside an OnActive function, and as an example:

Debug.Notification("My SKSE function returned " + MyTest())

This will return the value of the MyTest() function and display it at the top of the screen in Skyrim when your Papyrus script gets activated.

Also notice that after running Skyrim with your SKSE plugin, you'll see MyPluginScript.log appear in My Games\Skyrim\SKSE. Every call to _MESSAGE() in your plugin will output to this file.

Now it's time for you to start putting in your code. Go to the MyTest() implementation in MyPlugin.cpp. Currently, you can see the implementation does nothing more than a log output with _MESSAGE() and return 3.3. Replace this with what you want to do.

Look at the SKSE section on the Home page for tutorials in your next steps with SKSE.