Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 08:56

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



pWorld->ADDOBJ Problem

Discussion on pWorld->ADDOBJ Problem within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
pWorld->ADDOBJ Problem

Hi elitepvpers,

With an lot of thanks from Alfredico i have created an new system.

However there is something i still cant wrap my head arround.

What i want to do is when an player has been moved to the map that its creating an Mover.

Code:
pMatch->CreateMover();
Code:
void CRiftMatch::CreateMover()
{
	vector<__RIFT_WORLD> vecWorld = CRiftMng::GetInstance()->m_vecRiftWorld;
	for (DWORD i = 0; i < vecWorld.size(); i++)
	{
		CWorld* pWorld = g_WorldMng.GetWorld(vecWorld.at(i).dwWorldID);
		if (!pWorld)
			continue;

		vector<__RIFT_MONSTER>::iterator it = CRiftMng::GetInstance()->m_vecMonster.begin();

		MoverProp* pMoverProp = prj.GetMoverPropEx((*it).dwId);
		if (pMoverProp && pMoverProp->dwID != 0)
		{
			CObj* pObj = CreateObj(D3DDEVICE, OT_MOVER, pMoverProp->dwID);
			if (NULL == pObj)
			{
				OUTPUTDEBUGSTRING("\nPobj is NULL");
				return;
			}
			pObj->SetPos((*it).vPos);
			pObj->InitMotion(MTI_STAND);
			pObj->UpdateLocalMatrix();

			((CMover*)pObj)->m_bActiveAttack = (*it).bRed;
			pWorld->ADDOBJ(pObj, TRUE, nDefaultLayer);
		}
		OUTPUTDEBUGSTRING("\nGetting WorldID and MoverID: WorldID = %d MoverID = %d\n", vecWorld.at(i).dwWorldID, (*it).dwId);
	}
}
Before you asking well is the mover existing
Yes it is existing

Cause i test it like this
Code:
void CRiftMatch::GetMover()
{
	vector<__RIFT_MONSTER> vecMon = CRiftMng::GetInstance()->m_vecMonster;
	for (int i = 0; i < vecMon.size(); i++)
	{
		OUTPUTDEBUGSTRING("\nGetMover: MoverId = %d nState = %d bRed = %d vPos = %d\n", vecMon.at(i).dwId, vecMon.at(i).nState, vecMon.at(i).bRed, vecMon.at(i).vPos);
	}
}
So when i enter the world i can see in debug modes that the mover is inside __RIFT_MONSTER.

I checked multiple snippets from other .cpp files and tested them out.
But for some reason it isn't spawning the mob.
raventh1984 is offline  
Old 12/04/2016, 15:42   #2
 
elite*gold: 0
Join Date: Mar 2008
Posts: 333
Received Thanks: 284
Spawn them on the correct layer
Nortix is offline  
Thanks
2 Users
Old 12/04/2016, 15:48   #3
 
elite*gold: 0
Join Date: Oct 2012
Posts: 948
Received Thanks: 157
Thanks haha. Didnt noticed it.

I had indeed defaultlayer.
But my layer was created by dwPlayerId.

Changed it its now working.
raventh1984 is offline  
Old 12/04/2016, 18:49   #4
 
elite*gold: 0
Join Date: Mar 2008
Posts: 665
Received Thanks: 230
The following part is unnecessary. Once in your system you select your world from the possible options, it should be saved somewhere.

Code:
vector<__RIFT_WORLD> vecWorld = CRiftMng::GetInstance()->m_vecRiftWorld;
	for (DWORD i = 0; i < vecWorld.size(); i++)
	{
		CWorld* pWorld = g_WorldMng.GetWorld(vecWorld.at(i).dwWorldID);
		if (!pWorld)
			continue;

On vector used for store monsters, the .begin() will always return you the first stored value on the vector, you need to loop to get all the monsters.


Code:
void CRiftMatch::CreateMover()
{
	CWorld* pWorld = g_WorldMng.GetWorld(__WORLD); //World member variable
	if(!pWorld || !pWorld->m_linkMap.GetLinkMap(_LINKMAP_ID)) //No need to continue if there is no linkmap
		return;
		
	vector<__RIFT_MONSTER>::iterator it = CRiftMng::GetInstance()->m_vecMonster.begin();
	for( ; it != CRiftMng::GetInstance()->m_vecMonster.end(); ++it)
	{
		CObj* pObj = CreateObj(D3DDEVICE, OT_MOVER, (*it).dwId);
		if(pObj == nullptr)
			return;
			
		pObj->SetPos((*it).vPos);
		pObj->InitMotion(MTI_STAND);
		pObj->UpdateLocalMatrix();

		((CMover*)pObj)->m_bActiveAttack = (*it).bRed;
		pWorld->ADDOBJ(pObj, TRUE, __LAYER); //Linkmap
	}
}

Edit: Forgot to tell, there is no need to check if MoverProp*, it is generated from the config files you write, it should exist.
alfredico is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
PWorld of Tanks ACC 45Tage Premium +5 Premium Panzer +6×Tier X
11/20/2014 - World of Tanks Trading - 0 Replies
* * *** * *Einmalige Chance SUPER CLAN ACC Verkaufe hier meinen WoT acc da ich vor kurem mein duales Studium begonnen habe und mehr zeit in andere dinge stecken will.Es ist sehr schwer mich von diesen acc zu trennen da ich viele schöne erinnerungen damit habe und schon SEHR viel geld investiert habe (ca.700Euro) ich würde mich sehr freuen wenn er weitergefürht wird. Hier ein paar daten: 64 Kasernen Betten *5 PREMIUM Panzer* 50 Tage Premium*
CWorld::AddObj error trotz allen models?
06/30/2013 - Flyff Private Server - 1 Replies
Ja hey, folgendes Problem. Habe grade flaris überarbeitet und bekomme nun laufend 2013/ 6/28 17:42:59 CWorld::AddObj world id:1 x:6960.070801 y:100.000000 z:3266.104248 usw kann jedoch nicht nachvollziehen wieso, models und texturen vom beast sind alle im server drinne.



All times are GMT +1. The time now is 08:56.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.