Send a data to Client

11/13/2016 20:00 firesqual#1
Hello guys,

I'm trying to develop a new system. My system works like that : A chest spawn which give some loots. I want to make a certain zone around it PvP, i tried to take the Arena system, it works, but when i want to take the positions of the chests, it can't take it, because client don't have the chest ID.

What i'm asking is how to send the CCtrl m_objid value to the client so it will be able to know which ID have the chest and then allow to take the positions of it ?

I tried to add this :

ar << g_WarChestMng.m_pWarChest->m_objid;

to ObjSerializeOpt.cpp in void CObj::Serialize( CAr & ar ) function, but it only broke my server xD

If you guys could help me there ! Thanks alot
11/15/2016 11:56 alfredico#2
I don't understand. Try a better explanation and the use of CObj::Serialize seems wrong to me.
11/15/2016 12:52 firesqual#3
I'm trying to make the area around the chest PvP. But the chest can spawn at different places.

So i need to get the Chest ID to allow PvP around it client side.. I'm trying to send the objid to the client, but can't make it works
11/15/2016 13:32 alfredico#4
Couldn't figure out right now a way to do as you want.

Some idea I had:

Add this to a function like bool CMover::IsChestPvpZone(CMover* pMover)

FOR_LINKMAP(GetWorld(), GetPos(), pObj, nRange, CObj::linkDynamic, nLayer)
{
if(pObj->GetType() == CHEST)
{
//Set PvP to true or whatever (position coordinates I think). In range return true and not range return false
}
}
END_LINKMAP

And then add to PK zones check.
11/15/2016 19:19 firesqual#5
But doing like this will not make it work for every different positions of the chest, right ?
11/15/2016 21:09 alfredico#6
If there is a chest it will be a pvp zone.
11/16/2016 01:50 firesqual#7
Only around the chest even if the chest is at different places ?
11/16/2016 08:52 alfredico#8
Quote:
Originally Posted by alfredico View Post
If there is a chest it will be a pvp zone.
Please.
11/16/2016 14:27 firesqual#9
Sorry, my last comment was a bug xD Thanks guys anyway, i'll try this out ;)
11/18/2016 17:24 firesqual#10
Hello back guys, i have some news. Its still not working, and i can't figure out why.
It seems like the client can't get the Chest because if i remove the RETURN FALSE after the if( pObj ) verification, it works but everywhere in map :/

Here is my BOOL CMover::IsWarChestTarget( CMover* pMover )


And here is my chest spawn function :