Jump to content

Party Member Tracking On Minimap


Recommended Posts

  • VIP

Thanks for sharing, as always!
You could also check the position realtime while the player is in range so it updates faster.

fd9f73513d76c3345150fd5e24b8ee9f.gif

/// 1. @ UserInterface/PythonMiniMap.cpp
// Search @ void CPythonMiniMap::RenderAtlas
				const auto& PartyInfo = it->second;
				__GlobalPositionToAtlasPosition(PartyInfo->lX - m_dwAtlasBaseX, PartyInfo->lY - m_dwAtlasBaseY, &PartyInfo->fScreenX, &PartyInfo->fScreenY);

// Replace with
				long xPos = PartyInfo->lX;
				long yPos = PartyInfo->lY;

				CInstanceBase* pkInst = CPythonCharacterManager::Instance().GetInstancePtrByName(pPartyMemberInfo->strName.c_str());
				if (pkInst)
				{
					TPixelPosition kInstPos;
					pkInst->NEW_GetPixelPosition(&kInstPos);
					xPos = kInstPos.x + m_dwAtlasBaseX;
					yPos = kInstPos.y + m_dwAtlasBaseY;

				}

				__GlobalPositionToAtlasPosition(xPos - m_dwAtlasBaseX, yPos - m_dwAtlasBaseY, &PartyInfo->fScreenX, &PartyInfo->fScreenY);

 

  • Metin2 Dev 2
  • Love 5
  • Love 2
  • Good 2
Link to post

Thank you! :D

In PythonMiniMap.cpp there are 2 of these:

	m_AtlasMarkInfoVectorIterator = m_AtlasWarpInfoVector.begin();
	while (m_AtlasMarkInfoVectorIterator != m_AtlasWarpInfoVector.end())
	{
		...
	}

 

Should I add this under both of them or only one? If one which one? first or second? thanks

#if defined(__BL_PARTY_POSITION__)
	for (const auto& PartyInfo : mAtlasPartyPlayerMark)
	{
		const float fffx = static_cast<float>(PartyInfo.second->lX) - static_cast<float>(m_dwAtlasBaseX);
		const float fffy = static_cast<float>(PartyInfo.second->lY) - static_cast<float>(m_dwAtlasBaseY);

		if (fffx - fCheckWidth / 2 < fRealX && fffx + fCheckWidth > fRealX &&
			fffy - fCheckWidth / 2 < fRealY && fffy + fCheckHeight > fRealY)
		{
			rReturnString = PartyInfo.second->sName;
			*pReturnPosX = fffx;
			*pReturnPosY = fffy;
			*pdwTextColor = CInstanceBase::GetIndexedNameColor(CInstanceBase::NAMECOLOR_PARTY);
			return true;
		}
	}
#endif

 

Link to post
  • 3 weeks later...
On 4/17/2021 at 10:47 PM, Owsap said:

Thanks for sharing, as always!
You could also check the position realtime while the player is in range so it updates faster.

fd9f73513d76c3345150fd5e24b8ee9f.gif

/// 1. @ UserInterface/PythonMiniMap.cpp
// Search @ void CPythonMiniMap::RenderAtlas
				const auto& PartyInfo = it->second;
				__GlobalPositionToAtlasPosition(PartyInfo->lX - m_dwAtlasBaseX, PartyInfo->lY - m_dwAtlasBaseY, &PartyInfo->fScreenX, &PartyInfo->fScreenY);

// Replace with
				long xPos = PartyInfo->lX;
				long yPos = PartyInfo->lY;

				CInstanceBase* pkInst = CPythonCharacterManager::Instance().GetInstancePtrByName(pPartyMemberInfo->strName.c_str());
				if (pkInst)
				{
					TPixelPosition kInstPos;
					pkInst->NEW_GetPixelPosition(&kInstPos);
					xPos = kInstPos.x + m_dwAtlasBaseX;
					yPos = kInstPos.y + m_dwAtlasBaseY;

				}

				__GlobalPositionToAtlasPosition(xPos - m_dwAtlasBaseX, yPos - m_dwAtlasBaseY, &PartyInfo->fScreenX, &PartyInfo->fScreenY);

 

don't work, can u please fix it?

Link to post
  • VIP

thanks for sharing!

Its not working for me...

everything builded without any error.

syserr clean

Any help please?

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.