Making Sprites

Disambig gray.png

This is a tutorial page.
 

Making sprites requires two parts. The first is properly orienting the sprite. The second is setting the sprite's flags properly. Once you understand it, though, it's quite simple.


Modeling

You can perform the following steps in whatever way is most comfortable to you. I suggest using some keyboard commands to simplify the process which I will detail as they come up.

The first thing to do is to create the flat plane your sprite will go onto. Go into top-down view (press the Numpad 7 key with Num Lock on), press the spacebar and go to Add, Mesh, Plane. This creates a flat plane with its visible face (referred from now on as its "normal") facing straight up.

Next, go into edit mode (by pressing Tab) and go to a side view (1 or 3 on the num pad as before) and put yourself in Local mode (change this by finding the word "Global" and clicking it. A small menu will pop up from which you can select Local). When you're done making the sprite, remember to change this back to Global. In Local, make sure the plane is selected and then rotate the plane so its normal faces directly down (a way to do this is to type: "r x 180" This rotates the plane on the x axis by 180 degrees). It's visible face should now be pointing directly away from the blue arrow. Next, move the plane very slightly down (while still in Local mode). (a way to do this is to type: "g z -0.02" This moves it down by two hundredths of a blender unit)

With all this done, your sprite's model should be complete (note: some tutorials require you to rotate the plane so its y axis is facing straight up. I've never needed to do this, however).


Flags

The Flags tell the plugin what type of sprite to use. First, go to the Logic panel with your sprite model selected. Press "Add Property" and change the first portion from a "Float" to a "string". In the second box, type the word "type". In the third box, type the word "sprite".

Next, add another property and change it to a string value in the first box just as you did before. In the second box, type "sprite_flags". In the third box, type the combination of flags that you want to use. For a typical sprite (lamps flares), the flag: 00000821 will work fine. If you want to experiment with other types, a list of flag values follows courtesy of the Alcugs tutorial:

00000800 - Object has Bounding Box associated (not sure why it is necessary)

00000020 - Needs to be on ALWAYS if off, the VFM won't work

00000010 - Adds some kind of matrix transformation, no difference perceived to viewer as of yet

00000008 - Select mode 4 (Strange Mode)

00000004 - Select mode 3 (Imager Mode)

00000002 - Select mode 2 (Normal Mode)

00000001 - Select mode 1 (Swivel Mode)


Mode 1 - Swivel mode (default export mode)

In Swivel mode, the sprite always faces the camera fully.

Additionally, it will add a sort of "swivel" rotation along the local Z axis of the sprite.

This depends on your camera's angle towards the original origin of the sprite. If your angle on the XZ plane is 0 degrees (equal to the negative Z axis), it will be standing up (not rotation) If th angle is 90 or -90 degrees, the image will be rotated by the same amount. The images rotation varies non-linear though. At small camera angle changes near 0 degrees, the image will wildly rotate, but with relatively large camera angle changes around 90 degrees, the image will rotate pretty slowly. That's why I call it "swivel mode".

Swivel mode is very well suited for lamp glares!


Mode 2 - Normal mode

In Normal mode, the sprite always fully faces the camera, but will not rotate around the Z axis.

To be more precise, the Y-negative axis will always point at the bottom center of your screen. This is only apparent at very close distances though.


Mode 3 - Imager mode

In Imager mode, the sprite rotates along the Y axis only. The sprite will always face the camera, but it's Y axis will always point into the same direction.

This is the mode that is used with the Ayoheek table in the Neighbourhood, and with the imager in the Watcher's Pub (Rolep). It creates a nice holographic feel, while still visible from all angles.


Mode 4 - Strange mode

In Strange mode, the sprite will always fully face the camera.

Additionally there is a strange rotation around the sprites Z axis. The image will rotate once, for every time the camera makes a full turn around the sprite.

This is probably useful if you want a more linear Z-Rotation than you have in swivel mode.

Easy Sprite Texture

Chances are that you will be using a sprite for a lamp glare. So you will need to make a texture with a good gradient from opaque to transparent. However, for the lazy among us (including yours truly) there is an easier method. We will use one of Blender's internal texture types to create a glare.

Go to Texture buttons (F6) and under Texture Type choose Blend instead of Image. Then set it to Halo.

Blend-halo.png


Go back to the Material buttons and under Map To deselect Col and select Alpha. Now set the alpha value of your material to something less than one.

Mapto-alpha.png


In addition you may also have to turn ZTransp on. Finally make sure that Map Input is set to UV (which in fact you should always do when you are working with PyPRP).

That's it. You should now have a perfect lamp glare.