beanz Magazine

Papyrus

Mike Prosser on Flickr

This language lets you modify the Skyrim game to learn game coding plus have fun adding objects and functionality to the game.

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

Also In The October 2014 Issue

Andrew Mills Talks about Bits & Bytes and How to Design Games

Andrew created Bits & Bytes, a fun card game to teach kids computing skills: logic, problem solving, and critical thinking.

Tim Kropp Talks About Creating Games for Kids

Tim describes how he created his game company, Glide Games, and with his young son created two video games, Elevator Adventures and Subway Adventures.

Lo Shu Magic Squares Puzzle

A 4,000 year old Chinese magic squares puzzle is both fun and a way to learn basic problem solving skills. Plus turtles.

History of Video Games

Can you name the first video game? The first game likely was Tennis for Two in 1958 but it could be Space Wars! in 1962 or other games. It's complicated.

Playing Harvest Moon in Japanese

The story of an English-speaking person learning a little Japanese by playing the latest Harvest Moon game, Connect to a New World, in original Japanese.

Wendy Norman and Skype in the classroom

Wendy Norman, the Director of Social Good at Microsoft, talks about the history and features of the Skype in the classroom service for teachers.

Game Play

You can use the concepts of game play to turn almost any task or information into a game. Assuming you can define game play.

Maker Faire NY 2014

The Greatest Show and Tell on Earth turned out to be tons of fun for kids and parents, plus a place to wander and find new technology. Links and video.

We need storytelling. Otherwise, life just goes on and on like the number Pi.

October 2014 Learn More Links

Links from the bottom of all the October 2014 articles, collected in one place for you to print, share, or bookmark.

Papyrus

This language lets you modify the Skyrim game to learn game coding plus have fun adding objects and functionality to the game.

October 2014 News Wire

Interesting stories about computer science, software programming, and technology for the month of September 2014.

Unity, PyGame, GamePress

Three game creation software tools you can use to create games. Includes a brief description and lots of links to these and other game creation tools.