Pages

Tuesday, June 11, 2013

GTA iV HULK Script - Screenshots and progress [W.I.P.]

HULK script is evolving...

Download it here

Requested by taltigolt, also he is giving tips and making tests :)
Ped model used in screens/videos it's from ac.amir, unfortunately the oficial download link is offline, you can temporary download it here
The script it's not available yet, but will be released soon

Videos:
"Lamp pole as baseball bat" feature: http://www.facebook.com/photo.php?v=354247838031496
Ped grab and throw: http://www.facebook.com/photo.php?v=355231647933115
"Ped smash", possible feature: http://www.facebook.com/photo.php?v=355430167913263
Basic melee attacks: http://www.facebook.com/photo.php?v=357637081025905


All started with simple big jump attack

Hold jump to jump higher with an limit, fall from high places 
and damage ground, peds, vehicles an objects around you

Footsteps ground effect (sound and particle fx):

When walking or running you will cause some small damage on ground, 
unfortunately i don't know how to create the crackle textures on ground yet

Lift objects and vehicles and throw them:

You can lift dumpsters and throw them. If you hold attack key 
HULK will have his rage increased and will throw with more force

The same can be done with any vehicle, maybe i will add an 
size limit, lift an bus seems too much

Watch those features above here:



Grab a lamp pole and use it like a baseball bat:

Q: What about grab an lamp pole and use it like an baseball bat?

A: HULK Smash!

Actually we have three movements for this attack: 
Attack from right, from left and from top

Crash almost everything that is in front of player


just crazy.

Ped grab and throw:

 Actual issue is the transition between animated ped to ragdoll 
and grabbed ped, sometimes it looks ugly, also the grab can fail
because of attach point distant form player hand, hard to control this detail.

 But it's a nice feature, i think i will keep

 Other bad point is that is only dangerous for the grabbed ped ^^
An ped at high speed it's not dangerous.


"Ped smash", kinda Loki being punished by Hulk in Avengers movie.



Basic melee attacks

 Animation + sound + ptfx = nice punch


 Top attack will throw peds and vehicles up


Cars will have their doors broken


"Thunder clap"


Makes me remember Fus Ro Dah ^^

Punch ground attack



Peds, objects and vehicles in front of player will be launched

Jump to targeted ground


Makes a lot easier reach the top of a building

Direct attack against targets





"Wall climb"


This feature will allow you to "climb" walls, also 
it's useful to avoid fall on ground when big jump fails
Unfortunately the ped arms and foot will "blend" with the wall.


More features are coming :)

Sunday, June 9, 2013

Iron Man IV - Restore street peds pack

Check the last version of this mod here

***

If you installed first version of Iron Man IV mod, you probably replaced some common street peds, and you probably see armors walking on streets ^^

To fix this "issue" i created the replace mission chars pack to replace mission chars and now i will release here this pack to restore original GTA IV peds visual, this way you will avoid the armors walking on streets :)


Easy install

OpenIV Package for easy install: FreakShare, MEGA

Need more speed with your MEGA downloads? click here
Need help with .oiv files? click here




Manual setup

Download the pack FreakShare, MEGA

Extract the files to an folder, you will have this:


Now open the OpenIV, select your game, open the folder models\cdimages, open the file componentpeds.img then click in Edit mode:


Now in the folder "restore" we will have all the models that we need to drag to OpenIV, select them all and drag and drop to OpenIV, or use the OpenIV menu Edit > Add:


Done!



Obs.: Those ped models are from EFLC, so you can use them in EFLC too. They are similar to the ones from GTA IV, maybe they are the same, i don't know. This pack was tested in GTA with patch 1.0.4.0 and 1.0.7.0.

Thursday, June 6, 2013

[TUT] Installing planes/jets

Some people still have trouble installing planes/jets into GTA IV, so i decided to create this small tutorial to help those people.


Editing the handling.dat and vehicles.ide files

Generally, when you download an plane/jet you will have an readme.txt and inside this readme you will have instructions about the installation of the model:


It indicates that you must edit handling.dat and vehicles.ide files, they commonly are located at:

C:\Program Files\Rockstar Games\Grand Theft Auto IV\common\data


First we need to make sure that the property Read only is unmarked on the file properties (for handling.dat and vehicles.ide):


