Quantcast

Jump to content

» «
Photo

Creating Custom IFP's

45 replies to this topic
coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#1

Posted 02 March 2009 - 04:59 AM

Creating Custom IFP's
IFP is the animation format of the Grand Theft Auto series since GTA III. With GTA San Andreas there came a new version of the file format, but it still supports animations with the old version. IFP files can contain several single animations which are split up to objects and linked to the animated object or actor in that way. Each object contains a certain number of frames including a time key. Two frames are interpolated by the game.

Why create a new IFP?
Well, if you dont do it ,you will need to replace existing animations. And that sometimes is annoying for Modders, specially when creating Total Conversions. So with this tutorial you will learn how to Create your own IFP or Add new Animation slots in an existent IFP.

Wait a minute! I can add new anims to SA original IFP's?
Sure!, if you know how to create an IFP, you will know how to add new anims to an existent IFP file.


1. Reqerimients

In order to do this you will need a copy of 3D Studio MAX, in this tutorial i will use version 9. And in order to import/export Skeleton Data and Aniamtions you will need the KAM Max Scripts. To convert a Dumped IFP back to IFP you will need the TSB from GMAX scripts by KAM.

You can get a useless free 30-Trial version of 3D Studio Max from here:
http://usa.autodesk....3112&id=5659302

And you may download the KAM scripts from here:
http://www.gtaforums...howtopic=218318
Or here:
http://www.geocities...scriptslist.htm

You will need this tools too, from KAM's GMAX scripts:
http://tjbp.net/upload/TSB.zip

Note: If this is your first attempt with 3D Studio Max, i recommend you to read some tutorials in the Net to cover the basics of the program. Or read the Help and mini tutos that came with the program Itself.


2. Loading an IFP

To make your own IFP, you need another one as a Base. So, open up 3D Studio Max. Once done run the IFP IO Kam script and load a DFF model.
Select the whole model + bones and hit the "M" button in the IFP dialog box.
user posted image

Now click on Load IFP and open any IFP from gta3.img
We wont work with the "ped.ifp" as it is very big, and it will take much time in the Dumping part.
user posted image

Ok, so you loaded an IFP file. I loaded the Colt 45 animations.

Description:
Anim. File: The IFP file name.
Total Animation: Total Number of Anims inside the IFP.
Internal Name: The name the game uses to call the IFP.

And in the list you see each anim by name. You can double clcik one and it will apply the anim on your Model. You can see it by messing aournd with the Time Line buttons.
user posted image

Now you see how the anims are shown in the IFP.


3. Dumping the IFP

Now we have to "decompile" the IFP, to do so we can close the IFP IO dialog box. And we run the IFP Dump script from the Kam's Animation Panel.
user posted image

Now the Dump IFP dialog box is open, click on "Dump GTA IFP" and select the IFP we saw before. In my case the colt45.ifp.

While the Dump prossess is active you will see alot of numbers and letters flash in the bottom left of the screen, when the flashing is over and the text is static again the Dump i over.

So now press "F11" and you will see the MAX SCRIPT Listener. Select all the text there and copy it.
user posted image

Open up the Notepad and paste everything there. Now save that as you want, in my case colt45.txt


4. Editing the TXT

Now, lets see what we have done. We converted an IFP file to a TXT. So it can be read by a human beeing.
Lets try to understand it.

First off, delete the Path Line.
In my case this one:
CODE
<!-- path="C:\Documents and Settings\sonia\Escritorio\colt45.txt" -->

user posted image

Now let me explain some values:
The Header section is this part:
CODE

//
//
//This is Header Section
c 4
ANP3
i 1
25058
c 24
COLT45
i 1
7
//
//


Important Stuff:
ANP3: Animation Package 3, Version identifier. However there is no pack with ANP2.
COLT45: This is the Name the Game uses to call this IFP file. (As seen in the IFP IO as "Internal Name")
7: Total Number of Animations (As seen in the IFP IO as "Total Animmation")

You must change the name of the IFP, there cant be more than 1 with the same name. So you may call it with the name that reprsent what kind of anims you will add in there. So, in my example i will use "PARKOUR".

