Game Development Community

IFL Animations

by Eric Johnson · in Artist Corner · 01/05/2005 (6:39 pm) · 41 replies

I got IFL working with the exporter...woohoo! (hehe,yeah it was a big deal for me). If anyone would like to see an example file, I'd be happy to post it here. sorry, too tired atm.
#21
02/19/2005 (10:54 am)
Follow the Shapes branch, NOT the Static Shapes branch...! to place the object from the Mission Editor.

Have the obect and it's textures located within the Shapes folder within the game structure of the demo.

pages.sbcglobal.net/rexpiscator/_uimages/gg_helpifl.jpg
This should show better what should be happening.
#22
02/19/2005 (11:01 am)
@Rex: That is what I thought, using a datablock...makes sense. But I don't understand why it worked in ShowToolPro. This is my first attempt at using IFL's and I am tring to understand what everything is doing. Thanks for the help.





just found this on another post:

PlayThread is a ShapeBase function. You need to add the model as a StaticShape, not a TSStatic.
#23
02/19/2005 (11:15 am)
Ok.. I see you picture pasted above..
I'll look it over

Ok.. I see where it goes, but I can't get it there.
that folder is not in my directory structure.

Only shapes and Interiors is there and shapes represents
static shapes I think.
#24
02/19/2005 (11:24 am)
Richard, it won't appear under Shapes folder, UNTIL you reference the shape and it's path via a script. I included the datablock for the IFL name[and it's path] in my destructableItems.cs script[I had to create this myself and exe it via another scirpt, ;)]....I had to create this datablock myself. There is no StaticShapes asset folder, it's a virtural construct of the engine I believe, allowing you to place itelms needing far less data management, while utilizing the same asset pool. Hope that made sense.

Put the art/texture inside the Shapes folder in the dataTree....and then reference the path to the shape in a script. If you're using the Demo.exe....I might suggest putting the datablock in the item.cs script, at the top, just after the Global Variables and before any methods....
#25
02/19/2005 (11:26 am)
Ok.. ummmmmm
it does appear in the static shapes tree after copying it to the shapes folder.
how do you include that datablck into destructableItems.cs?
can you paste a copy of it?
#26
02/19/2005 (11:36 am)
datablock StaticShapeData(IFL : Item)// edited from Item to StaticShape Data to stop rotation
{
   category = "Items";
   shapeFile = "~/data/shapes/ifltest.dts";
   maxDamage = 0.5;            //   maxDamage = 1;
   destroyedLevel = 0.5;       //   destroyedLevel = 1;
   disabledLevel = 0.25;
   renderWhenDestroyed = true;
//   debrisShapeName = "~/data/shapes/glass/shard.dts"; // Add shape
//   debris = GlassTubeDebris;                          // Link to debris data
};

copy this and paste it at line32 of item.cs of the demo. Delete item.cs.dso, then retry the whole process. If done correctly, the IFL should appear under Shapes/Items in the data tree....backing up the original item.cs.
#27
02/19/2005 (11:52 am)
Ok.. created the datablock in the item.cs and deleted the item.cs.dso.
notice that the ifltest appears under the static shapes tree structure
and not the shapes however.

how do i paste a screenshot here? I'll show you what I have.
The click here to learn how doesn't help.
#28
02/19/2005 (12:16 pm)
You have to upload the image to a hosting location....then reference them here, in the post. Kinda like what we're doing inside the engine. I just did this to my copy of demo1.3. It appears under Items, and I can place it. For some reason, the texture isn't making it...but I'm sure it's something simple. And it was; I didn't include the test.IFL file.....the text listing of the frames to play. Works fine now in the demo build. These things can usually be traced to bad paths....or syntax errors...bad code. It's working right now on my other machine....

pages.sbcglobal.net/rexpiscator/_uimages/gg_helpiflB.jpg
#29
02/19/2005 (12:19 pm)
Thought I would have to to that.

ya.. just copy all the textures to the directory in windows explorer.
I'll try to come up with a host and get a screen posted of what I have.
#30
02/19/2005 (12:23 pm)
I did a simple datablock and it is in the shapes/data tree. I type the playThread command in the console and it animates. What I was wondering was how do you script it to run the ifl. It does nothing until I run the console command. What command do you have to use to make it work in the script?
#31
02/19/2005 (12:28 pm)
@Richard: you have to go into the game.cs and add:

exec("./ifltest.cs"); <-------or whatever you called it

to it. Then it will show up in the shape/data tree.
#32
02/19/2005 (12:32 pm)
You would have to script a method[function] of the item in question; that would in turn, activate the playThread method. Richard will need to create an entire script named, 'ifltest.cs' if he wants the abov to work. I had him include it inside the item.cs script. Either will work, just keeping the paths and scripting straight, ;). Glad you got it working, Mark.

Basic Scripting

this will help better than IM chatting via Thread...;)

Scripting Tutorials
#33
02/19/2005 (12:34 pm)
Ok.. doesn't seem like it's gonna be as easy as
I had hoped.. i'm goin to my 3D Game Programming
book and startin from scratch on this subject.

Thanks everyone for your efforts..

Note: I may return to this thread after I've done
the tutorials in that book.
#34
02/19/2005 (12:44 pm)
@Richard: I went here. Download the "tutorial.base" and the "Shapes and Basic Collision" files. Just add your files to the data/shapes folder and in the superbomb.cs, change the file in the datablock shapefile to equal the ifltest.dts file. This is a quick way to get it in and see it work with the console command.


If you want the thing to stop spinning....change the "datablock ItemData( SuperBomb )" to "datablock StaticShapeData( SuperBomb )"
#35
02/19/2005 (12:48 pm)
Ok.. i'll try that thanks
#36
02/19/2005 (12:48 pm)
Thanks, Mark, about the spinning...forgot. Follow the links I gave for scripting tutorials, they'll demonstrate how to get the IFL working as a collision activated object...;). Apply small amounts of interpolation...
#37
02/19/2005 (1:17 pm)
I got it to work! Here is the script I modified to make it work:

ifltest.cs

//-----------------------------------------------------------------------------
// Datablocks are special objects that are used to transmit static data from
// server to client. Datablocks are declared as followed:
//
//	datablock datablock_class (datablock_name)
//	{
//		field1 = value;
//	};
//
// Here's the datablock for our new Super Bomb power-up...
//
//-----------------------------------------------------------------------------
datablock StaticShapeData( ifltest )
{
    // The mission editor uses the "category" variable to organize this new
    // item under the "shapes" root category.
    category = "ifltest";

    // Next, we'll tell the mission editor where to find the .dts shape file
	// that defines our Super Bomb's geometry.
    shapeFile = "~/data/shapes/ifltest/ifltest.dts";

};

function ifltest::onAdd(%this,%obj)
{
         %obj.playThread(0,"test");
}

sever/scripts.... in the "function onServerCreated()" add

exec("./ifltest.cs");
#38
02/19/2005 (5:57 pm)
This is a great thread,

I will return to it when I get more information and
practice with animation.
#39
02/19/2005 (6:39 pm)
Can you start and stop the animation with a press and release of a key stroke? Like a tire on a car.
#40
02/19/2005 (9:19 pm)
Probably; follow the interact key tutorial and the others I linked to. With a small bit of intuition, you could easily get something like that going...but I would think this thread closed, as the issue of a IFL shape working is solved. Scripting questions have their own section; MODS...;). Scripting Q/A might be better there. Glad you got it all solve, Mark. Modeling in gS is tricky, and setting up shapes correctly for export can be difficult; not having done it beforehand is the hardest part of the curve. It's over now!....let the scripting begin, :). Good Luck.