Pages

Tuesday, June 24, 2014

[TUT] IV Custom Anims from first step to last step

In this tutorial i will show how you create a very basic character animation for GTA IV, since the software required, the installation of plugins up to the animation creation and import into game. The animation made will be very basic just to show the method, learn how to make good anims is up to you ;)

For a video showing the basic steps after having all the setup done, click here.
For a more advanced tutorial check this link.

What you need for this tutorial:

OpenIV - To import/export anims (mirror)
3DS Max 2013 (may work with 2012 too) - The base to create/edit the anims
OFIO plugin - To export anim to GTA IV (mirror)
Andrew's OAD Exporter plugin - To export anim to GTA IV too (but mainly use the biped that comes with it that makes easier create/edit anims) (mirror)
GTA IV Char. Rig by H1Vltg3 - To create/edit anims too (mirror)

1 - Basic setup

First of all install 3DS Max.
Then install the plugins (OFIO and Andrew's OAD Exporter) - Drag the scripts folder of each plugin to the 3DS Max folder



2 - First basic anim using the Biped from Andrew's OAD Exporter

In the Andrew's OAD Exporter folder you will find the file called biped_gta4.max, open it with 3DS Max and you will have this screen:

d00b5cd8fd.png (1696×1026)

Now the idea is move/rotate the Bones to position and make the animation keys. First let's enable the AutoKey option, this will make that each change we made in determined time lapse will generate a animation key for that bone(s) in that time position, this is what makes movements happen:

*It should become Red when enabled.

Now let's say that i want make the ped perform a short leg movement, what we need to do basically is set Keys in the animation for each step of the move.

First of all i will set the initial Key that will define where each bone should start in the animation, to do this i will position the Time Slider in first frame and then Move the bones that i plan to animate to generate a key for them, in this case i will select this bone (Char_R_Calf):


For each step i will have a Key in the animation, so, let me position the time slider control in a time position where i imagine that is good enough for the first step that is move the leg up, the frame 15 seems good for this move:


Now if you move the Time Slider from frame 0 to 15 you should see the movement.

Based on this idea of animation key frames and bones position/rotation we can create some cool anims.

3 - Exporting the Biped anim and importing into a "gta iv exportable" project

To export a animation made with a Biped we do the following:

3.1.1 - In the main menu icon click in Export:


3.1.2 - Select a folder and set a name for the exported file:


3.1.3 - In the next window click in "Edit" then in "Edit Preset":


3.1.4 - Expand the Tree view ("Include" and "Animation") and make sure that Animation is marked, then click Ok to export:


A .FBX file should be created, a warning window may appear but you can ignore it (i hope ^^).

3.2 - Now let's import this anim into a project where we can export to GTA IV. I will show how you do this using OFIO plugin, first step is open that Char. Rig made by H1Vltg3 with 3DS Max:


Now go to same menu where you Exported the anim but this time click in Import and select that .fbx file:


In the next window you need to expand the Tree view until reach Include > File Content and then select "Update animation", then click Ok:

Move the time slider and you will see that the char moves like in the Biped anim. Now before export its interesting increase the number of frames to avoid "shaking bug" in the animation in game/in openiv. To do this click in the Time Configuration button:


In the next window mark Custom and set a bigger number, i use 200 for my anims:


Tip: In this same window you can increase/decrease the number of frames of the entire anim (Length), you also can re-scale the time making the anim play faster or slower (Re-scale Time).

Tip: You can create/edit keyframes in this project too, just follow same idea of setting time slider position and rotating bones (don't move them with Move tool because it will generate "not good" results ^^).

4 - Exporting the anim to openFormats (OpenIV)

Now that we have our anim completed we can export it to GTA IV and see how it will look using OpenIV or the game + script/trainer.

First step is select the Char helper, a easy way to do this is using the "Select by Name" feature:



Now that we have the Char selected we can use the OFIO export clicking in Export Skel:


In the next window select a folder to save the file and click Ok, 3DS Max may ask you for optimize the animation, i always answer "Yes" ^^

After export succeed you will see this screen:


And a file called head_000_r.onim will be generated in the selected folder:


5 - Importing the anim into game using OpenIV

Now we can create a .OAD file to be able to import this anim to the game using OpenIV, first let me rename the animation to sample1.onim and create a .OAD file using notepad, this is what the .oad file will have inside:


As you can see it basically refers where are the animation files, in this case it will be in same folder of the .oad file.

You can download this .oad file here or create it with Notepad saving as .oad extension (All files filter).

Now using OpenIV we will open the anim.img and enable the edit mode:


Now we right click a empty space and click in Import openFormats:


Now we select the file and click Ok and Ok again in the next window, if all is ok we should see the sample_anim.wad in the anims list. Now click in "Open animation viewer" and search for you anim:




Done!

Tip: You can make the anims using directly the Char. Rig made by H1Vltg3, it's a little harder but you have more control of what is happening with each bone.

...

To see how to play anims in game using a .net script see this tutorial (baisc scripting knowledge required)


To see how to export the FBX anim file using Andrew's Exporter plugin instead of OFIO watch this video.