Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Death recording, NO more wasted/busted screen, automatic radio OFF


stormy.scp
 Share

Recommended Posts

Dear Coders,

I'm working on a "Movie makers toolset", see:

1) I can record the natural death animation, recording only stops when I enable the respawn!
2) so no more wasted/busted screen at death

For the first two Cheat Engine needed, I don't know how could we achieve this with natives.

3) no more _explosion shake/blur_ effekt (customizable meta!)
4) no more keypress when you enter the wehicle: if the radio is ON in the stolen vehicle,
then automatically and immediately turned OFF (eh this was easy, only one native ;) )

Problem with 1):

- I kill myself, ok

 

GTALua:

natives.ENTITY.SET_ENTITY_HEALTH(natives.PLAYER.PLAYER_PED_ID(), 0);

- now death anim comes, ok

 

veGzLzN.jpg

 

Q: How to resurrect myself?

    natives.PED.RESURRECT_PED(natives.PLAYER.PLAYER_PED_ID());    natives.PED.REVIVE_INJURED_PED(natives.PLAYER.PLAYER_PED_ID());    natives.AI.CLEAR_PED_TASKS(natives.PLAYER.PLAYER_PED_ID());    natives.AI.CLEAR_PED_SECONDARY_TASK(natives.PLAYER.PLAYER_PED_ID());

Doesn't work :(

   natives.AI.CLEAR_PED_TASKS_IMMEDIATELY(natives.PLAYER.PLAYER_PED_ID());   

This works but immediately places in a standing position.

 

 

Other problems:

- need more testing: as I remember changing to Director mode will cause problems

- updates: if R* implemented self-checks in the code, then that would kill the first two :(

in this case don't update :)

I work still with the v350.1 steam exe so I can't test the update, maybe later.


Regards,
Stormy

Edited by stormy.scp
Link to comment
Share on other sites

I have not worked a lot with tasks.

But as far as i understand from reading similar threads and looking at the NativeDB, a ped has a sequence of tasks.

Considering that you get warped to a standing position when calling

natives.AI.CLEAR_PED_TASKS_IMMEDIATELY(natives.PLAYER.PLAYER_PED_ID());   

And nothing happens when using

natives.AI.CLEAR_PED_TASKS(natives.PLAYER.PLAYER_PED_ID());

I'm going to assume that clearing immediately, clears the tasks not just from the sequence but from the memory too.

And that the other method tasks the ped with performing the tasks and clears the task from the sequence when it is performed.

 

I can't confirm any of this, and I might just be pulling this out of my ass.

Also, I use C# not Lua.

 

But I would suggest that you set up a test using a task which i know works, namely

void TASK_WARP_PED_INTO_VEHICLE(Ped ped, Vehicle vehicle, Any seat) //-1 for driver's seat

I would then spawn 3 vehicles. One vehicle would be added to the peds taks before using any clear method, the others after clearing.

This way, if I'm correct, CLEAR_PED_TASKS would warp the ped into all three vehicles while CLEAR_PED_TASKS_IMMEDIATELY would only warp the player into the two vehicles added after clearing.

 

I'm sorry if this is hard to understand.

If you're not sure where I'm going with this, I could write a test in C# and provide you with the code, if it works.

 

Best of luck.

 

EDIT:

Very exciting stuff.

If you get this to work I would be interested in seeing how you did it.

Edited by Mgel
Link to comment
Share on other sites

Dear Mgel,

 

Thanks for your reply!

 

In the previos post I forgot to say that my main goal is to trigger the natural standing up animation when needed.

(think that f.e. you act as a zombie...)

I made a video and here is the code (after rippping out a good A4 page long commented out code :) )

      if IsKeyDown(KEY_F10) then            natives.ENTITY.SET_ENTITY_HEALTH(natives.PLAYER.PLAYER_PED_ID(), 200);            natives.PED.SET_PED_CAN_RAGDOLL(natives.PLAYER.PLAYER_PED_ID(), true);  -- to avoid falling into the hell            natives.AI.CLEAR_PED_TASKS_IMMEDIATELY(natives.PLAYER.PLAYER_PED_ID());      end      if IsKeyDown(KEY_F11) then            natives.ENTITY.SET_ENTITY_HEALTH(natives.PLAYER.PLAYER_PED_ID(), 0); -- selfkill       end

