DTS/LightWave/Creating IFL’s (Image File Lists) using Lightwave
From TDN
|
[edit] What is an IFL?IFL stands for Image File Lists; basically it is sequence of images that is played to animate a texture of an object. Think of an IFL as a flip book of sorts, you hold the flip book and flip, through the images in the book, creating a sequence of animation or movement of the little stick guys drawn on it.
[edit] Resources prerequisitesFirst and foremost, what your going to need is two (2) things, a sequence of images to use that you have created with sequential naming (IE: Image01, Image02 and so on..) And an object in .LWO form to apply this technique to. [edit] The imagesYou can create the images necessary in anyway you know how, keeping in mind that each image WILL be loaded into the engine and take up memory. With that in mind I suggest you keep your eye on file size, dimensions and compression type, you should use all you know about optimizing images for use in videogames. You can use just about any type of animation software that you have access to, some to consider:
My personal favorite is flash. Flash has a nice feature that you can export each frame as a separate image file, creating a set in sequential order. My suggestion ,is to spit out .bmp’s and then compress/convert each image to its final size and type, as flash has some really harsh compression and conversion properties that you don’t really have a lot of control over. Now, if you don’t have that handy, or you don’t want to take the time to make one just yet, since I am a nice guy you can just use the images in the zip below. Media:IFL_Tutorial_Images.zip [edit] The ObjectNow, I am assuming that you know how to model using Lightwave, and you have an understanding of making objects for use in the Torque Game Engine. What you need is a simple object with a surface that you wish to apply this technique to. And again, since I am a nice guy, you will find a fully modeled .LWO, complete with UV ready to apply the image set I gave you above to. [edit] The Process ExplainedThe first thing you’re going to want to do is to make a new folder in your mod directory (most likely “Starter.fpsâ€) under the shapes folder. Move all the images in the above zip file to that folder. This is the folder we will be using for this object. [edit] Modeler
![]() Now here is where you can see what makes this surface different than others, and the exporter will know this. As you may have guessed, click the option “This is an IFL (animated) textureâ€, click continue. ![]() Now, that is only part one of telling the exporter about this animation. Save your object and ship it over to layout. [edit] Sending it to layoutFor the new users, or the first time users of Lightwave, Lightwave comes in two parts, modeler, and layout. This is a really handy feature because it keeps your modeling options and rendering options separate. In the upper right-hand side you will find a small down arrow, use this (after you have saved your model) to send it to layout. And don’t worry, the changes you make in modeler or in layout, will update real-time in layout or modeler (or you can synchronize the two).And in layout and modeler you will still have access to the surface editor and properties.
[edit] LayoutOnce in layout go ahead and click on the “Utilities†tab, then click on master plug-ins, and then click on “add layout or scene mangerâ€, under that drop down, select “Torque DTS exporter†. (You should have this already installed). [edit] Putting the “List†in “Image File Listâ€[edit] The .IFL fileNow, Torque uses a technique of animating textures like a flip book called IFL. There is a file you need to create that tells the engine what images to use, and in what order to use them. The file is just a text file with the extinction .ifl. Simple a? Below are the contents of the .ifl file for this object. Notice that in it, it lists every image in the set (1-20). gem10001 1 gem10002 1 gem10003 1 gem10004 1 gem10005 1 gem10006 1 gem10007 1 gem10008 1 gem10009 1 gem10010 1 gem10011 1 gem10012 1 gem10013 1 gem10014 1 gem10015 1 gem10016 1 gem10017 1 gem10018 1 gem10019 1 gem10020 1
[edit] Making it all GO!You’re still not done. In order for the object to animate it needs some form of trigger to start the sequence, this is in the form of a script, this script can be activated anyway you wish, either a console command or set to a timer. (Take a look at the scripting section of the TDN to help you control the on and off of the animation to suit your needs.)
//---------------------------------------------------------------------------------------//
// IFL (Image File List) //
// //
// This script sets up all the IFL animations. //
// sets it up so that when the object is placed in the world (or ::onadd) //
// the animated textures are played. //
// //
// *******Current list of items using IFL's******* //
// //
// //
// 1."IFL_Tutorial_object" = This is a mound of crystals //
//---------------------------------------------------------------------------------------//
// The Crystials Structure
datablock StaticShapeData(IFL_Tutorial_object)
{
// The category variable determines where the item
// shows up in the mission editor's creator tree.
category = "Misc";
shapeFile = "~/data/shapes/Crystals/IFL_Tutorial_object.dts"; //Location of the .DTS
};
function IFL_Tutorial_object::onAdd(%this,%obj)
{
%obj.playThread(0, "shine"); // The animation to play
}
function StaticShapeData::create(%block)
{
%obj = new StaticShape()
{
dataBlock = %block;
};
return(%obj);
}
|
Other uses for IFL's
To be added.













