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

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
stormy.scp

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

Recommended Posts

stormy.scp

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

Share this post


Link to post
Share on other sites
Mgel

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

Share this post


Link to post
Share on other sites
stormy.scp

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]shot 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

Share this post


Link to post
Share on other sites
leftas

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

 

Best wishes,

Paul.

Share this post


Link to post
Share on other sites
Mgel

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.