Jump to content

How To Fix uiQuest SetEvent Bug for Some People


Exygo

Recommended Posts

  • Active Member

Story: Over time I learned that the SetEvent function can cause weird problems in Metin2, maybe you have this bug or maybe not, I actually encountered this problem and found the fix.

How to trigger the bug:

1. Use this quest for a test:

quest test begin
	state start begin
		when 9003.chat."quest test" begin
			say("Hey we are doing a test here")
			local o = select("option 1","option 2")
			if o == 1 then
				return
			elseif o == 2 then
				return
			end
		end
	end
end

2. Now you click on the NPC, choose "quest test" option and don't click on any option(1,2)

3. /transfer your_character with another GM account

4. The character who clicked on "quest test" option and didn't choose any of the sub-options (1 or 2 ) will now have an invisible stucked window on the center and can't click on the ground or click the area in the center of the screen(where the quest ui was before teleportation)

 

How to fix it:

1. Go to uiQuest.py

2. In def MakeQuestion find the SetEvent functions and edit them as below:

	def MakeQuestion(self, n):
		global entire_questbutton_number
		global entire_questpage_number
		global cur_questpage_number
		entire_questpage_number = ((n-2)/7)+1
		entire_questbutton_number = n
		
		if not self.board:
			return

		self.btnAnswer = [self.MakeEachButton(i) for i in xrange (n)]
			
		import localeInfo
		self.prevbutton = self.MakeNextPrevPageButton()
		self.prevbutton.SetPosition(self.sx+self.board.GetWidth()/2-164, self.board.GetHeight()/2-16)
		self.prevbutton.SetText(localeInfo.UI_PREVPAGE)
		#self.prevbutton.SetEvent(self.PrevQuestPageEvent, 1, n) # buggy
		self.prevbutton.SAFE_SetEvent(self.PrevQuestPageEvent, 1, n) # unbuggy

		self.nextbutton = self.MakeNextPrevPageButton()
		self.nextbutton.SetPosition(self.sx+self.board.GetWidth()/2+112, self.board.GetHeight()/2-16)
		self.nextbutton.SetText(localeInfo.UI_NEXTPAGE)
		#self.nextbutton.SetEvent(self.NextQuestPageEvent, 1, n) # buggy
		self.nextbutton.SAFE_SetEvent(self.NextQuestPageEvent, 1, n) # unbuggy

		if cur_questpage_number != 1:
			cur_questpage_number = 1

Note: After that you should check for other SetEvent functions (comment them and see if the bug still happens)

Info: The bug has something to do with the function arguments

Other locations where this bug caused problems:

  • intrologin.py - can cause the arrow keys,enter,esc to not work in the select character phase

 

  • Metin2 Dev 3
  • Love 20
Link to comment
Share on other sites

  • 2 weeks later...
  • 6 months later...

That "bug" is because the quest window is not destroyed properly.

In interfaceModule.py search:
				eachQuestWindow.CloseSelf()
Replace with:
				eachQuestWindow.OnPressEscapeKey()

How to test that "bug". Press logout button and in those 3 seconds open a quest, when you login again you can't click in quest area but quest is not there.

  • Metin2 Dev 1
  • Love 3
Link to comment
Share on other sites

  • 3 months later...
On 1/11/2017 at 3:20 AM, Exygo said:

Story: Over time I learned that the SetEvent function can cause weird problems in Metin2, maybe you have this bug or maybe not, I actually encountered this problem and found the fix.

How to trigger the bug:

1. Use this quest for a test:


quest test begin
	state start begin
		when 9003.chat."quest test" begin
			say("Hey we are doing a test here")
			local o = select("option 1","option 2")
			if o == 1 then
				return
			elseif o == 2 then
				return
			end
		end
	end
end

2. Now you click on the NPC, choose "quest test" option and don't click on any option(1,2)

3. /transfer your_character with another GM account

4. The character who clicked on "quest test" option and didn't choose any of the sub-options (1 or 2 ) will now have an invisible stucked window on the center and can't click on the ground or click the area in the center of the screen(where the quest ui was before teleportation)

 

How to fix it:

1. Go to uiQuest.py

2. In def MakeQuestion find the SetEvent functions and edit them as below:


	def MakeQuestion(self, n):
		global entire_questbutton_number
		global entire_questpage_number
		global cur_questpage_number
		entire_questpage_number = ((n-2)/7)+1
		entire_questbutton_number = n
		
		if not self.board:
			return

		self.btnAnswer = [self.MakeEachButton(i) for i in xrange (n)]
			
		import localeInfo
		self.prevbutton = self.MakeNextPrevPageButton()
		self.prevbutton.SetPosition(self.sx+self.board.GetWidth()/2-164, self.board.GetHeight()/2-16)
		self.prevbutton.SetText(localeInfo.UI_PREVPAGE)
		#self.prevbutton.SetEvent(self.PrevQuestPageEvent, 1, n) # buggy
		self.prevbutton.SAFE_SetEvent(self.PrevQuestPageEvent, 1, n) # unbuggy

		self.nextbutton = self.MakeNextPrevPageButton()
		self.nextbutton.SetPosition(self.sx+self.board.GetWidth()/2+112, self.board.GetHeight()/2-16)
		self.nextbutton.SetText(localeInfo.UI_NEXTPAGE)
		#self.nextbutton.SetEvent(self.NextQuestPageEvent, 1, n) # buggy
		self.nextbutton.SAFE_SetEvent(self.NextQuestPageEvent, 1, n) # unbuggy

		if cur_questpage_number != 1:
			cur_questpage_number = 1

Note: After that you should check for other SetEvent functions (comment them and see if the bug still happens)

Info: The bug has something to do with the function arguments

Other locations where this bug caused problems:

  • intrologin.py - can cause the arrow keys,enter,esc to not work in the select character phase

 

https://metin2.download/picture/1k8elT1GJR9eS136n5KR9HhRwUYRDrUy/.png 

any idea ? 

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

Announcements



  • Similar Content

  • Similar Content

  • Similar Content

  • Tags

  • Activity

    1. 3

      Crystal Metinstone

    2. 3

      Feeding game source to LLM

    3. 113

      Ulthar SF V2 (TMP4 Base)

    4. 3

      Feeding game source to LLM

    5. 0

      Target Information System

    6. 3

      Feeding game source to LLM

    7. 2

      anti exp explanation pls

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.