/*
So seen this a couple of times, everyone wants this inspect weapon from cs:go.
Follow the tutorial below and you will be successful, however this tutorials only offer the outline for code only, I cannot supply the animation. I'm sure you can do some digging and find one. Make sure you place it inside Animation5 folder.
How it works.. Hold "B" and it will play the inspect animation that you chose on a loo
GIF: https://i.gyazo.com/d551e9eee6b65f292b960d72a8c9337d.gif
>>> DOWNLOAD ANIMATION FILES NEEDED TO GET THIS WORKING HERE <<<
https://mega.nz/#!S9xDhJoA!trpt3wdLQQ4fN_eEXgSXXEaKovSjGnxfk8pdnXQai-A
*/
EclipseStudio/Sources/ObjectsCode/AI/AI_Player.CPP
Find:
Code:
if(wpn && hudAttm && hudAttm->isActive() && wpn->getCategory()>=storecat_ASR && wpn->getCategory()<=storecat_SMG)
isInAttmMenu = true;
Add Below:
Code:
bool isWantingToInspect = (InputMappingMngr->isPressed(r3dInputMappingMngr::KS_INSPECT_GUN) && wpn && wpn->getCategory()>=storecat_ASR && wpn->getCategory()<=storecat_SMG && hudMain && !hudPause->isActive() && !hudAttm->isActive() && !hudVault->isActive() && !hudRepair->isActive() && !hudCraft->isActive() && !hudSafelock->isActive() && !hudTrade->isActive() && !hudStore->isActive() && !hudMain->isChatInputActive() && !Mouse->GetMouseVisibility() && !InputMappingMngr->isPressed(r3dInputMappingMngr::KS_PRIMARY_FIRE) && !InputMappingMngr->isPressed(r3dInputMappingMngr::KS_AIM));
Find:
Code:
uberAnim_->SyncAnimation(PlayerState, PlayerMoveDir, force, wpn, isInAttmMenu);
Replace:
Code:
uberAnim_->SyncAnimation(PlayerState, PlayerMoveDir, force, wpn, isInAttmMenu, isWantingToInspect);
----------------
EclipseStudio/Sources/ObjectsCode/AI/AI_PlayerAnim.cpp
Find:
Code:
aid_.attmMenuIdleWeapon[5] = AddAnimation("FPS_Attch_Idle_SMG");
Add Below:
Code:
aid_.InspectWeapon[0] = AddAnimation("XXXXYOURANIMATIONNAMEHEREXXXX"); //ASR
aid_.InspectWeapon[1] = AddAnimation("XXXXYOURANIMATIONNAMEHEREXXXX"); //SNP
aid_.InspectWeapon[2] = AddAnimation("XXXXYOURANIMATIONNAMEHEREXXXX"); //SHG
aid_.InspectWeapon[3] = AddAnimation("XXXXYOURANIMATIONNAMEHEREXXXX"); //MG
aid_.InspectWeapon[4] = AddAnimation("XXXXYOURANIMATIONNAMEHEREXXXX"); //HG
aid_.InspectWeapon[5] = AddAnimation("XXXXYOURANIMATIONNAMEHEREXXXX"); //SMG
Find:
Code:
void CUberAnim::SyncAnimation(int PlayerState, int MoveDir, bool force, const Weapon* weap, bool isInAttmMenu)
Replace
Code:
void CUberAnim::SyncAnimation(int PlayerState, int MoveDir, bool force, const Weapon* weap, bool isInAttmMenu, bool isWantingToInspect)
Find:
Code:
if(isInAttmMenu && CurrentWeapon && IsFPSMode()
Replace:
Code:
if(!isWantingToInspect && isInAttmMenu && CurrentWeapon && IsFPSMode()
Find:
Code:
// switch anim state
Add Above:
Code:
///Inspect
if(isWantingToInspect && CurrentWeapon && IsFPSMode()
&& !IsSwimming && PlayerState != PLAYER_SWIM_IDLE && PlayerState != PLAYER_SWIM_SLOW && PlayerState != PLAYER_SWIM && PlayerState != PLAYER_SWIM_FAST
)
{
bool AlreadyPlayingInspect = false;
int animIdx = 0;
switch(CurrentWeapon->getCategory())
{
case storecat_ASR:
animIdx = 0;
break;
case storecat_SNP:
animIdx = 1;
break;
case storecat_SHTG:
animIdx = 2;
break;
case storecat_MG:
animIdx = 3;
break;
case storecat_HG:
animIdx = 4;
break;
case storecat_SMG:
animIdx = 5;
break;
default:
r3d_assert(false);
break;
}
r3dgameVector(r3dAnimation::r3dAnimInfo)::iterator it;
for(it=anim.AnimTracks.begin(); it!=anim.AnimTracks.end(); ++it)
{
const r3dAnimation::r3dAnimInfo& ai = *it;
if(ai.pAnim->iAnimId == data_->aid_.InspectWeapon[animIdx])
{
AlreadyPlayingInspect = true;
break;
}
}
if(!AlreadyPlayingInspect)
anim.StartAnimation(data_->aid_.InspectWeapon[animIdx], ANIMFLAG_RemoveOtherNow | ANIMFLAG_Looped, 0.0f, 1.0f, 0.1f);
else // playing idle anim
{
// do nothing :)
}
AnimPlayerState = -1; // reset, so that after attm menu we will return back to proper animation
return;
}
///END of Inspect
-----------------
EclipseStudio/Sources/ObjectsCode/AI/AI_PlayerAnim.h
Find:
Code:
int attmMenuIdleWeapon[6];
Add Below:
Code:
int InspectWeapon[6];
Find:
Code:
void SyncAnimation(int PlayerState, int MoveDir, bool force, const Weapon* weap, bool isInAttmMenu);
Replace:
Code:
void SyncAnimation(int PlayerState, int MoveDir, bool force, const Weapon* weap, bool isInAttmMenu, bool isWantingToInspect = false);
-------------------
Eternity/Include/r3dInput.h
Find:
Code:
KS_NUM,
Add Above:
Code:
KS_INSPECT_GUN,
------------------
Eternity/Source/r3dInput.cpp
Inside: r3dInputMappingMngr::r3dInputMappingMngr() at the very bottom of the container
Add:
Code:
m_Mapping[KS_INSPECT_GUN] = KeyboardMapping(INPUTMAP_KEYBOARD, kbsB, "INSPECT GUN", false);
/*
By GetRektBambi
*/
Comments
0 B
|👍
/👎