Author Topic: IFL textures  (Read 2462 times)

Has any one successfully created IFL animations in Blockland except Badspot? I'm looking into using IFL's in a small idea project for Blockland I want to know if anyone has actually gotten them working and cares to share. I'd Appreciate it, thanks.

For stupid people like me, could you explain exactly what those are?

For stupid people like me, could you explain exactly what those are?
If you don't know you're not helping. IFL, like GIF's but in Torque. Thats the most basic understandable way of explaining it.

Huh, so that's what an IFL is. This explains a lot.
CityRPG's GUI has IFLs in it but I never really quite understood what they were.

In the Stats GUI, there is an animated object like the one in the Options GUI where you play dress-up. In order to set the face or chest decal, you need to use this:

Code: [Select]
CRPG_Avatar.setIflFrame(CRPG_Avatar.dynamicObject, "face", getIflFrame("face", $Pref::Avatar::FaceName));
CRPG_Avatar.setIflFrame(CRPG_Avatar.dynamicObject, "decal", getIflFrame("decal", CRPG_Avatar.decal));
(CRPG_Avatar is the GuiObjectView. CRPG_Avatar.dynamicObject is the embedded dynamic object.)

This diddy gets the line of the IFL file specified where %name appears.
Code: [Select]
function getIflFrame(%node, %name)
{
%file = "base/data/shapes/player/" @ %node @ ".ifl";

if(isFile(%file))
{
%name = stripTrailingSpaces(fileBase(%name));

if(%name !$= "")
{
%fo = new FileObject() {};
%fo.openForRead(%file);

%hasFound = false;
%lineNum = 0;

while(!%fo.isEOF())
{
%line = %fo.readLine();
%thisDecal = stripTrailingSpaces(fileBase(%line));

if(%thisDecal $= %name)
{
%hasFound = true;
break;
}
else
{
%lineNum++;
}
}

%fo.close();
%fo.delete();

if(%hasFound)
{
return %lineNum;
}
else
{
return 0;
}
}
else
{
return 0;
}
}
else
{
echo("\c2getIflFrame(\"" @ %node @ "\", \"" @ %name @ "\") : You did not supply a proper IFL file name to read from.");
return 0;
}
}


The IFL file is a composite of file paths to all default and add-on decals.
Code: [Select]
base/data/shapes/player/decals/AAA-None.png
Add-Ons/Decal_Zombies/ZAPT-Witch.png
Add-Ons/Decal_Zombies/ZAPT-Suit.png
Add-Ons/Decal_Zombies/ZAPT-StoClerk.png
Add-Ons/Decal_Zombies/ZAPT-MallCop.png
Add-Ons/Decal_Zombies/ZAPT-Bowling.png
Add-Ons/Decal_Zombies/ZAPT-BillyMays.png
Add-Ons/Decal_Zombies/ZAPT-Basketball.png
Add-Ons/Decal_WORM/worm_engineer.png
Add-Ons/Decal_WORM/worm-sweater.png

So if I
Code: [Select]
echo(getIflFrame("decal", "Add-Ons/Decal_Zombies/ZAPT-Witch.png"));
It prints this
Code: [Select]
1

What this says to me is that IFL files are not actual animations but a collection of single frames. This means the player's face and decal is actually a single frame in a still animation.


Beyond that, beats me. I can't model so I don't know anything about the process. Perhaps try referencing an IFL file instead of a PNG file for a texture, and then set the IFL file up properly. That may work.

If you don't know you're not helping. IFL, like GIF's but in Torque. Thats the most basic understandable way of explaining it.
I am quite aware that I wasn't helping.

But that makes sense. Look at how Badspot made the "Ghosting" IFL. He ran a bunch of static images one after another.

Torque doesn't really like fast moving image uploads however, so keep the animation somewhat primitive, to avoid headache.


Again, I may or may not be helping. If I am not, don't say anything.

But that makes sense. Look at how Badspot made the "Ghosting" IFL. He ran a bunch of static images one after another.
That is not an IFL, that would be a GUI element.

If you don't know you're not helping. IFL, like GIF's but in Torque. Thats the most basic understandable way of explaining it.
forget, no wonder a .gif u/v map didnt work.

I dont see how we can use gifs for emitters (which are just a bunch of always-face-camera meshes) but not for a .dts, that's just a pointless complication of stuff.