Jump to content

Monsters Health in Percentage


Recommended Posts

M2 Download Center

This is the hidden content, please
( Internal )

Hey,

 

I'd like to release the following modification for monsters targetboards:

 

Spoiler

17262017FEh.png.e04d67f62c4ffffa9d1182e6

 

How to add:

 

open uiTarget.py

search for

def __init__(self):

and add under

		hpGauge = ui.Gauge()
		hpGauge.SetParent(self)
		hpGauge.MakeGauge(130, "red")
		hpGauge.Hide()
		hpPercenttxt = ui.TextLine()
		hpPercenttxt.SetParent(self)
		hpPercenttxt.SetPosition(160, 13)
		hpPercenttxt.SetText("")
		hpPercenttxt.Hide()

Search for 

		self.name = name
		self.hpGauge = hpGauge

and add under this

		self.hpPercenttxt = hpPercenttxt

Search

def Destroy(self):

add it under

self.hpPercenttxt = None

Search

def ResetTargetBoard(self):

Find

self.hpGauge.Hide()

add it under

self.hpPercenttxt.Hide()

Now search for

def SetHP(self, hpPercentage):

and add under

			self.UpdatePosition()
			self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-205, 13)
			self.hpPercenttxt.Show()

and under 

		self.hpGauge.SetPercentage(hpPercentage, 100)
		self.hpPercenttxt.SetText("%d%%" % (hpPercentage))

Have fun!

  • Metin2 Dev 31
  • Think 1
  • Confused 1
  • Good 8
  • Love 1
  • Love 27
Link to comment
Share on other sites

0705 18:46:27105 ::   File "game.py", line 1088, in SetHPTargetBoard

0705 18:46:27105 ::   File "uiTarget.py", line 338, in SetHP

0705 18:46:27105 :: AttributeError
0705 18:46:27105 :: : 
0705 18:46:27105 :: 'TargetBoard' object has no attribute 'hpPercenttxt'
0705 18:46:27105 :: 

Under

self.name = name

add this

self.hpPercenttxt = hpPercenttxt

 

  • Love 1
Link to comment
Share on other sites

0705 20:58:26508 :: Traceback (most recent call last):

0705 20:58:26508 ::   File "networkModule.py", line 247, in SetGamePhase

0705 20:58:26508 ::   File "game.py", line 126, in __init__

0705 20:58:26508 ::   File "uiTarget.py", line 156, in __init__

0705 20:58:26509 :: NameError
0705 20:58:26509 :: : 
0705 20:58:26509 :: global name 'hpPercenttxt' is not defined
0705 20:58:26509 :: 

Link to comment
Share on other sites

It works, but buggy.

Select a mob, then select a player, and the percent appers too. But the value is not true, and the position in under the player's name.

Well if you have a gauge on PvP players you have to check if the opponent is a pvp instance:

like this

			self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-205, 13)
			self.hpPercenttxt.Show()
			if player.IsPVPInstance(self.vid):
				self.hpPercenttxt.Hide()

 

Link to comment
Share on other sites

  • Silver

I tried, problem still there.

Not only in pvp, see:

My uitarget.py: http://pastebin.com/mcjucf92

 

Search

def Destroy(self):

add it under

self.hpPercenttxt = None

 

Search

def ResetTargetBoard(self):

Find

self.hpGauge.Hide()

add it under

self.hpPercenttxt.Hide()

 

Edited by Koray
  • Love 2
Link to comment
Share on other sites

I tried, problem still there.

Not only in pvp, see:

My uitarget.py: http://pastebin.com/mcjucf92

 

Search

def Destroy(self):

add it under

self.hpPercenttxt = None

 

Search

def ResetTargetBoard(self):

Find

self.hpGauge.Hide()

add it under

self.hpPercenttxt.Hide()

 

I am sorry, I just forgot to write it in this topic. I did it in my code but forgot to edit it here.

  • Love 1
Link to comment
Share on other sites

  • 4 months later...

Hey guys :) Great tut but:

Spoiler

1204 07:22:27048 :: Traceback (most recent call last):

1204 07:22:27049 ::   File "networkModule.py", line 253, in SetGamePhase

1204 07:22:27049 ::   File "game.py", line 112, in __init__

1204 07:22:27049 ::   File "uiTarget.py", line 47, in __init__

1204 07:22:27049 ::   File "ui.py", line 128, in SetParent

1204 07:22:27049 :: AttributeError
1204 07:22:27049 :: : 
1204 07:22:27049 :: 'TargetBoard' object has no attribute 'hWnd'
1204 07:22:27049 :: 

1204 07:23:59110 :: Exception 
1204 07:23:59110 :: exceptions.AttributeError
1204 07:23:59110 :: : 
1204 07:23:59110 :: "'TargetBoard' object has no attribute 'hWnd'"
1204 07:23:59110 ::  in 
1204 07:23:59110 :: <bound method TargetBoard.__del__ of <uiTarget.TargetBoard object at 0x0F24BE10>>
1204 07:23:59110 ::  ignored

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
On 05.07.2015 at 7:03 PM, DasSchwarzeT said:

Hey,

Bu konuya göre:

Ben canavarlar targetboards için aşağıdaki değişikliği serbest İstediklerim:

17FEh.png

Nasıl eklemek için:

Açık uiTarget.py

aramak


ve altına eklediğiniz


 

 

Aramak 


		

ve bu altına eklediğiniz


		

Arama


 

altında ekleyin


 

 

Arama


 

Bulmak


altında ekleyin


Şimdi orada aramak


 

ve altına eklediğiniz


			

			   
			

altında 


		 

		  

Şimdi bitirdiniz ve gibi görünmelidir:

lipBb.png

 

İyi eğlenceler

https://metin2.download/picture/1234aFn4rApRNL0AgV55C4p1Ah9KDXTP/.png :S 

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

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.