![]() |
|
| Back to Home Page |
Welcome to the 3dcentral.net tutorial for Torque Ifl'sFirst off, what is an ifl??? An ifl is an animated Image File List. This list tells torque to animate a texture. Torque iterates thru a list of images and continuously replaces the images on an object at a speed you setup. Here, we are going to go thru all the steps to get you going with a working example. So what are we waiting for?? Let's get started. In this zip file, (please click to download it) are all the files and objects you will need for this example. We have: ----------------------------- textures example milkshape file example dts file ifl.cs script example.ifl file list ----------------------------- When you make your object, Just make it the same way you make any dts object, and uv map your first image to one face. This is the face that torque will use for your ifl animation. We need some images, so open your favorite photo editor and make 4 images named sequentialy.I named mine "Image1.png" to "Image4.png". You can use any format supported by torque.I prefer png. Just remember, your images Must be Power of 2 in size. You may also use the images I have supplied in the zip file. Make a copy of Image1 and rename the copy "Image1_ifl.png". We will be using this in milkshape. Next, we need an IFL list. This is a text file with .ifl as the extension. In the zip, you will find mine. Notice the naming of the images, and the extra number at the end. (the number 8) Important: Save your ifl the same as your first Image. Now, we need to do some math. Don't worry, we aren't going to do rocket science math, just simple multiplication. Remember that number at the end of the image name?? (the 8) That is the number of frames torque will show each image before moving on to the next one. We have to Know how many frames we need for the exporter, so multiply the number of frames by the number of images. ( 8 X 4 = 32 for our example) Remember this number as we need it next. Open the milkshape file in milkshape ( or import your object) and let's get cracking. The first thing we need to do is to change the Image1 texture on this object, so click on the materials tab, then click on Image1. Note the red arrow. Click the button and navigate to the Image1_ifl.png you made and click it. This won't actually change the texture, but it tells torque the name of the first image. This is a necessary step in getting IFL's to work. Once that's done, we need to open the dts_plus exporter. You will see something like this: ![]() Click the Add button next to the sequences box to see this: ![]() There are several things we need to do here. I numbered them to make things easier to understand. ![]() you want. Just make sure it's something you can remember as you will use this name later #2 Remember the math we did? The answer goes here. #3 Do we want our animation to loop? Yes, so Tick the cyclic box. #4 Tick the "enable ifl" box to tell the exporter this is an ifl ![]() Notice our new animation in the box? We have done it correctly. Click "export Dts" in the bottom right and name your object. Our object is finished, so now, we need to move a folder. Move the example folder with the textures, ifl list, and dts object to "data/scripts/shapes" then we can move on. Great!! Now we need a script to pull all this together. In the zip file, find "ifl.cs" and copy it to "server/scripts/", then open "server/scripts/game.cs and add the following: exec("./ifl.cs"); after aiPlayer.cs Don't forget the semicolon ; at the end or you will get a parse error!! That's it! All that is left to do now is to add it to our game. Get into your game, then click F11, then F4 to enter the mission editor. On the right side, expand the shapes link by clicking the + sign. Now, expand the Misc link the same way. ![]() And there, on the bottom is our ifl object. Press alt C to enter flymode and fly to a good spot to place our ifl. Click iflExample to place it. Size it, and save. Click alt c to get back into Kork and go check it out. If you did everything right, the animations will be playing. That's all there is to making an ifl. Hope this has helped you. Thankyou for visiting and I hope this has helped you. Mike (aka: Trucker2000) |