Now open handling.dat with notepad and find the indicated line based on readme, commonly we will replace the airtug vehicle, so, search for airtug, you will find a line like this:


Now we copy the line from the readme.txt and replace this line in the handling.dat:


Pay attention to an detail, we have two lines to replace in handling.dat, the second line we find searching for the $ char:


Now we copy the indicated line in readme and insert above the first line that starts with $ in handling.dat:


Save and close the file handling.dat.


Now it's time to edit vehicles.ide, after making sure that this file is not Read only, open it with notepad and search for airtug (or same name used in handling.dat):


Now copy the indicated line in the readme and replace the vehicles.ide line:


Save and close the vehicles.ide file.



Installing the model

Now if you open your game and enter in a airtug as driver you will be able to fly. What we need to do now it's install the model, Open the OpenIV, select your game, open the folder models\cdimages then open the file vehicles.img and click in the button Edit mode:


Now you can use the menu Edit > Add or drag and drop the files:



Done!


Important: The name of the model is all here, if you edit handling of taxi and insert the model airtug, things wont work as expected, pay attention to the model name always.


Similar process can be used for cars, bikes, helicopters and boats, just pay attention to the lines that you should add or replace :)




Tip :)

For jets you can use the Air Combat IV script to make things more cool
For helicopters you can use the Heli Combat script to have an more intense combat

Wednesday, June 5, 2013

[TUT] Animations

Animations can give another look to an modification. In this tutorial i will show what i know about animations in GTA IV, you can download the code of this tutorial here and download the list of GTA IV animation here.

We have an big list of animations to use and thanks to the people involved in OpenIV development we can see those animations without the game running, it's very useful, you can find this option in the OpenIV menu Tools > Animation Viewer:


In the next screen we can choose what kind of animation we want preview:


Clicking in Ped animations (anim.img) we will be redirected to an screen that organizes the animations by their categories:


Clicking in one of the categories we will see an new screen with an Ped in center and the list of animations in the left side, if we click one of the animations the OpenIV will start playing the animation in loop mode:



Now to make this happen in game we can do with basically two ways:
  • Using scripthook classes
  • Using native method calls


Using Scripthook classes to play animations

To play animations using the scripthook we need:
  • An animation set: This object will determine the category of the animation
  • The Animation object that each Ped have, or the Ped's Task.PlayAnimation object
Simple example:


Here I'm declaring the animation set of the category swimming, then playing the animation idle from this category, the number 8 represents the speed of the playback, this param don't seems to affect the playback all the time, seems to work only in the start.

Result:


Before use an animation it's interesting request the animations of the category, we can do this using this native call:


Now let's improve this, as we can see the player plays the animation until the animation reaches the end then go back to normal animation, but what we need to do to make it automatically loop this animation? We need to use animation flags, based on this site the animation flags that we have are:
  • Unknown01 - Don't come back to initial position after animation ends, we use this for animations that result in position change for the ped, for example the land and roll animation
  • Unknown04 - Based on translation it will make ped return to original position, in my tests don't change anything
  • Unknown05 - We use this flag to loop the animation
  • Unknown06 - We use this to stop the ped in the last animation position, ped will play animation then stop frozen in the last frame of the animation
  • Unknown07 - Seems that makes player reset to Standing idle animation after the animation ends
  • Unknown09 - This one will make the animation be played only in ped's upper body, legs wont be affected, it's interesting to be used while the ped is inside an vehicle (Nevitro tip).
  • Unknown10 - Remove the possible sound of the animation, some animations has sounds others don't
  • Unknown09 combined with Unknown11 (Unknown09 Or Unknown11) - Tip sent by Giovafr Giova, this will result in the play of the animation only in the upper body with the possibility to walk while the anim is being played.

We have other flags but they seems to result in nothing like the Unknown04.

So, to make our player repeat the animation we should use the flag Unknown05:


We can combine flags with the Or operator, for example, if we want play the run animation of the swimming category we can use the flags: Unknown01 to don't come back to initial positionUnknown05 to repeat and Unknown10 to remove the animation sound:


Sometimes this play method fails when we try to put together the flags (after some reloadscripts command calls), so if the things are not happening as expected, reload the game and test again.

