PyPRP:Getting Started

Revision as of 04:40, 7 September 2013 by Lyrositor (Talk | contribs)

Disambig gray.png

This is a tutorial page.Versions available: PyPRP; 3ds Max; Korman.

The aim of this tutorial is to serve as an introduction to the way PyPRP works by helping you build a sample functional Age.

Alternatively, you can follow this video tutorial, presented during Mysterium 2008 live. The resulting Age file is available for download here.

Note: this tutorial was written a long time ago; a great deal of this information might no longer be applicable, as PyPRP and Blender have both changed considerably over the years.


You must have read the following tutorials:

Additionally, you'll need Blender 2.49b as this is the only working version for the latest plugin; this tutorial was originally written for Blender 2.45, so some sections might require slightly different approaches today. You'll also need the Offline KI to view your Age.

Setting Up

Building an Age is a complex task; as such, you'd better make sure that you are well set up for the task.

Preparing Blender

Dummy avatar
This tutorial will assume that your screen looks something like this, where 1 represents a 3D view, 2 a text editor, 3 a scripts window, and 4 a buttons window. Make sure you delete the cube loaded into Blender by default.

You'll also want a reference object for scale in your Age. The unit used in Blender is the standard US Foot. So 1 unit on the grid in Blender = 1 foot in Uru (1 foot = 30.5 centimeters). As a reference, the male avatar in Uru is 6 feet high (1.80 meters) and 2 feet large (60 cm). You can easily see the scale in Blender with the grid in the 3D views. Creating a simple object with these dimensions, such as a cylinder, can be useful for reference, and you are advised to do so now. Alternatively, you can use this dummy avatar model (pictured to the right), which you can import through File -> Append or Link, navigating to the avatar.blend file, clicking on Object and finally on the DummyAvatar Object.

Adding A Book

Your default book file.
Each needs certain information to describe the basics of how it operates. In PyPRP and Blender, this information is stored in a text file (a text file that is stored internally in Blender, to be precise). This is done by adding a Book with PyPRP:
  1. Go to the Scripts Window, and press Scripts -> Add -> PyPRP. Now select "Add Book" from the popup menu. This creates a default Book file.
  2. In the text window, press the button with two arrows and select "Book" from the unveiled pop-up menu. This will display the default properties and values (as pictured to the right). Most of these are not important right now, but two are of special importance:
    • age.sequenceprefix: each Age for Uru has its own unique id number called the sequence prefix. There can't be two Ages on an Uru installation sharing the same sequence prefix, otherwise Uru will just crash. You'll need to change the value for testing and distribution; to make sure your sequence prefix is unique, visit the Uru:CC Sequence Prefixes list and reserve your own number.
    • age.pages: this is a list of page descriptions, each item being prepended by a dash sign and consists of at least two properties: the index, which is the number of the page, and the name, which is the name of the page. These pages are used to logically separate the content of Uru Ages, with different names. For this example, one page called mainRoom will be sufficient.

Note for future reference that the Book file's syntax follows the same structure as AlcScript, a scripting language for your Ages.

Setting Fog Settings

Your .fni file.
Fog settings are defined in .fni files. Since the default values might not be to your taste, you should specify your own values in it. Since when you created your Book file, an .fni was also automatically created, you can open it up by selecting "init" from the text editor dropdown. The file is pictured to the left.

Scripting With AlcScript

When you created your Book, you also created an empty AlcScript file which is useful to add various advanced features to your Age. For now, you can leave it empty.


It is of course assumed in this tutorial (as with all other tutorials on this wiki) that you are proficient with basic Blender modelling and usage.

The terrain created for this Age will be a simple island. Use the dummy avatar as a reference from hereon. Make sure you delete it before final export (unless dummies are an integral part of your Age). If you want to keep the avatar, a workaround can be to assign it the "Region" type. To do so, select your dummy, click on the "Add Property" button in the logic panel (F4 to reveal it), then change the type to String, the name to "type" and the value to "region", to obtain this setting.

Now for the actual modelling:

  1. Your island in the beginning.
    Try to obtain something similar to the object to the right. For your information, this terrain was created in a few minutes by using a NURBS surface to edit the outline before converting it to a mesh. The terrain was rounded off using two layers of subsurf and a decimator (which are both modifiers that can be applied in the edit panel).
  2. To add physical collisions to your island, go to the Buttons window and select the logic button. You will see a button called Bounds. Pressing it will reveal another button next to it titled Box, as seen here. As it is, however, it is useless, as the collision mesh is the bounding box. Click Box to reveal four choices:
    • Box: uses the object's bounding box (the smallest box that still encompasses the entire object).
    • Sphere: uses the object's bounding sphere (the smallest sphere that still encompasses the entire object). In our case, the same problem as for the box applies.
    • Convex Hull Polytope: uses the objects Convex Hull (the surface you would get if you were able to wrap it in shrinking foil). In our case, since the surface has a valley, it wouldn't be represented accurately by a convex hull, which would fill it up.
    • Static Trianglemesh: copies the faces from the visible object to the physical mesh. In our case, this is exactly what is needed. Click on this option.
  3. If you were to link now, you would see something like this: the Age looks completely flat because there is no sunlight, and thus no shadows. Add a sun and rotate it like so. Select the sun while holding Shift, then select the island, and finally press Ctrl-T. This will ensure your sun is tracking your island and always pointing towards its center, no matter its location. For future reference, when adding lights with ray shadow enabled, take care to keep the dist value below 100 or so, to prevent clipping or vanishing of shadows.
  4. Finally, before being able to link to your Age, you need to add a Linking Point to your Age. Each Age must have at least one called LinkInPointDefault (which is the default point linked to). To place this link-in point, click on a location slightly above the place where you want the player to link to. Then click on Scripts -> Add -> PyPRP -> Create a New SpawnPoint. This will add a spawn point on layer 2 of your Age. You can move it to layer 1 by holding Shift and pressing the buttons for the layer of your choice. If you have it in layer 1 now, it should look something like this. It will automatically be named appropriately.

You can now export your Age for the first time. Save your file as a Tutorial.blend file under your Uru dat folder, then under File -> Export -> PyPRP select Generate Release (.age) and name it Tutorial.age, before clicking on "Export final .age". All files (.age, .prp, .fni and .sum) will be generated in the same folder as your Tutorial.blend file, which means you won't have to copy any files over your computer for now.

Your Age as it should look like right now.
You need the Offline KI to access your Age now. It will automatically find your Age when you start Uru and add it to the "Restoration Links" section in the Nexus. To get there quickly, you can just type /link agefilename. Right now, your Age will look like the screenshot to the left, since it hasn't been textured yet. This is the next step.


Under construction.

Adding Atmosphere

Under construction.

Adding Sounds

Under construction.

Adding Objects

Under construction.

Final Result

Under construction.