If you know how many anims you will add, then change the "7" with number of anims you need inside this IFP. In my case 5.

So this is it:
CODE

//
//
//This is Header Section
c 4
ANP3
i 1
25058
c 24
PARKOUR
i 1
5
//
//


Now lets move down, to the start of the first anim:
CODE

//
//Animation 2guns_crouchfire Start Here
c 24
2guns_crouchfire
i 3
26 4316 1
c 24

Thats the header of the first animation, below that you see each bone coordinates (Nothing important now).

Important Stuff:
2guns_crouchfire: Thats the name of the animation, you have to change it in the "Start here" text and below "c 24" too, must be the same name.

So, if you know what anim will go there, then just put the name of the anim. In my case it will be "BckHndSpingBTuck"

So this is the result:
CODE

//
//Animation BckHndSpingBTuck Start Here
c 24
BckHndSpingBTuck
i 3
26 4316 1
c 24



Each new anim beggings with the "Animation [Anim Name] Start Here", so its easy to see each of them. This IFP has 7 anims, and I only need 5. So i will go to the bottom of the text file and delete 2 anims.

Once done you will have 5 anims declared and 5 anims writed, so everything is ok. Remember to rename the other anims, in my case the other 4 anims are:
BckHndSping
CartWheel
FrntHndSpring
HandPlant


Note: Remember to delete all the Bones keys when deleting the unused anims!
If you want more anims than there are in the IFP, select the whole text from one anim. From the Header (The Start part) down until you reach the next animation Start (Dont include it). Copy it and paste it at the bottom until you counted the number of anism you want.
Remember to update the "Total Animations Number" in the IFP Header at the top of the TXT.


If everything is OK, you can save the changes and prepare for next step.


5. Compiling

Now its time to compile the TXT, convert it to IFP again.
You will need the TSB file.
Inside you will see an exe called "T2B.EXE", its a command prompt aplication. If you are not familiar with this kind of aplication dont worry i made a Batch file to exeucte it, you will only need to change the name of the TXT to "package.txt".

Here its the batch file:
CODE

@echo off

echo IFP Compiler by Delfi
echo Batch file created by Coin-goD
echo --------------------------------------------------
echo Compiling Package.txt in current folder.
echo Please wait...

T2B.EXE "package.txt" "package.ifp"

echo IFP File created.
echo Done.
echo --------------------------------------------------
echo.

pause

Open a Notepad paste that code and save as "Compiler.bat".

Put the compiler, the T2B.EXE and your package.txt in the same folder. Run compiler.bat and it will compile the txt.
user posted image

Now you created your own IFP file!, but wait! It still has the anims from the Colt 45 IFP.
Its time to go to the last Step to finish everything!


6. Replacing

Ok, now open up your new IFP file with IFP IO in 3D MAX. I changed the name of the IFP to Parkour.ifp
user posted image

Awesome! The Internal Name of the ifp is Parkour and the anims are listed with the new names!

But the anims are still Colt 45 ones.

So now you have to make your anims and replace them in their correct place.
What i mean is that I will make a Front Hand Spring anim, when its done i will replace the "FrntHndSrping" slot with it!

Do the same with the rest of the anims and the IFP will be ready!


Congratulations, you created you first IFP with custome anims inside!


Archives:
Download the IFP i created during this tutorial:
http://tjbp.net/upload/parkour.zip


Further Reading:
IFP FileType Description
Custom Player Animations

Thanks to:
Wesser, with out him this tuto wouldnt Exist.
Kam, Great Scripts.
  • Ezekiel_RN likes this

JostVice
  • JostVice

    realtime, not prerendered

  • Feroci Racing
  • Joined: 30 Oct 2005
  • None

#2

Posted 03 March 2009 - 04:35 PM

Pretty interesting tutorial goin, always a thing I wanted to look at but never knew where to start exactly. icon14.gif

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#3

Posted 03 March 2009 - 09:24 PM Edited by goin-god, 03 May 2010 - 02:54 AM.

Thanks Jost icon14.gif

Indeed i think this is the first thing you should know to start envolving into Animating.

