Jump to content

Recommended Posts

  • Former Staff

Here's the correct guide on how2 pickup motion.

 

Spoiler

170805FvBkd.png.86125ec966a2052a3cb9c17c

 

Firstly go to UserInterface/PythonCharacterModule.cpp and search for:

    PyModule_AddIntConstant(poModule, "NEW_AFFECT_DRAGON_SOUL_QUALIFIED",        CInstanceBase::NEW_AFFECT_DRAGON_SOUL_QUALIFIED);

add this function under it:

    PyModule_AddIntConstant(poModule, "MOTION_PICK_UP",                        CRaceMotionData::NAME_PICK_UP);

 

 

 

Secondly go to UserInterface/PythonPlayerInput.cpp and search for:

void CPythonPlayer::PickCloseItem()

  add this function:

    pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);

 

 

 

Thirdly go  to GameLib/ActorInstanceMotion.cpp and search for:

        case CRaceMotionData::NAME_SLAP_HURT_WITH_SHAMAN:

add this function under it:

        case CRaceMotionData::NAME_PICK_UP:

 

 

 

Fourthly go to GameLib/RaceManager.cpp and search for:

        s_kMap_stType_dwIndex.insert(std::map<std::string, DWORD>::value_type("SKILL5", CRaceMotionData::NAME_SKILL+125));
add this function under it:
        s_kMap_stType_dwIndex.insert(std::map<std::string, DWORD>::value_type("PICK_UP", CRaceMotionData::NAME_PICK_UP));
 

 

 

Fifthly go to GameLib/RaceMotionData.cpp and search for:

        case NAME_DIG:

add this function under it:

        case NAME_PICK_UP:

 

 

 

 

Sixthly go to GameLib/RaceMotionData.h and search for:

            NAME_JOY,

add this function under it:

            NAME_PICK_UP,

 

Compile it and you're good to go.

 

Now to finish this tutorial, go to root/playersettingmodule.py and search for:

def SetGeneralMotions(mode, folder):

add this function:

    chrmgr.RegisterCacheMotionData(mode,        chr.MOTION_PICK_UP,                "pick_up.msa")

 

Tutorial finished, have fun.

  • Love 11
Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/
Share on other sites

  • Premium

the problem is , this not really good for metin2

becous there too many items drops by mobs - stone ...

so every time when u want pick up the item it will take time , so this is very borring

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-46997
Share on other sites

  • Former Staff

the problem is , this not really good for metin2

becous there too many items drops by mobs - stone ...

so every time when u want pick up the item it will take time , so this is very borring

​​Yeah...

That's why they don't use this, probably.

But if you click z many times, for example, the speed is the same as if you haven't this, but he looks like having an epileptic seizure.

Edited by Shisui
  • Love 2
Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-47001
Share on other sites

  • 1 month later...
  • 3 months later...

I prefer add that

 

if (pkInstMain->IsAttacking()){ // if the player attack

        }
        else{ // if the player don't attack
            pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);
        }

Because use SPACE and Z at the same time, it's a very good usebug for speed attack x)

Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-57625
Share on other sites

  • Premium
if (!__IsPlayerAttacking())
           pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);
22 minutes ago, Roxas07 said:

I prefer add that

 

if (pkInstMain->IsAttacking()){ // if the player attack

        }
        else{ // if the player don't attack
            pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);
        }

Because use SPACE and Z at the same time, it's a very good usebug for speed attack x)

It's completely untested but I think that the following code is maybe better

if (!__IsPlayerAttacking())
           pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);

Or maybe this one :

if (!pkInstMain->IsAttacking())
              pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);

But it's untested and it'll probably won't work as I don't know if "__IsPlayerAttacking" is declared or if the "!" must be placed before "pkInstMain" or before "IsAttacking()"

 

  • Love 1
Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-57628
Share on other sites

  • 2 months later...
  • 2 months later...
  • 2 years later...
  • Active+ Member

@EnKor It's a simple thing, you have to add the command to server source, then you simply call it by type this command in a chat. You can try to search on another forums, just type in google search somehing like: metin 2 add new emotion, animation. I believe you'll find some tutorial which you can follow to make a new command that you can call.

  • Love 1

I'll be always helpful!  😉

Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-113730
Share on other sites

  • Premium
6 hours ago, ReFresh said:

@EnKor It's a simple thing, you have to add the command to server source, then you simply call it by type this command in a chat. You can try to search on another forums, just type in google search somehing like: metin 2 add new emotion, animation. I believe you'll find some tutorial which you can follow to make a new command that you can call.

thankyou. i make it ;)

if pc.get_sex() == true and npc.get_sex() == false then
	npc.purge()
end

 

Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-113734
Share on other sites

  • 4 years later...
  • Active+ Member

Hello, just to confirm that the above change is working. I've just tested it. the other two things provided are failing the build tho. But yea, with the below change (provided above in comments) you can avoid the Atack speed animation glitch / bug / exploit. 

 

