Newbie Spellweaver
- Joined
- Apr 13, 2013
- Messages
- 54
- Reaction score
- 109
WarZ.sln
AI_Player.cpp
add
find
replace to
find
add
find
add
find
add
P2PMessages.h
find
add
add
ClientGameLogic.cpp
add
find
add
find
add
ClientGameLogic.h
find
add
WarZ_Server.sln
ServerGameLogic.cpp
add
find
add
find
add
obj_ServerPlayer.cpp
add
find
add
for spawn 1 animal per one zombiespawn
sobj_ZombieSpawn.cpp
add
find
add
add to this
Source files
AI_Player.cpp
add
Code:
#include "../Gameplay/obj_Animals.h"
find
Code:
if(!((*gameObj)->isObjType(OBJTYPE_Human) || (*gameObj)->isObjType(OBJTYPE_Zombie) || (*gameObj)->Class->Name == "obj_ZombieDummy"))
replace to
Code:
if(!((*gameObj)->isObjType(OBJTYPE_Human) || (*gameObj)->isObjType(OBJTYPE_Zombie) || (*gameObj)->Class->Name == "obj_ZombieDummy" || (*gameObj)->Class->Name == "obj_Animals"))
find
Code:
bool canDamageTarget(const GameObject* obj)
{
if(obj->isObjType(OBJTYPE_Human))
return true;
add
Code:
if(obj->Class->Name == "obj_Animals")
return true;
find
Code:
// if we hit local player, display hit effect
if(target->isObjType(OBJTYPE_Human))
{
AddBloodOnGround(n.hit_pos);
SpawnImpactParticle(r3dHash::MakeHash("player"), r3dHash::MakeHash(m_Weapons[m_SelectedWeapon]->getDecalSource()), n.hit_pos, dir);
if(target->NetworkLocal == false || CGL.localPlayer_==NULL)
return;
// if hit local player
extern void TPSGameHUD_AddHitEffect(GameObject* from);
TPSGameHUD_AddHitEffect(this);
}
add
Code:
else if(target->Class->Name == "obj_Animals")
{
AddBloodOnGround(n.hit_pos);
SpawnImpactParticle(r3dHash::MakeHash("player"), r3dHash::MakeHash(m_Weapons[m_SelectedWeapon]->getDecalSource()), n.hit_pos, dir);
}
find
Code:
if( shootTarget == NULL && shootMaterial == NULL) // hit nothing
{
PKT_C2C_PlayerHitNothing_s n;
p2pSendToHost(owner, &n, sizeof(n), true);
}
add
Code:
else if (shootTarget && shootTarget->Class->Name == "obj_Animals")
{
SpawnImpactParticle(r3dHash::MakeHash("player"),r3dHash::MakeHash(weaponInfo->m_PrimaryAmmo->getDecalSource()), hitPoint, hitNormal);
if (ownerPlayer)
ownerPlayer->AddBloodOnGround(hitPoint);
//r3dOutToLog("Hit Animals\n");
//obj_Animals* trgt = (obj_Animals*)shootTarget;
//if(!trgt->bDead)
//{
PKT_C2C_PlayerHitDynamic_s n;
n.muzzler_pos = muzzlerPosAtFireStart;
n.hit_pos = hitPoint;
n.targetId = toP2pNetId(shootTarget->GetNetworkID());
n.hit_body_part = 0;
n.hit_body_bone = 0;
n.damageFromPiercing = damageFromPiercable;
// NOTE: This can be broken if the player jumps after firing a sniper rifle, but shouldn't happen as it's too fast.
n.state = 0;
p2pSendToHost( owner, &n, sizeof(n), true);
if(ownerPlayer)
{
ownerPlayer->m_HitMarkerFadeout = 1.0f;
}
//}
}
P2PMessages.h
find
Code:
enum pkttype_e
{
PKT_C2S_ValidateConnectingPeer = r3dNetwork::FIRST_FREE_PACKET_ID,
add
Code:
PKT_S2C_CreateAnimals,
PKT_S2C_AnimalsMove,
add
Code:
struct PKT_S2C_CreateAnimals_s : public DefaultPacketMixin<PKT_S2C_CreateAnimals>
{
gp2pnetid_t spawnID;
r3dPoint3D spawnPos;
};
struct PKT_S2C_AnimalsMove_s : public DefaultPacketMixin<PKT_S2C_AnimalsMove>
{
r3dVector angle;
r3dPoint3D pos;
int state;
};
ClientGameLogic.cpp
add
Code:
#include "ObjectsCode/Gameplay/obj_Animals.h"
find
Code:
DEFINE_PACKET_HANDLER(PKT_S2C_CreateZombie);
add
Code:
DEFINE_PACKET_HANDLER(PKT_S2C_CreateAnimals);
find
Code:
IMPL_PACKET_FUNC(ClientGameLogic, PKT_S2C_CreateZombie)
{
//r3dOutToLog("obj_Zombie %d\n", n.spawnID);
r3d_assert(GameWorld().GetNetworkObject(n.spawnID) == NULL);
obj_Zombie* obj = (obj_Zombie*)srv_CreateGameObject("obj_Zombie", "obj_Zombie", n.spawnPos);
obj->SetNetworkID(n.spawnID);
obj->NetworkLocal = false;
memcpy(&obj->CreateParams, &n, sizeof(n));
obj->OnCreate();
// set base cell for movement data (must do it AFTER OnCreate())
obj->netMover.SetStartCell(n.moveCell);
}
add
Code:
IMPL_PACKET_FUNC(ClientGameLogic, PKT_S2C_CreateAnimals)
{
r3dOutToLog("obj_Animals %d\n", n.spawnID);
r3d_assert(GameWorld().GetNetworkObject(n.spawnID) == NULL);
obj_Animals* obj = (obj_Animals*)srv_CreateGameObject("obj_Animals", "Data\\ObjectsDepot\\WZ_Animals\\char_deer_01.sco", n.spawnPos);
obj->SetNetworkID(n.spawnID);
obj->NetworkLocal = false;
//memcpy(&obj->CreateParams, &n, sizeof(n));
obj->OnCreate();
}
]
find
Code:
DEFINE_PACKET_FUNC(PKT_S2C_CreateZombie);
add
Code:
DEFINE_PACKET_FUNC(PKT_S2C_CreateAnimals);
WarZ_Server.sln
ServerGameLogic.cpp
add
Code:
#include "ObjectsCode/sobj_Animals.h"
find
Code:
bool ServerGameLogic::CanDamageThisObject(const GameObject* targetObj)
{
if(IsServerPlayer(targetObj))
{
return true;
}
add
Code:
else if(targetObj->Class->Name == "obj_Animals")
{
return true;
}
find
Code:
if(strncmp(cmd, "/sv", 3) == 0 && plr->profile_.ProfileData.isDevAccount)
return Cmd_SetVitals(plr, cmd);
add
Code:
if(strncmp(cmd, "/ani", 5) == 0 && plr->profile_.ProfileData.isDevAccount)
{
obj_Animals* obj = (obj_Animals*)srv_CreateGameObject("obj_Animals", "obj_Animals", plr->GetPosition());
obj->SetNetworkID(GetFreeNetId());
obj->NetworkLocal = true;
obj->hardObjLock = plr->GetSafeID();
obj->OnCreate();
}
obj_ServerPlayer.cpp
add
Code:
#include "ObjectsCode/sobj_Animals.h"
find
Code:
if(obj_ServerPlayer* targetPlr = IsServerPlayer(targetObj))
{
if(gServerLogic.ApplyDamageToPlayer(this, targetPlr, GetPosition()+r3dPoint3D(0,1,0), damage, n.hit_body_bone, n.hit_body_part, false, m_WeaponArray[m_SelectedWeapon]->getCategory()))
{
//HACK: track Kill here, because we can't pass weapon ItemID to ApplyDamageToPlayer yet
int isKill = ((obj_ServerPlayer*)targetObj)->loadout_->Alive == 0 ? 1 : 0;
gServerLogic.TrackWeaponUsage(m_WeaponArray[m_SelectedWeapon]->getConfig()->m_itemID, 0, 1, isKill);
}
}
add
Code:
else if(targetObj->Class->Name == "obj_Animals")
{
obj_Animals* animal = (obj_Animals*)targetObj;
animal->ApplyDamage(damage,this);
}
for spawn 1 animal per one zombiespawn
sobj_ZombieSpawn.cpp
add
Code:
#include "../sobj_Animals.h"
find
Code:
extern float _zai_MaxSpawnDelay;
if(zombieSpawnDelay > _zai_MaxSpawnDelay)
zombieSpawnDelay = _zai_MaxSpawnDelay;
GenerateNavPoints();
add
Code:
r3dPoint3D curpos = GetPosition();
r3dPoint3D pos;
if (GetFreeNavPointIdx(&pos,true,500,&curpos) != -1)
{
obj_Animals* obj = (obj_Animals*)srv_CreateGameObject("obj_Animals", "obj_Animals", pos);
obj->SetNetworkID(gServerLogic.GetFreeNetId());
obj->NetworkLocal = true;
obj->z = this;
obj->OnCreate();
}
Error 2 error C2601: 'ClientGameLogic::OnPKT_S2C_CreateAnimals' : local function definitions are illegal c:\WarZ\src\EclipseStudio\Sources\multiplayer\ClientGameLogic.cpp 953 Eclipse Studio
and another one in obj_animals
Search F: IMPL_PACKET_FUNC(ClientGameLogic, PKT_S2C_CheatWarning)
Code:[COLOR=#b22222]IMPL_PACKET_FUNC(ClientGameLogic, PKT_S2C_CreateAnimals){ r3dOutToLog("obj_Animals %d\n", n.spawnID); r3d_assert(GameWorld().GetNetworkObject(n.spawnID) == NULL); obj_Animals* obj = (obj_Animals*)srv_CreateGameObject("obj_Animals", "Data\\ObjectsDepot\\WZ_Animals\\char_deer_01.sco", n.spawnPos); [/COLOR][COLOR=#006400]//[/COLOR][COLOR=#b22222]obj->SetNetworkID(n.spawnID); [/COLOR][COLOR=#006400]//[/COLOR][COLOR=#b22222]obj->NetworkLocal = false; [/COLOR][COLOR=#006400]//[/COLOR][COLOR=#b22222]memcpy(&obj->CreateParams, &n, sizeof(n)); obj->OnCreate(); }[/COLOR]
Error 1 error C3861: 'UpdateAnimalsObstacle': identifier not found c:\WarZ\src\EclipseStudio\Sources\ObjectsCode\Gameplay\obj_Animals.cpp 315 Eclipse Studio
Search F:
Code:[B][COLOR=#b22222][I]UpdateAnimalsObstacle[/I][/COLOR][COLOR=#333333][I] to [/I][/COLOR][COLOR=#008000][I]//[/I][/COLOR][/B]
Help?
Erro 1 error LNK2001: unresolved external symbol "public: void __thiscall obj_Animals::ApplyDamage(float,class GameObject *)" (?ApplyDamage@obj_Animals@@QAEXMPAVGameObject@@@Z) c:\WarZ\bin\server\WO_GameServer\obj_ServerPlayer.obj 1 WarZ Game Server
Erro 2 fatal error LNK1120: 1 unresolved externals C:\WarZ\bin\server\Release\WZ_GameServer.exe WarZ Game Server
add to this
Source files
You must be registered to see links
Attachments
You must be registered for see attachments list
Last edited: