Jump to content

[Bug]Horse skill page


Recommended Posts

ezgif-1-c3f1f2a5611d.gif

 

The bug is:

When you have no selected skills (you used skill reset or you just haven't got picked up skills) you can see in uicharacter board at skillpage two buttons for example:

I have warrior character so I can see two skill pages Body & Mental buttons. When you have a horse level 21 or above (that means you can use horse skills) you can see only one skill page and second page is for horse skills here you should see Body & Mental buttons not Body & Horse skill buttons. Here must be something edited in uicharacter.py to see only character skills buttons until player select a skill group.

I will be glad if someone can fix it.

Thanks for answers!

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

  • Premium

I think you will need to make a new button that shows up when you have the horse skill using if self.__CanUseHorseSkill():

 

There is the function in uiCharacter.py

			if self.__CanUseHorseSkill():
				self.activeSkillGroupName.Hide()
				self.skillGroupButton1.SetText(nameList.get(group, "Noname"))
				self.skillGroupButton2.SetText(localeInfo.SKILL_GROUP_HORSE)
				self.skillGroupButton1.Show()
				self.skillGroupButton2.Show()

 

I will give it a try in about one hour.

 

Edit:

I manage to add the new page somehow. There is a bug i can't understand while selecting the pages. The bug comes from __SelectSkillGroup function which i don't know how it works :D 

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

 

uiCharacter.py:

From PAGE_HORSE = 2 to PAGE_HORSE = 3

 

Find: self.skillGroupButton2 = None

Add after: self.skillGroupButton3 = None

 

Find: self.skillGroupButton2 = self.GetChild("Skill_Group_Button_2")

Add after: self.skillGroupButton3 = self.GetChild("Skill_Group_Button_3")

 

In self.skillGroupButton = ( find :

self.GetChild("Skill_Group_Button_2"),

Add below:

self.GetChild("Skill_Group_Button_3"),

 

Replace the def __SetSkillGroupName(self, race, group): function with this:

	def __SetSkillGroupName(self, race, group):

		job = chr.RaceToJob(race)

		if not self.SKILL_GROUP_NAME_DICT.has_key(job):
			return

		nameList = self.SKILL_GROUP_NAME_DICT[job]

		if 0 == group:
			self.skillGroupButton1.SetText(nameList[1])
			self.skillGroupButton2.SetText(nameList[2])
			
			if self.__CanUseHorseSkill():
				self.skillGroupButton3.SetText(localeInfo.SKILL_GROUP_HORSE)
				self.skillGroupButton3.Show()
				self.skillGroupButton3.SetPosition(95, 2)
			else:
				self.skillGroupButton3.Hide()
				
			self.skillGroupButton1.Show()
			self.skillGroupButton2.Show()
			self.activeSkillGroupName.Hide()
		else:

			if self.__CanUseHorseSkill():
				self.activeSkillGroupName.Hide()
				self.skillGroupButton1.SetText(nameList.get(group, "Noname"))
				self.skillGroupButton3.SetText(localeInfo.SKILL_GROUP_HORSE)
				self.skillGroupButton1.Show()
				self.skillGroupButton2.Hide()
				self.skillGroupButton3.Show()
				self.skillGroupButton3.SetPosition(50, 2)

			else:
				self.activeSkillGroupName.SetText(nameList.get(group, "Noname"))
				self.activeSkillGroupName.Show()
				self.skillGroupButton1.Hide()
				self.skillGroupButton2.Hide()
				self.skillGroupButton3.Hide()

uiscript/characterdetails.py

Find:

								{
									"name" : "Skill_Group_Button_2",
									"type" : "radio_button",

									"x" : 50,
									"y" : 2,

									"text" : "Group2",
									"text_color" : 0xFFFFE3AD,

									"default_image" : "d:/ymir work/ui/game/windows/skill_tab_button_01.sub",
									"over_image" : "d:/ymir work/ui/game/windows/skill_tab_button_02.sub",
									"down_image" : "d:/ymir work/ui/game/windows/skill_tab_button_03.sub",
								},

Add below:

								##horse skill page
								{
									"name" : "Skill_Group_Button_3",
									"type" : "radio_button",

									"x" : 95,
									"y" : 2,

									"text" : "Group3",
									"text_color" : 0xFFFFE3AD,

									"default_image" : "d:/ymir work/ui/game/windows/skill_tab_button_01.sub",
									"over_image" : "d:/ymir work/ui/game/windows/skill_tab_button_02.sub",
									"down_image" : "d:/ymir work/ui/game/windows/skill_tab_button_03.sub",
								},

 

Sorry if i couldn't do the job, im a beginner. I thought it's easier but it seems not.

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

  • Forum Moderator
On 2/15/2020 at 1:23 PM, Anix said:

Sorry if i couldn't do the job, im a beginner. I thought it's easier but it seems not.

On 2/15/2020 at 5:56 PM, ergod said:

@VegaS™ maybe can you help us? :D

 

 

im here GIF by Leroy Patterson

 

The basic changes are:

From:

	def __SelectSkillGroup(self, index):
		for btn in self.skillGroupButton:
			btn.SetUp()
		self.skillGroupButton[index].Down()

		if self.__CanUseHorseSkill():
			if 0 == index:
				index = net.GetMainActorSkillGroup()-1
			elif 1 == index:
				index = self.PAGE_HORSE

		self.curSelectedSkillGroup = index
		self.__SetSkillSlotData(net.GetMainActorRace(), index+1, net.GetMainActorEmpire())

To:

This is the hidden content, please

 

After some minutes of debugging I rewrote this shit, there're more changes, when i'll have some free time (at Monday), i'll post the code.

Without skill group +/- horse riding:

With skill group +/- horse riding:

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

5 hours ago, VegaS™ said:

 

im here GIF by Leroy Patterson

 

The basic changes are:

From:


	def __SelectSkillGroup(self, index):
		for btn in self.skillGroupButton:
			btn.SetUp()
		self.skillGroupButton[index].Down()

		if self.__CanUseHorseSkill():
			if 0 == index:
				index = net.GetMainActorSkillGroup()-1
			elif 1 == index:
				index = self.PAGE_HORSE

		self.curSelectedSkillGroup = index
		self.__SetSkillSlotData(net.GetMainActorRace(), index+1, net.GetMainActorEmpire())

To:


	def __SelectSkillGroup(self, pageIndex, (PAGE_SKILL_1, PAGE_SKILL_2, PAGE_SKILL_HORSE) = range(3)):
		for pageButton in self.skillGroupButton:
			pageButton.SetUp()

		self.skillGroupButton[pageIndex].Down()

		if pageIndex in (PAGE_SKILL_1, PAGE_SKILL_2):
			skillGroupIndex = net.GetMainActorSkillGroup()
			if bool(skillGroupIndex):
				(tmpCurSkillGroup, tmpSkillGroup) = (skillGroupIndex - 1, skillGroupIndex)
			else:
				(tmpCurSkillGroup, tmpSkillGroup) = (pageIndex, pageIndex + 1)

			self.curSelectedSkillGroup = tmpCurSkillGroup
			self.__SetSkillSlotData(net.GetMainActorRace(), tmpSkillGroup, net.GetMainActorEmpire())

		elif pageIndex == PAGE_SKILL_HORSE and self.__CanUseHorseSkill():
			self.curSelectedSkillGroup = self.PAGE_HORSE

		self.RefreshSkill()

 

After some minutes of debugging I rewrote this shit, there're more changes, when i'll have some free time (at Monday), i'll post the code.

Without skill group +/- horse riding:

With skill group +/- horse riding:

 

Vegas our hero :D thank you!

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

  • 3 years later...
  • Premium
On 2/16/2020 at 4:06 AM, VegaS™ said:

 

im here GIF by Leroy Patterson

 

The basic changes are:

From:

	def __SelectSkillGroup(self, index):
		for btn in self.skillGroupButton:
			btn.SetUp()
		self.skillGroupButton[index].Down()

		if self.__CanUseHorseSkill():
			if 0 == index:
				index = net.GetMainActorSkillGroup()-1
			elif 1 == index:
				index = self.PAGE_HORSE

		self.curSelectedSkillGroup = index
		self.__SetSkillSlotData(net.GetMainActorRace(), index+1, net.GetMainActorEmpire())

To:

 

Hidden Content

 

	def __SelectSkillGroup(self, pageIndex, (PAGE_SKILL_1, PAGE_SKILL_2, PAGE_SKILL_HORSE) = range(3)):
		for pageButton in self.skillGroupButton:
			pageButton.SetUp()

		self.skillGroupButton[pageIndex].Down()

		if pageIndex in (PAGE_SKILL_1, PAGE_SKILL_2):
			skillGroupIndex = net.GetMainActorSkillGroup()
			if bool(skillGroupIndex):
				(tmpCurSkillGroup, tmpSkillGroup) = (skillGroupIndex - 1, skillGroupIndex)
			else:
				(tmpCurSkillGroup, tmpSkillGroup) = (pageIndex, pageIndex + 1)

			self.curSelectedSkillGroup = tmpCurSkillGroup
			self.__SetSkillSlotData(net.GetMainActorRace(), tmpSkillGroup, net.GetMainActorEmpire())

		elif pageIndex == PAGE_SKILL_HORSE and self.__CanUseHorseSkill():
			self.curSelectedSkillGroup = self.PAGE_HORSE

		self.RefreshSkill()

 

 

 

After some minutes of debugging I rewrote this shit, there're more changes, when i'll have some free time (at Monday), i'll post the code.

Without skill group +/- horse riding:

With skill group +/- horse riding:

Did you post this fix full?

plague.png.1f5de75b42146262dcd655a5a8078

Link to comment
Share on other sites

  • 2 weeks later...

As vegas fix is not complete, i quickly made up this shit that at least works, i will rewrite it when i have some time:

	def __SelectSkillGroup(self, pageIndex):
		for pageButton in self.skillGroupButton:
			pageButton.SetUp()

		self.skillGroupButton[pageIndex].Down()

		if self.__CanUseHorseSkill():
			if 0 == pageIndex:
				pageIndex = net.GetMainActorSkillGroup()-1
			elif 1 == pageIndex:
				pageIndex = self.PAGE_HORSE
		else:
			skillGroupIndex = net.GetMainActorSkillGroup()
			if bool(skillGroupIndex):
				(tmpCurSkillGroup, tmpSkillGroup) = (skillGroupIndex - 1, skillGroupIndex)
			else:
				(tmpCurSkillGroup, tmpSkillGroup) = (pageIndex, pageIndex + 1)

		if self.__CanUseHorseSkill():
			self.curSelectedSkillGroup = pageIndex
			self.__SetSkillSlotData(net.GetMainActorRace(), pageIndex+1, net.GetMainActorEmpire())
		else:
			self.curSelectedSkillGroup = tmpCurSkillGroup
			self.__SetSkillSlotData(net.GetMainActorRace(), tmpSkillGroup, net.GetMainActorEmpire())

		self.RefreshSkill()

 

LE: We maybe need 3rd button because you will not be able to use horse skills if you have them when no skill group selected

Edited by [TiTAN]
Link to comment
Share on other sites

  • Premium

Thanks

  

On 7/15/2023 at 3:42 PM, [TiTAN] said:

As vegas fix is not complete, i quickly made up this shit that at least works, i will rewrite it when i have some time:

	def __SelectSkillGroup(self, pageIndex):
		for pageButton in self.skillGroupButton:
			pageButton.SetUp()

		self.skillGroupButton[pageIndex].Down()

		if self.__CanUseHorseSkill():
			if 0 == pageIndex:
				pageIndex = net.GetMainActorSkillGroup()-1
			elif 1 == pageIndex:
				pageIndex = self.PAGE_HORSE
		else:
			skillGroupIndex = net.GetMainActorSkillGroup()
			if bool(skillGroupIndex):
				(tmpCurSkillGroup, tmpSkillGroup) = (skillGroupIndex - 1, skillGroupIndex)
			else:
				(tmpCurSkillGroup, tmpSkillGroup) = (pageIndex, pageIndex + 1)

		if self.__CanUseHorseSkill():
			self.curSelectedSkillGroup = pageIndex
			self.__SetSkillSlotData(net.GetMainActorRace(), pageIndex+1, net.GetMainActorEmpire())
		else:
			self.curSelectedSkillGroup = tmpCurSkillGroup
			self.__SetSkillSlotData(net.GetMainActorRace(), tmpSkillGroup, net.GetMainActorEmpire())

		self.RefreshSkill()

 

LE: We maybe need 3rd button because you will not be able to use horse skills if you have them when no skill group selected

Solved, by mistake i have edited this row and forget to remove it: 

 

Edited by DemOnJR

plague.png.1f5de75b42146262dcd655a5a8078

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.