Jump to content

Recommended Posts

  • Honorable Member

This is the hidden content, please

This is the hidden content, please

.jpg

Synchronizes the character's position with the server and can be used to free them if they get stuck.
If there is no available position within the available distance, the character will be warped to the village. 

.

  • Metin2 Dev 154
  • Eyes 2
  • Scream 1
  • Good 27
  • Love 9
  • Love 70
Link to comment
https://metin2.dev/topic/32048-escape-unstuck-option/
Share on other sites

Thanks @ Owsap i'm fixing button, but work, nice released thanks!

72ab56fbbb38c99dbb9714cf355fd310.gif

edit1: if someone don't have 

Quote

    def __del__(self):
        ui.ScriptWindow.__del__(self)
        if app.OWSAP_ESCAPE:
            del self.tooltip

you cand add on def Destroy:

Quote

    def Destroy(self):
        self.ClearDictionary()
        
        if self.gameOptionDlg:
            self.gameOptionDlg.Destroy()
            
        if self.systemOptionDlg:
            self.systemOptionDlg.Destroy()
       if app.OWSAP_ESCAPE:     
             del self.tooltip

        self.__Initialize()

 

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Metin2 Dev 1
  • Love 2

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/32048-escape-unstuck-option/#findComment-162454
Share on other sites

  • Honorable Member
18 minutes ago, nazox said:

Thanks @ Owsap i'm fixing button, but work, nice released thanks!

I just updated the repository, there was one thing missing for the button to work, everything should be fine now.

Edited by Owsap
  • Love 1
Link to comment
https://metin2.dev/topic/32048-escape-unstuck-option/#findComment-162455
Share on other sites

MIssing some functions that are used by uiEscapePopup.py
uicommon.py

class QuestionDialog(ui.ScriptWindow):

	def GetTextSize(self):
		if self.textLine:
			return self.textLine.GetTextSize()

		return (0,0)
              
	def SetLineHeight(self, Height):
		self.textLine.SetLineHeight(Height)

also player.SHOW_UI_WINDOW_LIMIT_RANGE is missing

	def __EscapePopupRangeCheck(self):
		SHOW_UI_WINDOW_LIMIT_RANGE = 1000
		(x, y, z) = player.GetMainCharacterPosition()
		# if abs(x - self.escape_window_open_x) > player.SHOW_UI_WINDOW_LIMIT_RANGE or abs(y - self.escape_window_open_y) > player.SHOW_UI_WINDOW_LIMIT_RANGE:
		if abs(x - self.escape_window_open_x) > SHOW_UI_WINDOW_LIMIT_RANGE or abs(y - self.escape_window_open_y) > SHOW_UI_WINDOW_LIMIT_RANGE:
			chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_ESCAPE_FAR_DISTANCE)
			self.Close()

 

Link to comment
https://metin2.dev/topic/32048-escape-unstuck-option/#findComment-162460
Share on other sites

Hello again @ Owsap again thanks for the system work very great:

fc6d205ac5ea8186b845c079bdd97ff4.gif

But maybe people have a few problems, because don't have functions or like that.

The first, you need to change certain functions as mentioned @Dominic. in Uicommon.py:

Spoiler

class QuestionDialog(ui.ScriptWindow): def GetTextSize(self): if self.textLine: return self.textLine.GetTextSize() return (0,0) def SetLineHeight(self, Height): self.textLine.SetLineHeight(Height)

and uiEscapePopoup.py:

Spoiler

def __EscapePopupRangeCheck(self): SHOW_UI_WINDOW_LIMIT_RANGE = 1000 (x, y, z) = player.GetMainCharacterPosition() # if abs(x - self.escape_window_open_x) > player.SHOW_UI_WINDOW_LIMIT_RANGE or abs(y - self.escape_window_open_y) > player.SHOW_UI_WINDOW_LIMIT_RANGE: if abs(x - self.escape_window_open_x) > SHOW_UI_WINDOW_LIMIT_RANGE or abs(y - self.escape_window_open_y) > SHOW_UI_WINDOW_LIMIT_RANGE: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OPTION_ESCAPE_FAR_DISTANCE) self.Close()

If you have the problem with 

Spoiler

net.SendCommandPacket("/escape")

Change with:

Spoiler

net.SendChatPacket("/escape")

If you lost some functions like (SetLineHeight, GetLineHeight, etc) you need add the system (or functions) from here:

 

(you can use this version or @ Mali version).

Thanks again :).

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Love 1

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/32048-escape-unstuck-option/#findComment-162476
Share on other sites

  • Honorable Member

Repository Updated

Changed QuestionDialog to QuestionDialog2.

This change is due to the multi-line token which is not supported by all clients.
To improve compatibility, the dialog message has been split into two tokens.
The issue with the player's distance while the dialogue is open has also been fixed.

Thanks for testing and reporting back.

I recommend taking a look at all the code in the repository as I amended some issues on the first commit.

Edited by Owsap
  • Metin2 Dev 13
  • Love 6
Link to comment
https://metin2.dev/topic/32048-escape-unstuck-option/#findComment-162481
Share on other sites

  • 2 months later...

Those function are doing the same thing?

bool CPythonPlayer::IsDead()
{
	CInstanceBase* pMainInstance = CPythonCharacterManager::Instance().GetMainInstancePtr();
	if (!pMainInstance)
		return false;

	return pMainInstance->IsDead();
}

bool CPythonPlayer::IsPoly()
{
	CInstanceBase* pMainInstance = CPythonCharacterManager::Instance().GetMainInstancePtr();
	if (!pMainInstance)
		return false;

	return pMainInstance->IsPoly();
}

 

Link to comment
https://metin2.dev/topic/32048-escape-unstuck-option/#findComment-164108
Share on other sites

  • 3 months later...
  • Bot

So, i did everything correctly and this happens.

No syserr.

38 minutes ago, Doose said:

So, i did everything correctly and this happens.

No syserr.

It seems i forgot 1 thing, it's good now.

Edited by Metin2 Dev International
Core X - External 2 Internal

english_banner.gif

Link to comment
https://metin2.dev/topic/32048-escape-unstuck-option/#findComment-166038
Share on other sites

  • 2 weeks later...
  • Honorable Member
20 hours ago, WeedHex said:

Is it supposed to work also in dungeons?

I honestly don't know, I haven't gotten around testing this on the official server, but if it's not supposed to work in dungeons you can simply add the dungeon check before the process of finding a new position.

Example

	// ¸ðµç private ¸ÊÀ¸·Ð ¿öÇÁ ºÒ°¡´É
	if (ch->GetDungeon() || ch->GetMapIndex() > 10000)
		return;

But it's worth remembering that there is still a possibility of getting stuck in dungeons too.

  • Good 1
Link to comment
https://metin2.dev/topic/32048-escape-unstuck-option/#findComment-166215
Share on other sites

  • 4 months later...

m_dwLastPlay is not in my char.cpp. How i add the code now?

This is the text from my client syserr. Client close self after login when he should choose the char. I am very interested in python but a beginner. Please can anyone help me?. 

1212 09:04:10360 :: 
networkModule.py(line:208) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:30) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:25) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
uiSystem.py(line:1) <module>

networkModule.SetSelectCharacterPhase - <type 'exceptions.NameError'>:name 'app' is not defined

1212 09:04:10360 :: ============================================================================================================
1212 09:04:10360 :: Abort!!!!

Edited by thelittlemarkus
Link to comment
https://metin2.dev/topic/32048-escape-unstuck-option/#findComment-168605
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.