Blablabla69420 Posted April 16 Share Posted April 16 need instructions for this You know that, after a certain amount of time, a dead ped despawns even if you're looking at it. That uses a timer. how do i edit that timer? Which file contains the despawn timer for dead peds? What to edit in said file? Which directory? Need help with this. Link to comment Share on other sites More sharing options...
firedihm Posted April 16 Share Posted April 16 they are hardcoded Link to comment Share on other sites More sharing options...
Blablabla69420 Posted April 17 Author Share Posted April 17 7 hours ago, firedihm said: they are hardcoded Can you just like, give it a try? Why would there be no way to change the code? Link to comment Share on other sites More sharing options...
Jack Posted April 17 Share Posted April 17 (edited) 30 seconds = 30 000 ms // 0x7530 binary search: 30 75 00 00 This function is directly responsible for that: 0x611FC0 // CPopulation::ManagePed(CPed *ped, CVector *playerPosn); Decompiled to c++: Spoiler void __cdecl CPopulation::ManagePed(CPed *ped, CVector *playerPosn) { int v2; // [email protected] CEntity *v3; // [email protected] int delta; // [email protected] CCoors *v5; // [email protected] int v6; // [email protected] double v7; // [email protected] int v8; // [email protected] double v9; // [email protected] int v10; // [email protected] char v11; // [email protected] int v12; // [email protected] int v13; // [email protected] WORD v14; // [email protected] float v15; // [sp+4h] [bp-4h]@20 if ( CPed::IsPlayer(ped) ) return; if ( !CPed::CanBeDeleted(ped) ) return; v2 = ped->m_dwPedFlags[0]; if ( BYTE1(v2) & 1 ) return; v3 = (CEntity *)ped->physical.m_pAttachedTo; if ( v3 ) { if ( (v3->m_bTypeState & 7) == ENTITY_TYPE_VEHICLE ) return; } delta = CTimer::m_snTimeInMilliseconds - ped->m_dwTimeWhenDead; // ---> RELEVANT !!! <--- if ( ped->m_dwPedState == 55 && (delta > 30000 || CDarkel::FrenzyOnGoing() && delta > 15000 || delta > 8000 && CGangWars::GangWarFightingGoingOn()) ) ped->m_dwPedFlags[1] |= PED_FADE_OUT; if ( ped->m_dwPedFlags[1] & PED_FADE_OUT && !CVisibilityPlugins::GetClumpAlpha(ped->physical.entity.m_pRWObject) ) { @@REMOVE_PED: CPopulation::RemovePed((_CEntity *)ped); return; } v5 = ped->physical.entity.placeable.m_pCoords; v6 = (int)&v5->m_mMatrix.matrix.pos; if ( !v5 ) v6 = (int)&ped->physical.entity.placeable.m_SimpleCoors; if ( v5 ) v8 = (int)&v5->m_mMatrix.matrix.pos; else v8 = (int)&ped->physical.entity.placeable.m_SimpleCoors; v9 = *(float *)(v8 + 4); v10 = ped->m_nPedType; v7 = *(float *)v6 - playerPosn->x; v15 = sqrt((v9 - playerPosn->y) * (v9 - playerPosn->y) + v7 * v7) * ped->m_fRemovalDistMultiplier; if ( v10 < 7 || v10 > 16 ) { if ( ped->m_dwPedFlags[1] & DEAD_PED_IN_FRONT_OF_CAR && ped->field_590 ) v15 = 0.0; } else { v15 = v15 - 30.0; } if ( CPopulation::PedCreationDistMultiplier() * TheCamera.m_fGenerationDistMultiplier * 65.0 < v15 || !(ped->m_dwPedFlags[1] & CULL_EXTRA_FAR_AWAY) && CPopulation::PedCreationDistMultiplier() * TheCamera.m_fGenerationDistMultiplier * 54.5 < v15 ) { @@FADEOUTPEDORREMOVE: if ( CEntity::GetIsOnScreen(&ped->physical.entity) ) { ped->m_dwPedFlags[1] |= PED_FADE_OUT; return; } goto @@REMOVE_PED; } if ( CPopulation::PedCreationDistMultiplier() * 25.0 >= v15 ) { if ( ped->m_nPedType != 6 ) { ped->m_dwTimeTillWeNeedThisPed = CTimer::m_snTimeInMilliseconds + 4000; return; } v12 = CTimer::m_snTimeInMilliseconds; LABEL_45: ped->m_dwTimeTillWeNeedThisPed = v12 + 10000; return; } v11 = CEntity::GetIsOnScreen(&ped->physical.entity); v12 = CTimer::m_snTimeInMilliseconds; if ( (unsigned int)CTimer::m_snTimeInMilliseconds <= ped->m_dwTimeTillWeNeedThisPed ) { if ( !v11 ) return; LABEL_41: if ( ped->m_nPedType != 6 ) { ped->m_dwTimeTillWeNeedThisPed = CTimer::m_snTimeInMilliseconds + 4000; return; } goto LABEL_45; } if ( v11 ) goto LABEL_41; v13 = TheCamera.m_nActiveCam; v14 = TheCamera.m_aCams[v13].m_wMode; if ( v14 != 7 && v14 != 39 && v14 != 46 && !TheCamera.m_aCams[v13].m_bLookingLeft && !TheCamera.m_aCams[v13].m_bLookingRight && !TheCamera.m_aCams[v13].m_bLookingBehind ) goto @@FADEOUTPEDORREMOVE; } Solutions: Increasing the delta clock to a max DWORD value: injector::WriteMemory<DWORD>(0x612024 + 2, -1); // 30000 as a default or disabling the cond. check jump which will completely remove the clock: injector::MakeNOP(0x61202A, 2); // default 0x227F However if we look at the biger picture this memory changes should occur under some specific circumstances like when the player is close to a dead ped or when a ped is in his field of view. Otherwise that piece of code should be returned to the default again in order to avoid potential issues. Edited April 17 by Jack Tank Fire [SA] New Police Helicopter [VC & III] My YouTube Channel Link to comment Share on other sites More sharing options...
Blablabla69420 Posted April 17 Author Share Posted April 17 Understood. Now, which filename? Link to comment Share on other sites More sharing options...
cjfan_ Posted April 17 Share Posted April 17 If you want it just for gameplay you can use the MixSets mod. Link to comment Share on other sites More sharing options...
Blablabla69420 Posted April 17 Author Share Posted April 17 18 minutes ago, cjfan_ said: If you want it just for gameplay you can use the MixSets mod. Yes, I want it for only gameplay. Download link? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now