Video explanation:

- First I let the police to kill me some times and then resurrect myself.

- After 1:18 I kill myself with keypress then resurrect.

In this case there is a bug as you can see, but only if I let the death anim to complete (2-3 seconds, don't know exactly)

If I press the resurrection key before the end of the anim, then I can walk normally without that bug (not recorded)

If I set the ragdoll to false, then at random places the player falls through the map, even if I set the position above the ground (not recorded)

 

 

As you can see after restoring the health and clearing the tasks, if a car hits the player then automatically stands up.
So when the player is dead a task/anim keeps him on the ground?

I have to find somehow the function which calls the animations when the health reaches zero, but I found around 300 health checks in the code.

:facedesk:

 

Another hint :

class CTaskGetUp: CTaskGetUp: CTaskFSMClone: CTask: [email protected]: [email protected]:

[email protected]@[email protected]@@rage: [email protected]: [email protected]@

and in one of the functions: subfunc123(v3, "GET_UP_FROM_FALL", 0, 0, 0, -1, 0i64, 0, -1, 0x3F800000, 0, 0, 30000, 0);

 

But this is used internally and not through natives, and the code around this is way to complex for me to understand what it does exactly.

 

And another problem:

These are the death anims (not all), but I don't know how and where the game decides which one to call

These aren't called by name, probably via hash or index.

04751 [email protected] ko_shot_leg
04752 [email protected] ko_shot_torso_b
04753 [email protected] ko_shot_torso_f
04754 [email protected] ko_shot_torso_l
04755 [email protected] ko_shot_torso_r
04756 [email protected] ko_shotbig_torso_b
04757 [email protected] ko_shotbig_torso_f
04758 [email protected] ko_shotbig_torso_l
04759 [email protected] ko_shotbig_torso_r
04760 dam_rec_civi floor_back
04761 dam_rec_civi floor_front
04762 dead dead_a
04763 dead dead_b
04764 dead dead_c
04765 dead dead_d
04766 dead dead_e
04767 dead dead_f
04768 dead dead_g
04769 dead dead_h
04770 [email protected] dead_fall_down
04771 [email protected] dead_fall_up
04772 [email protected] dead_land_down

 

I will try to dig deeper...

 

Regards,

Stormy

Link to comment
Share on other sites

I suggest you to clear tasks and immediately play stand up animation.

 

Best wishes,

Paul.

Link to comment
Share on other sites

I suggest you to clear tasks and immediately play stand up animation.

 

Best wishes,

Paul.

I would have to agree with this.

 

as far as i can tell, CLEAR_IMMEDIATELY, closes the current taskSequence and ends all tasks.

It is not possible to add a new task to a closed taskSequence, so you would most likely have to add a new one after clearing.

It makes sense that you don't get up after pressing F10, because no new task can be added to the current sequence.

I then think being hit by a car triggers some internal code, adds a new taskSequence to the player and he continues from there.

 

I'm unsure why the bug with going halfway through the ground happens, but i would assume that the player position is being reset when the death animation is finished.

You might want to use

World.GetGroundHeight(Player.position)

to store the Z value of the player. Remember that player.position is taken from roughly the waist of the player.

Then whenever you ressurect, place the player on the ground with that offset.

 

I don't know anything about the subfunc, but sadly there is no documented native similar to the "GET_UP_FROM_FALL".

But you could probably find it in NativeDB by matching parameters.

 

For the death animations i would assumed that they're called based on a check that determines whether the characters dies

So if you die from a shot to the back of your torso it calls,

04752 [email protected] ko_shot_torso_b

where _f is for front, _l is for left and _r for a shot to right side of the torso.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.