if (!pkInstMain->IsAttacking()) pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);

Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-163003
Share on other sites

  • 7 months later...
  • Active+ Member

Coming back here with a solution for PickUP motion Spamming: 

 

Spoiler
void CPythonPlayer::PickCloseItem()
{
	static DWORD lastPickUpTime = 0;
	DWORD currentTime = GetTickCount();  // Get current system time (in milliseconds)

	CInstanceBase* pkInstMain = NEW_GetMainActorPtr();
	if (!pkInstMain)
		return;

	// 1000 milliseconds = 1 second delay to avoid retriggering the animation too soon
	if (!pkInstMain->IsAttacking() && (currentTime - lastPickUpTime > 1000))
	{
		pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);
		lastPickUpTime = currentTime;  // Update the last pick-up time
	}

	// Get the pixel position of the main character
	TPixelPosition kPPosMain;
	pkInstMain->NEW_GetPixelPosition(&kPPosMain);

	// Try to get the closest item
	DWORD dwItemID;
	CPythonItem& rkItem = CPythonItem::Instance();
	if (!rkItem.GetCloseItem(kPPosMain, &dwItemID, __GetPickableDistance()))
		return;

	// Send the click item packet to pick the item
	SendClickItemPacket(dwItemID);
}

 

Now, the animation is not playing until is finished. also, does not affect the Pickup trigger (You can spam the Z or ~ button). 

I've made this to work along with this release(Holding Z for Pickup): 

 Here's the final result when holding Z: https://metin2.download/picture/Mum9DcVS9tS1odgXzdMSyoEPS5c65Hfn/.gif (Similar result if you spam Z)

Of course, you can added other conditions like "IsWalking" and so on, to play the motion only if the character is staying and not running. 

Edited by Metin2 Dev International
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-166952
Share on other sites

Thanks, I used another kind of fix I made years ago, which was similar to the one in the post, I'm still trying to get the function to be seen in another client, since it is only seen, for those who use the effect, I have tried copying other emotions from 0, and modifying several parts of the client src but so far without success, the truth that I like this kind of old contributions! 🤩

KH.jpg

Nicks: Nazox™ Krone™ Nagato™ Yahiko™ Yakiro™
Proyecto: Trabajando en el.
Compañeros & firma: DreamHQ  - 2009-2015 [Nostalgia]

Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-166976
Share on other sites

  • Active+ Member
On 9/11/2024 at 5:21 PM, KolenMG said:

Coming back here with a solution for PickUP motion Spamming: 

 

  Hide contents
void CPythonPlayer::PickCloseItem()
{
	static DWORD lastPickUpTime = 0;
	DWORD currentTime = GetTickCount();  // Get current system time (in milliseconds)

	CInstanceBase* pkInstMain = NEW_GetMainActorPtr();
	if (!pkInstMain)
		return;

	// 1000 milliseconds = 1 second delay to avoid retriggering the animation too soon
	if (!pkInstMain->IsAttacking() && (currentTime - lastPickUpTime > 1000))
	{
		pkInstMain->GetGraphicThingInstancePtr()->InterceptOnceMotion(CRaceMotionData::NAME_PICK_UP);
		lastPickUpTime = currentTime;  // Update the last pick-up time
	}

	// Get the pixel position of the main character
	TPixelPosition kPPosMain;
	pkInstMain->NEW_GetPixelPosition(&kPPosMain);

	// Try to get the closest item
	DWORD dwItemID;
	CPythonItem& rkItem = CPythonItem::Instance();
	if (!rkItem.GetCloseItem(kPPosMain, &dwItemID, __GetPickableDistance()))
		return;

	// Send the click item packet to pick the item
	SendClickItemPacket(dwItemID);
}

 

Now, the animation is not playing until is finished. also, does not affect the Pickup trigger (You can spam the Z or ~ button). 

I've made this to work along with this release(Holding Z for Pickup): 

 Here's the final result when holding Z: https://metin2.download/picture/Mum9DcVS9tS1odgXzdMSyoEPS5c65Hfn/.gif (Similar result if you spam Z)

Of course, you can added other conditions like "IsWalking" and so on, to play the motion only if the character is staying and not running. 

10 minutes ago I've found another bug (I hope is the last one). 

https://metin2.download/picture/RCPx86i9W2605oCb055cpEz4FH0oHGq7/.gif

In the fix that I've provided above, change 

 if (!pkInstMain->IsAttacking() && (currentTime - lastPickUpTime > 1000))

into the below

if (!pkInstMain->IsAttacking() && !pkInstMain->IsMountingHorse() && !(pkInstMain->IsFishing()) && (currentTime - lastPickUpTime > 1000))

I starting to think is not the best aesthetic solution since the line is starting to go bigger. but for above, I added fix for when you are mounted AND when you are fishing.  

Edited by KolenMG
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/7472-how-to-use-pickup-motion/#findComment-167038
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.