Usefull information:
CODE
=================================================================
IFP file format for Grand Theft Auto San Andreas animation
 Written by Aschratt ([email protected])
=================================================================
(updated Jan 2008)

This file is based on the decodings of hollower from 2004.
For more information search GTA Forums.

Binary Structure:

====    Header    ============

4b     - CHAR[4]   - 'ANP3' (Version Identifier String)
4b     - INT32     - Offset to end of file (Relative to stream position pointer, so usually you have to add 8 to get the file's content size)
24b    - CHAR[24]  - File's Internal Name
4b     - INT32     - Number of Animations

====    Animation Info    ====

24b    - CHAR[24]  - Animation Name (!!! String stops with first null-char ('\0'). Everything after this is ignored... R* Put some debug stuff there sometimes (Like 3dsm directorys))
4b     - INT32     - Number of Objects
4b     - INT32     - ?
4b     - INT32     - ?

====    Object Info    ========

24b    - CHAR[24]  - Object Name
4b     - INT32     - ?
4b     - INT32     - Number of Frames
4b     - INT32     - ? (Frame DATA TYPE: KRT0 = 0, KR00 = 1, KRTS = 2)

====    Frame Info    =========

2b     - INT16     - ? (RX)
2b     - INT16     - ? (RY)
2b     - INT16     - ? (RZ)
2b     - INT16     - ? (RW)
2b     - INT16     - ? (TX)
2b     - INT16     - ? (TY)
2b     - INT16     - ? (TZ)
2b     - INT16     - ? (TIME)

Like nearly all new coordinate formats in SA the Animation Packages are compressed.
To get the real-world floating coordinates simply divide the short values with 128!

================================

Notes: I think that there is a constant value in the object-info section which defines
the frame's data type. This means that there are still those data-types like in ANPK.

But I am not sure about this and still have to search some examples and try a little bit
around. Mostly the frame info data type is like the root structure.

These decodings are done by scratch in an hour. I had not much time, but I hope it will
help you for further decodings.

Greetings... Aschratt!

Homepage: [URL=http://www.aschratt.com]http://www.aschratt.com[/URL]
E-Mail:   [email protected]

Freakorama
  • Freakorama

    Freako

  • The Yardies
  • Joined: 26 Sep 2006
  • Australia

#4

Posted 03 March 2009 - 09:52 PM

3ds crashes when dumping any VC .ifp's although you already knew that, coin.

If anyone can figure out a way to do it for VC i'll give you a zillion hypothetical dollars and your name in the credits in PedRising

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#5

Posted 04 March 2009 - 01:17 PM

Nice tutorial man! You added something that I didn't explained to you. tounge.gif

You can create a shortcut of t2b.exe instead of making a batch file. wink.gif

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#6

Posted 04 March 2009 - 09:42 PM

QUOTE (Wesser @ Mar 4 2009, 10:17)
Nice tutorial man! You added something that I didn't explained to you. tounge.gif

You can create a shortcut of t2b.exe instead of making a batch file. wink.gif

I used to use a shourtcut, but i like Batch instead. icon14.gif turn.gif

Francis115
  • Francis115

    Pinoy ModderZ

  • Members
  • Joined: 13 Sep 2008

#7

Posted 14 March 2009 - 11:26 AM

help please,,it always say header data not correct,,whats the problem? can u give me an example code for the package.txt?

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#8

Posted 14 March 2009 - 08:27 PM

QUOTE (Francis115 @ Mar 14 2009, 08:26)
help please,,it always say header data not correct,,whats the problem? can u give me an example code for the package.txt?

IFP Dump only works with SA i tihnk.

Francis115
  • Francis115

    Pinoy ModderZ

  • Members
  • Joined: 13 Sep 2008

#9

Posted 14 March 2009 - 10:49 PM

tnx,,i figured it out,,i got typed some wrong information,,btw i'm using sa and tnx for the tutorial! its great!

Offtopic:i request to ur thread, "my rigged stuff"

mint19079
  • mint19079

    [AS]FreeRunnerZ

  • Members
  • Joined: 08 Feb 2009

#10

Posted 07 July 2009 - 01:17 PM

my 3dmax is crash when i dump ped.ifp

its take verylong time more than15minutes and after i minimize the program it crash


help me!

drift4ever
  • drift4ever

    Mark Chump

  • Members
  • Joined: 10 May 2008

#11

Posted 23 August 2009 - 04:23 PM

so this is like a tutorial that teaches u how to make ur own animation package? but it doesnt tell u how to re-animate the character? i cant find a tutorial like that for san andreas. does any1 no where else i can find a tutorial that teaches u how to make ur own custom animations?

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci Racing
  • Joined: 19 Aug 2006
  • Unknown

#12

Posted 23 August 2009 - 06:40 PM

QUOTE (mint19079 @ Jul 7 2009, 14:17)
My 3dmax crash when I dump ped.ifp. It takes very long time, more than 15 minutes, and after I minimized the program it crashed.

It depends from the size of the file which you want to dump. If you are trying to dump a file with 200kb, that script will take a lot of time. confused.gif
QUOTE (drift4ever @ Aug 23 2009, 17:23)
Anyone know where I can find a tutorial that teaches you how to make your own custom animations?

Follow the Custom Player Animations tutorial, made by jacob. wink.gif

drift4ever
  • drift4ever

    Mark Chump

  • Members
  • Joined: 10 May 2008

#13

Posted 23 August 2009 - 09:14 PM

QUOTE (Wesser @ Aug 23 2009, 18:40)
QUOTE (mint19079 @ Jul 7 2009, 14:17)
My 3dmax crash when I dump ped.ifp. It takes very long time, more than 15 minutes, and after I minimized the program it crashed.

It depends from the size of the file which you want to dump. If you are trying to dump a file with 200kb, that script will take a lot of time. confused.gif
QUOTE (drift4ever @ Aug 23 2009, 17:23)
Anyone know where I can find a tutorial that teaches you how to make your own custom animations?

Follow the Custom Player Animations tutorial, made by jacob. wink.gif

i appreciate u trying to help, but his tutorial only works for vice city and gta III, i dont understand how to do it for san andreas cuz it completely different

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#14

Posted 23 August 2009 - 09:39 PM

Its the same in SA. Just dont use the anim viewer,

hristobg
  • hristobg

    IV Map Modder, Scholarship Edition Project Leader

  • Members
  • Joined: 01 Aug 2009

#15

Posted 27 December 2009 - 05:27 PM

Sorry for bump, but is there have a tutorial for creating your own animation for custom MODELS, not for PEDS or PLAYER...
Example: In GTA: Alien City have a lot of animations to objects.
http://www.youtube.c...player_embedded
This is animations, right ?
Sorry for my bad EN... and please ! Help me ! smile.gif

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#16

Posted 27 December 2009 - 06:53 PM

No, i dont think theres one.

hristobg
  • hristobg

    IV Map Modder, Scholarship Edition Project Leader

  • Members
  • Joined: 01 Aug 2009

#17

Posted 28 December 2009 - 04:06 PM

But why they keep "this sort of modding" in secret ?
I mean if they create a tutorial or something for applying animation to object, will be great.

And, of course, sorry for my English.

soldierman
  • soldierman

    Player Hater

  • Members
  • Joined: 17 Aug 2009

#18

Posted 03 March 2010 - 03:47 PM

can you do a video tutorial ? its alot easier to learn by seeing it

meegbone
  • meegbone

    Player Hater

  • Members
  • Joined: 12 Mar 2010

#19

Posted 12 March 2010 - 10:42 PM

can someone help me I have problems using the application T2B. I start the compiler and an error occurs because the application T2B saying :




T2B "source file" "dest file" confused.gif



Please help me. sad.gif Thanks colgate.gif

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#20

Posted 13 March 2010 - 09:28 PM

QUOTE (goin-god @ Mar 2 2009, 01:59)
5. Compiling

Now its time to compile the TXT, convert it to IFP again.
You will need the TSB file.
Inside you will see an exe called "T2B.EXE", its a command prompt aplication. If you are not familiar with this kind of aplication dont worry i made a Batch file to exeucte it, you will only need to change the name of the TXT to "package.txt".

Here its the batch file:
CODE

@echo off

echo IFP Compiler by Delfi
echo Batch file created by Coin-goD
echo --------------------------------------------------
echo Compiling Package.txt in current folder.
echo Please wait...

T2B.EXE "package.txt" "package.ifp"

echo IFP File created.
echo Done.
echo --------------------------------------------------
echo.

pause

Open a Notepad paste that code and save as "Compiler.bat".

Put the compiler, the T2B.EXE and your package.txt in the same folder. Run compiler.bat and it will compile the txt.
user posted image

Now you created your own IFP file!, but wait! It still has the anims from the Colt 45 IFP.
Its time to go to the last Step to finish everything!

This. Is what you have to do.

EduardKoeleJuck
  • EduardKoeleJuck

    Gangsta

  • Members
  • Joined: 26 Oct 2008

#21

Posted 15 March 2010 - 07:52 PM

I have a question: is it also possible to change the weapon holding animations with this?

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#22

Posted 15 March 2010 - 11:20 PM

QUOTE (EduardKoeleJuck @ Mar 15 2010, 16:52)
I have a question: is it also possible to change the weapon holding animations with this?

To do that you must make a new anim. And replace it in the weapon's IFP.

No need to make a new IFP file.

But dunno if weapons.dat lets you change the IFP file for your weapon. If it does, you could make a new IFP based on the original IFP of the weapon you wanna edit.

And then just edit the anim and names. (In both new ifp and weapons.dat)

But i never did such thing in weapons.dat

meegbone
  • meegbone

    Player Hater

  • Members
  • Joined: 12 Mar 2010

#23

Posted 06 April 2010 - 05:40 PM

thanks for the help man really worked but can you tell me how to replace year animation as you did with parkour.ifp ?
by the way cool tutorial icon14.gif alien.gif biggrin.gif

photopictures
  • photopictures

    Rat

  • BUSTED!
  • Joined: 14 Sep 2007

#24

Posted 27 April 2010 - 09:53 AM

I don't quite believe here .

hacker21
  • hacker21

    Player Hater

  • Members
  • Joined: 06 May 2010

#25

Posted 03 October 2010 - 06:43 PM

hi, plz i neeeed HELP, i add 2 animations to the RIFLE.IFP in gta3.img, but i dont know how to make it load, cuz i cant set a ket to load, can some one help me plz? ty
my email is [email protected]

speedairboy
  • speedairboy

    Player Hater

  • Members
  • Joined: 19 Aug 2010

#26

Posted 24 December 2010 - 04:41 PM

can enyone tell me how i can put an endoprhin animation in ifp anim?
please

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#27

Posted 24 December 2010 - 08:13 PM

QUOTE (speedairboy @ Dec 24 2010, 13:41)
can enyone tell me how i can put an endoprhin animation in ifp anim?
please

Read this tuto...

http://www.gtaforums...howtopic=386917

tomwolfpack
  • tomwolfpack

    Player Hater

  • Members
  • Joined: 27 Dec 2010

#28

Posted 01 January 2011 - 04:24 AM

biggrin.gif hi! heres a noobish question, i have the ifp animations for hot coffe, i have the euro second release that crashes when i try to use hot coffe mod or anything that has that mod in it, can i install the ifps with the img tool? or do i have to use sanny builder? if i can use img where do the ifps go? thanks lots hope you can help, im tiered of conversion mods crashing because they include hot coffe and my latest conversion is great, but crashes on dates... grr please help! colgate.gif colgate.gif

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007

#29

Posted 01 January 2011 - 06:28 AM

We can't give support for Hot Coffee in this forum. Sorry.

tomwolfpack
  • tomwolfpack

    Player Hater

  • Members
  • Joined: 27 Dec 2010

#30

Posted 01 January 2011 - 11:00 AM

QUOTE (goin-god @ Jan 1 2011, 06:28)
We can't give support for Hot Coffee in this forum. Sorry.

biggrin.gif ok found an old post abot the coffe sorry bout that, ill just go over what i installed in the mod and remove the coffe enabler! thanks! biggrin.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users