Quantcast
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 Cayo Perico Heist
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Red Dead Redemption 2

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

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    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. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. 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. 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
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

Sign in to follow this  
Michael Wojtanis

Death body physics

Recommended Posts

Michael Wojtanis

Hello.
My problem is with dead bodys. I want to attach them to player - working fine when they just died, but game making them "dynamic-false" always after few seconds after deadth. Only one way is make them dynamic - touch them... Somebody know how to fix that? What script calling dynamic -false everyframe?

Share this post


Link to post
Share on other sites
whorse

this makes a small, invisible, inaudible explosion that dislodges (most) static entities:

FIRE::ADD_EXPLOSION(bodyCoords.x, bodyCoords.y, bodyCoords.z, eExplosionType::ExplosionTypeSmallExplosion1, 0.1F, false, true, false);

then you can use this to make all peds in the game world not flee the invisible explosion like it's the end of the world (f*cking panzies):

Ped worldPeds[256];//wherever:{        int count = worldGetAllPeds(worldPeds, 512);                for (int i = 0; i < count; i++)                       PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(worldPeds[i], true);        FIRE::ADD_EXPLOSION(bodyCoords.x, bodyCoords.y, bodyCoords.z, eExplosionType::ExplosionTypeSmallExplosion1, 0.1F, false, true, false);        pedsScared = false;        beginTimerB = true;}//at the beginning of next tick:if (!pedsScared) //if all peds are marked fearless:{	if (beginTimerB)	{		SYSTEM::SETTIMERB(0);		beginTimerB = false;	}	if (SYSTEM::TIMERB() > 1000)	{                pedsScared = true;		int count = worldGetAllPeds(worldPeds, 512);		for (int i = 0; i < count; i++)		{			if (ENTITY::DOES_ENTITY_EXIST(worldPeds[i]))			{				Ped ped = worldPeds[i];				PED::SET_BLOCKING_OF_NON_TEMPORARY_EVENTS(ped, false);				if (PED::IS_PED_FLEEING(ped)) //some peds still flee				{					if (!PED::IS_PED_IN_ANY_VEHICLE(ped, true) && !ENTITY::IS_ENTITY_ON_SCREEN(ped))						AI::CLEAR_PED_TASKS_IMMEDIATELY(ped);					else						AI::CLEAR_PED_TASKS(ped);					PED::SET_PED_FLEE_ATTRIBUTES(ped, 0, 0);					//AI::TASK_PAUSE(ped, 10000.0F);				}			}		}	}}

This is what I did in my gravity gun mod to pick up fixed things like lightposts, umbrellas and newspaper dispensers without just setting their coordinates in front of the gun (where they'll just delete what they collide with)

Edited by whorse

Share this post


Link to post
Share on other sites
Michael Wojtanis

Thank You! :)
Great idea with that explosion. This is little stupid that making peds automatic static even if player do want it... I will try with bullets also.

Share this post


Link to post
Share on other sites
whorse

Thank You! :)

Great idea with that explosion. This is little stupid that making peds automatic static even if player do want it... I will try with bullets also.

Yes, bullets will definitely dislodge a dead ped; anything that makes them move does it. I havent tried that though because bullets arent enough to dislodge most objects, which is what I was doing before. In the grav guns current state, the explosions are not applied to dead bodies, but all you have to do to pick them up is shoot them or nudge them a little (otherwise, the gravity gun forces applied to them have no effect)

 

Peds who are doing certain scenarios that seem to be on "tracks" - such as beach-combers - are also insanely resistant to the gravity gun's influence. They have to be like 20 feet away to be affected by it. I finally just made it so that if a target ped were "static" (from the native ENTITY::IS_ENTITY_STATIC() ), I would force them to do a high-fall task (which basically means go ragdoll). Only then could I pick them up.

But still, I am having trouble getting cars that are at a longer distance. They are being fully rendered and everything, but they seem to be attached to a "track" like the beach combers, and they will not move anywhere but on this track. Even if I tell the gravity gun to throw them, they will just go a little faster down their track in the same direction they were already headed. If anyone knows how to get a vehicle out of this mode, please let me know, lol. I'm not sure if the solution has something to do with blocking navmeshes (whatever that means), or whether maybe they are running their own little "distant traffic" script and I could find it (ENTITY::GET_ENTITY_SCRIPT()) and force them to leave it with the SCRIPT:: natives, or what. Maybe it has something to do with the BRAIN:: natives. Zooming in on them with the sniper seems to help a little.

 

here is the source code if you want to take a look

Edited by whorse

Share this post


Link to post
Share on other sites
Michael Wojtanis

Mayby detect Physic Model? In Natives?

I working with SHOOT_SINGLE_BULLET_BETWEEN_COORDS. That is nice, but... blood on ped. Tommorow i will think how to delete that and delete the hit sound. Mayby i will create a small dart, speed up this in idiotic ped ass and mayby then he will be dynamic xD

Ok. There is some stuff what i use:

 Entity cupTea = World.CreateProp(new Model("p_amb_coffeecup_01"), wrogowie[0].Position+new Vector3(0,0,-0.5f), true, false);                  cupTea.IsVisible = false;                    cupTea.IsCollisionProof = true;                    GTA.Native.Function.Call(Hash.SET_ENTITY_COLLISION, cupTea, true,false);                    GTA.Native.Function.Call(Hash.SET_ENTITY_DYNAMIC, cupTea, true);                    GTA.Native.Function.Call(Hash.SET_ENTITY_NO_COLLISION_ENTITY, cupTea, Game.Player.Character, false);                    cupTea.ApplyForce((wrogowie[0].Position-cupTea.Position)*10);

Working fine, peds not running :D No blood :D Of course You need detect when that cup hit the ped, after that, 2 ms wait and attach physicaly :)

Edited by Michael Wojtanis

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.

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.