Newbie Spellweaver
- Joined
- Sep 3, 2015
- Messages
- 63
- Reaction score
- 50
You must be registered to see links
P2PMessages.h
Search ;
and add this below ;
Now search for this;
and add this below ;
AI_Player.cpp
Search ;
Search ;
Code:
PKT_C2C_PlayerJump,
Code:
// Player Interact Anim
PKT_C2C_StartPickup,
Code:
struct PKT_C2C_PlayerJump_s : public DefaultPacketMixin<PKT_C2C_PlayerJump>
{
};
Code:
///////////////////////// Player Interact Anim /////////////////////////
struct PKT_C2C_StartPickup_s : public DefaultPacketMixin<PKT_C2C_StartPickup>
{
//Empty
};
AI_Player.cpp
Search ;
Code:
DEFINE_GAMEOBJ_PACKET_HANDLER(PKT_C2C_PlayerJump);
and add this below ;
Code:
DEFINE_GAMEOBJ_PACKET_HANDLER(PKT_C2C_StartPickup);
Search ;
Code:
void obj_Player::StartJump()
and add this below ;
Code:
void obj_Player::StartPickup()
{
ChangeWeaponByIndex(HANDS_WEAPON_IDX);
uberAnim_->StartPickupAnim();
PKT_C2C_StartPickup_s n;
p2pSendToHost(this, &n, sizeof(n));
// more code is needed -/- random AI dialog sound
// more code is needed -/- cancel the sound when the AI change the playerstate
// more code is needed -/- sync animation with the default idl playerstate
}
Search ;
Code:
void obj_Player::OnNetPacket(const PKT_C2C_PlayerJump_s& n)
and add this below ;
Code:
void obj_Player::OnNetPacket(const PKT_C2C_StartPickup_s& n)
{
uberAnim_->StartPickupAnim();
return;
}
Search ;
Code:
if(dropObj->Class->Name == "obj_FarmBlock")
Add Below ;
Code:
uberAnim_->StartPickupAnim(); //start pickup animation here - temporal logic
Now look below this;
Code:
// if we picked up weapon with empty hands - switch to it
if(m_SelectedWeapon == HANDS_WEAPON_IDX && (n.SlotTo == wiCharDataFull::CHAR_LOADOUT_WEAPON1 || n.SlotTo == wiCharDataFull::CHAR_LOADOUT_WEAPON2))
{
ChangeWeaponByIndex(n.SlotTo);
}
hudMain->showMessage(gLangMngr.getString("InfoMsg_NewItemAdded"));
and add this below ;
Code:
uberAnim_->StartPickupAnim(); //start pickup animation here - temporal logic
AI_Player.h
Search ;
Code:
void OnNetPacket(const PKT_C2C_PlayerJump_s& n);
and add this below ;
Code:
void OnNetPacket(const PKT_C2C_StartPickup_s& n);
This float search ;
Code:
float StartFallingTime;
and add this below ;
Code:
// Interact Anim System
void StartPickup();
AI_PlayerAnim.cpp
Search;
Code:
void CUberData::LoadDeathAnim()
{
...
}
and add this below ;
Code:
void CUberData::LoadPlayerInteractAnim()
{
aid_.PlayerInteract[0] = AddAnimation("PickUpItem");
}
Search ;
Code:
LoadHandsAnim();
and add this below ;
Code:
LoadPlayerInteractAnim();
Search ;
Code:
void CUberAnim::StartDeathAnim()
{
...
}
and add this below ;
Code:
///////////////////////////////////////////////////////////// PLAYER INTERACT /////////////////////////////////////////////////////////////
void CUberAnim::StartPickupAnim()
{
StopReloadAnim();
anim.StartAnimation(data_->aid_.PlayerInteract[0], ANIMFLAG_PauseOnEnd | ANIMFLAG_RemoveOtherFade, 0.0f, 1.0f, 0.1f);
}
AI_PlayerAnim.h
Search ;
Code:
int deaths[20];
and add this below ;
Code:
int PlayerInteract[20]; // for player Interactive with objs
Code:
void LoadDeathAnim();
and add this below ;
Code:
void LoadPlayerInteractAnim(); // player interactive with objs
Code:
void StartDeathAnim();
and add this below ;
Code:
// NEW ANIMATION SYSTEM
//-------------- Interactive Anim --------------
void StartPickupAnim();
void StartPickup();