Experienced Elementalist
- Joined
- Oct 14, 2015
- Messages
- 267
- Reaction score
- 294
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 loop.
Give me credit where possible. Thanks
Enjoy!
Hit that
!!!
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.
------------------
------------------
EclipseStudio/Sources/ObjectsCode/AI/AI_Player.CPP
Find:
Add Below:
Find:
Replace:
----------------
EclipseStudio/Sources/ObjectsCode/AI/AI_PlayerAnim.cpp
Find:
Add Below:
Find:
Replace
Find:
Replace:
Find:
Add Above:
-----------------
EclipseStudio/Sources/ObjectsCode/AI/AI_PlayerAnim.h
Find:
Add Below:
Find:
Replace:
-------------------
Eternity/Include/r3dInput.h
Find:
Add Above:
------------------
Eternity/Source/r3dInput.cpp
Inside: r3dInputMappingMngr::r3dInputMappingMngr() at the very bottom of the container
Add:
------------------
Any problems here the pastebin of all changes made
------------------
EclipseStudio/Sources/ObjectsCode/AI/AI_Player.CPP
Find:
Code:
if(wpn && hudAttm && hudAttm->isActive() && wpn->getCategory()>=storecat_ASR && wpn->getCategory()<=storecat_SMG)
isInAttmMenu = true;
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);
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");
Code:
aid_.InspectWeapon[0] = AddAnimation("[COLOR=#ff0000]XXXXYOURANIMATIONNAMEHEREXXXX[/COLOR]"); //ASR
aid_.InspectWeapon[1] = AddAnimation("[COLOR=#ff0000]XXXXYOURANIMATIONNAMEHEREXXXX[/COLOR]"); //SNP
aid_.InspectWeapon[2] = AddAnimation("[COLOR=#ff0000]XXXXYOURANIMATIONNAMEHEREXXXX[/COLOR]"); //SHG
aid_.InspectWeapon[3] = AddAnimation("[COLOR=#ff0000]XXXXYOURANIMATIONNAMEHEREXXXX[/COLOR]"); //MG
aid_.InspectWeapon[4] = AddAnimation("[COLOR=#ff0000]XXXXYOURANIMATIONNAMEHEREXXXX[/COLOR]"); //HG
aid_.InspectWeapon[5] = AddAnimation("[COLOR=#ff0000]XXXXYOURANIMATIONNAMEHEREXXXX[/COLOR]"); //SMG
Find:
Code:
void CUberAnim::SyncAnimation(int PlayerState, int MoveDir, bool force, const Weapon* weap, bool isInAttmMenu)
Code:
void CUberAnim::SyncAnimation(int PlayerState, int MoveDir, bool force, const Weapon* weap, bool isInAttmMenu, bool isWantingToInspect)
Find:
Code:
if(isInAttmMenu && CurrentWeapon && IsFPSMode()
Code:
if(!isWantingToInspect && isInAttmMenu && CurrentWeapon && IsFPSMode()
Find:
Code:
// switch anim state
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];
Code:
int InspectWeapon[6];
Find:
Code:
void SyncAnimation(int PlayerState, int MoveDir, bool force, const Weapon* weap, bool isInAttmMenu);
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,
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);
------------------
Any problems here the pastebin of all changes made
You must be registered to see links
How it works.. Hold "B" and it will play the inspect animation that you chose on a loop.
Give me credit where possible. Thanks
Enjoy!
Hit that
Attachments
You must be registered for see attachments list
Last edited: