dark mode light mode Search Menu
Search

Papyrus

Mike Prosser on Flickr

While playing Skyrim a year or two ago, my teenage son showed me a mod someone created where a dancing bear magically appears in the middle of the game, no matter how dark and scary the scene. Later, he showed me a mod he had made to let him shoot 100 flaming arrows at a time, with the explosive devastation when the arrows landed. Turns out the PC version of Skyrim can be easily modified using a free Creation Kit and the Papyrus programming language.

I thought it would be interesting this month to highlight a programming language useful only in one narrow case, people playing Skyrim on a PC who want to add a little fun to the game and learn more about the internals of the Skyrim game. For example, using the Papyrus language and the Creation Kit, you can access data generated by the game as you play along.

And for those scratching their heads wondering what Skyrim is, the game is a mostly realistic environment set in the early middle ages with dragons, villages, quests, potions, good and bad people, and so on. It’s swords and sandals plus sorcery. While the start of the game involves executioners, most of the game is fun to run around the Skyrim world and get lost in the game for hours and days. Then again, I love dragons and the game is full of them. However, my son did have to rescue his older sister every time dragons appeared because they ate her or burnt her to a crisp.

What Makes Papyrus Special?

The primary value of the Papyrus language is how it teaches the way games are made. Instead of creating a game from scratch, you can modify elements of an existing game using a process and commands similar to those used to build the actual game, in this case, Skyrim. The Creation Kit is a Windows-based software tool that lets you view scenes (called cells) in one pane and use Papyrus in another pane to define behaviors for objects in your selected cell.

How is Papyrus Used?

The Papyrus language appears to be the same used to create the overall game. Your code simply uses existing code, by reference, and lets you add new functions which make objects do different things when clicked or otherwise selected. The functions are written in fairly simple syntax. For example, in their Hello World tutorial, this code is used to display “Hello World!” as text when you click an object in a cell:


Scriptname HelloWorldScript extends ObjectReference
{This is my very first script!}

Event OnActivate(ObjectReference akActionRef)
    Debug.MessageBox("Hello, World!")
endEvent

Note the word extend which includes ObjectReference by reference to its name. Then you define an event with Event and specify when the event occurs with OnActivate, when someone clicks the object in the cell, or scene. Within the event block of code, you define what happens during the event. Also note the comment which uses the brace characters { } to help you remember the purpose of your code. In the Papyrus language, a comment is called a Documentation String.

Perhaps more interesting is how code is added. The Creation Kit software uses panes and popups to define many of the details used in the code, for example, the script name. The Hello, World! tutorial linked below shows the process used to tie together code you type with a specific object and cell in the game. You click on an object in a cell which opens a Reference popup and, from there, use a set of popup windows to fill out details for what happens to the object when selected.

Of course, Skyrim mods don’t have to be serious. Someone replaced the dragon in the opening execution scene with Thomas the Tank Engine, complete with the toot toot sound and coal cars dropping from the sky to scare off the bad guys. Here’s a screen shot to spare you from watching the otherwise bloody video:

language-papyrus-thomas-tank-engine

Obviously, teenagers/adults + Skyrim + Papyrus + mods = silly fun.

Learn More

Creation Kit

http://www.creationkit.com/
https://www.youtube.com/user/BethesdaGameStudios
http://www.creationkit.com/Bethesda_Tutorial_Creation_Kit_Interface
http://www.uesp.net/wiki/Skyrim:Creation_Kit

Papyrus

http://www.creationkit.com/Category:Papyrus
http://www.creationkit.com/Bethesda_Tutorial_Papyrus_Hello_World
http://www.creationkit.com/Category:Tutorials
http://www.creationkit.com/Category:Editor_Reference
http://tesalliance.org/forums/index.php?/tutorials/category/33-esv-skyrim-modding/

Steam Workshop

http://www.creationkit.com/Introducing_the_Skyrim_Workshop
http://store.steampowered.com/
http://store.steampowered.com/about/

Skyrim Mods

http://steamcommunity.com/workshop/browse?appid=72850

Related Posts