This video shows the result with and without the flags:


To stop the animation I'm using this:



Other interesting methods of the Animation class

  • isPlaying - This method returns True when the animation is being played
  • GetCurrentAnimationTime - This method return the current time of the animation



Detecting animations

We can use the isPlaying or the GetCurrentAnimationTime to determine if the ped is playing an determined animation, but to make sure that we can detect the anim we need to call the method REQUEST_ANIMS to load the animations of that animation category before we try to detect the animation play:





Using native methods to play animations

To play animations using the native calls we have this methods:

  • TASK_PLAY_ANIM
  • TASK_PLAY_ANIM_FACIAL
  • TASK_PLAY_ANIM_NON_INTERRUPTABLE
  • TASK_PLAY_ANIM_READY_TO_BE_EXECUTED
  • TASK_PLAY_ANIM_SECONDARY
  • TASK_PLAY_ANIM_SECONDARY_IN_CAR
  • TASK_PLAY_ANIM_SECONDARY_NO_INTERRUPT
  • TASK_PLAY_ANIM_SECONDARY_UPPER_BODY
  • TASK_PLAY_ANIM_UPPER_BODY
  • TASK_PLAY_ANIM_WITH_ADVANCED_FLAGS
  • TASK_PLAY_ANIM_WITH_FLAGS

The more interesting here is the TASK_PLAY_ANIM_SECONDARY_UPPER_BODY because that method will play the animation only in the upper body of the ped, it's useful when we need to play an animation while the player is walking or running, example:


First param is the ped, second is the animation name, then comes the category name, number 8.0 represents the playback speed, I declared p1_Repeat and p4_... to make clear of what is the function of that parameter in the method call, if we set those params to one or true we will enable them, they act like flags, the last param determine the time in milliseconds that the animation will be played, if we set an time smaller than the total animation time the animation will end before reach final frame, this time is not precise because it is affected by game FPS.

The TASK_PLAY_ANIM_SECONDARY_IN_CAR it's interesting too because we can use this to play animations while the ped is in an vehicle, the params are same of the TASK_PLAY_ANIM_SECONDARY_UPPER_BODY method.

I don't will talk about the other anim methods because they have similar results of the Scripthook methods.



Other interesting methods related to animations

  • HAVE_ANIMS_LOADED - We can use to check if the REQUEST_ANIMS call finished the loading of the animations of the category, params: category name
  • IS_CHAR_PLAYING_ANIM - To check if player is playing an animation, params: ped, category name and animation name
  • GET_CHAR_ANIM_CURRENT_TIME - Get the animation time, params: ped, category name, animation name and a pointer to an variable (of type Single) to store the time:


SET_CHAR_ALL_ANIMS_SPEED - This one will set an new playback speed for all animations that the pPed is playing, params: ped and new speed multiplier (float number). For example, to set player anims to 150% the normal we can do:


SET_CHAR_ANIM_SPEED - This one is similar to the one above, the difference is that this one will affect one animation only, params: ped, category name, animation name and speed multiplier


SET_CHAR_ANIM_CURRENT_TIME - We can use this method to set the animation time, 1.0 is 100%, the end, 0 is the start, very useful to control the animation, we can make and fake reverse playback reducing the percent number, params: ped, category name, animation name and playback percent/100 (from 0 to 1.0)


Demonstration of reverse playbackhttp://www.facebook.com/photo.php?v=355430167913263, in this video i play grenade_throw_overarm from 0.3 (30%) to 0.6 (60%) and back to 0.3, also i use SET_CHAR_ANIM_SPEED and set it to 0.1 to make the movement more smooth.


SET_CHAR_MOVE_ANIM_SPEED_MULTIPLIER - This one changes only the ped movement animations speed, params: ped and speed multiplier

SET_ANIM_GROUP_FOR_CHAR - This one changes the ped animations group, will affect his walk, run, idle animation, etc., params: ped and animation group

To use this last one we need to call the REQUEST_ANIMS to load the animations of the chosen movement category before use the method:


We need to be careful with this native call because if we set an invalid movement group we crash the game :)
Generally the names of the groups starts with move_, for example: move_player, move_melee, move_rifle, etc.. You can download the list of animations and see the categories that start with move_ here.
pernas