Creating Objects for ffilmation

Adding objects to a scene is very similar to the process for adding a character. According to the documentation the only difference is that objects are static, and they require less memory resources from the engine to exist on the stage.

You can use any method to create the graphics that make up an object. I used a prop in Poser and set it to an angle that I hoped would fit in my layout. You can create multiple angles using the same method as with characters. Keep the pixel dimensions of the object bitmap as small as possible – I keep a high-res version and make smaller copies from it. Make sure to set the export properties so that ActionScript can find it:

You can store multiple objects in a single fla/swf. I approach them as any shared library – you can organize libraries by project, theme or other principle that meets your project’s requirements. They don’t have to be placed on the stage as I’ve done either.

Create a definition file for your library to enable ffilmation to utilize it. The name should be the same as the swf name, only with an .xml extension. Here is a sample:

<?xml version="1.0" encoding="utf-8" ?>
<media src="../media/medicalProps.swf"/>
 <objectDefinition name="LabTube">

 <sprite angle="0" src="LabTube"/>

 <box width="116" depth="70" height="200"/>

 <shadow type="sprite"/>



Then you must add the library swf and object definition to your scene definition file.

In the head section add this:

<definitions src="../definitions/medicalProps.xml"/>

In the body section:

<object id="labTube" definition="LabTube" x="422" y="224" z="0" orientation="0"/>

You will probably need to experiment with a few details of your object: the location of the origin in the MovieClip and the collision area shape and dimensions. If you see light between the bottom-most parts of your object and/or weird Z-sorting, the origin is probably too high. I set mine near the bottom and center. I start the collision shape and dimensions that match as closely to my bitmap pixel dimensions and then test with a character in the game.

If you use png format when importing bitmaps your game will look better in low quality, since the quality setting will not effect their display, unlike shapes. Compare the gurney to the vacuum chamber in the screenshot. Also notice the built-in support for transparency in the object and the shadows, and Z-sorting.

You may also like...

3 Responses

  1. 3xl says:

    I’m trying to insert in the scene a set of building, but I have som problem wher I set the bounding box for the collision. I’m sure that the problem is in the swf file because I’ve no idea how place the graphinc over the registration point.
    Can you help me?

    • Collisions and registration of the image in a MovieClip are closely related. Some object require some tweaking to get the values just right. I start by inputting values for bounding box that are based on the pixel dimensions of the clip. I split clip width into depth and width values and use the height as-is. Move the bitmap inside the clip to register it- it will start out with registration point in upper Left, which is always wrong. Move the bitmap so that the registration mark is near the bottom center of the object. If the object is assymetrical you may need to move it to one side.

      I test registration first: set up a scene that contains the new object. Open FFilmation Editor and put the object under a light. Make sure shadows touch the lowest part of object.

      To test collisions: Walking Poncho or other character around the object.

      I hope this helps.

  2. 3xl says:

    I’ll follow your suggestions as soon as possible 😉
    Thanks for your anwer.

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha loading...

This site uses Akismet to reduce spam. Learn how your comment data is processed.