Jump to content

Walk Through Safezone Without Block


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Today i release a code which you can walk through safezone without block

 

Client Source:

 

GameLib

ActorInstance.h

// Search for:
		BOOL TestPhysicsBlendingCollision(CActorInstance & rVictim);

// Add under:
// #ifdef ENABLE_SAFEZONE_STOP_COLLISION
		BOOL IsInSafe(CActorInstance & ptr);
// #endif

 

ActorInstanceCollisionDetection.cpp

// Search for:
BOOL CActorInstance::TestActorCollision(CActorInstance & rVictim)

// Add before:
// #ifdef ENABLE_SAFEZONE_STOP_COLLISION
#include "../UserInterface/PythonBackground.h"

BOOL CActorInstance::IsInSafe(CActorInstance & ptr)
{
	const TPixelPosition& c_rkPPosCur = ptr.NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, (1 << 2)))
		return true;

	return false;
}
// #endif

// On CActorInstance::TestActorCollision
// Search for:
	if (rVictim.IsDead())
		return false;

// Add under:
// #ifdef ENABLE_SAFEZONE_STOP_COLLISION
	if (IsInSafe(rVictim))
		return false;
// #endif

 

Enjoy.

 

 

  • Metin2 Dev 12
  • Good 2
  • Love 19
Link to comment
Share on other sites

Thanks for release, but why you create a new bool for what? to look like more tutorial code? need only 3 lines.

	const TPixelPosition& c_rkPPosCur = NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
		return FALSE;

Also the check is already exist, just need to copy-paste check from:

bool CInstanceBase::IsInSafe() // InstanceBase.cpp

Original idea is from: Rubinum2.

PS: Here is nothing to coding, is just copy 3 lines from other part and put in this part. ", you just copy also them idea and + title name video from rubinum.  i will release a code of mine "

  • Metin2 Dev 1
Link to comment
Share on other sites

On 3/14/2017 at 11:50 PM, Tasho said:

Thanks for release, but why you create a new bool for what? to look like more tutorial code? need only 3 lines.


	const TPixelPosition& c_rkPPosCur = NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
		return FALSE;

Also the check is already exist, just need to copy-paste check from:


bool CInstanceBase::IsInSafe() // InstanceBase.cpp

Original idea is from: Rubinum2.

  Reveal hidden contents

 

 

I create a new bool because in my source i use more code from that what i share here.

I had coded this before a long time ago and i share it now, the idea is not coming from Rubinum2 but they have released a video and show this idea to the community before me.

  • Love 1
Link to comment
Share on other sites

19 minutes ago, Tasho said:

Thanks for release, but why you create a new bool for what? to look like more tutorial code? need only 3 lines.


	const TPixelPosition& c_rkPPosCur = NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
		return FALSE;

Also the check is already exist, just need to copy-paste check from:


bool CInstanceBase::IsInSafe() // InstanceBase.cpp

Original idea is from: Rubinum2.

PS: Here is nothing to coding, is just copy 3 lines from other part and put in this part. " i will release a code of mine "

 

 

Thanks, i will test.

 

https://metin2.download/picture/77BDf3N9AB8Rf6R97u2o2AA9xLKVefM9/.png

 

do i something wrong?, cause its not work.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
Link to comment
Share on other sites

7 minutes ago, daradevil124 said:

 

 

Thanks, i will test.

 

https://metin2.download/picture/77BDf3N9AB8Rf6R97u2o2AA9xLKVefM9/.png

 

do i something wrong?, cause its not work.

Download: 

This is the hidden content, please

download the file and follow the tutorial.

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 4
  • Good 3
  • Love 3
Link to comment
Share on other sites

9 minutes ago, Legend said:

Download: 

This is the hidden content, please

download the file and follow the tutorial.

Nice work now.

 

https://metin2.download/picture/g3go6G8JQpVxe4Y3hGdphOM0NtuUHHpX/.jpg

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • 8 months later...
La 14.03.2017 la 23:50, Tasho a spus:

Thanks for release, but why you create a new bool for what? to look like more tutorial code? need only 3 lines.


	const TPixelPosition& c_rkPPosCur = NEW_GetCurPixelPositionRef();
	if (CPythonBackground::Instance().isAttrOn(c_rkPPosCur.x, c_rkPPosCur.y, CTerrainImpl::ATTRIBUTE_BANPK))
		return FALSE;

Also the check is already exist, just need to copy-paste check from:


bool CInstanceBase::IsInSafe() // InstanceBase.cpp

Original idea is from: Rubinum2.

PS: Here is nothing to coding, is just copy 3 lines from other part and put in this part. ", you just copy also them idea and + title name video from rubinum.  i will release a code of mine "

Readability

Link to comment
Share on other sites

  • 2 years later...

Announcements



×
×
  • 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.