Jump to content

[Request]ui.Gauge improvement


Recommended Posts

Hello together,

because im not that good with Python im gonna ask you guys if somebody can help me to archive this: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif
It's a nice simpel improvment for the gauge in my opinion.

If you agree with me let me knew about it and maybe help me out.

Thanks in advance

Tryn

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 18
  • kekw 1
  • Dislove 1
  • Not Good 1
  • Good 1
  • Love 5
Link to comment
Share on other sites

  • Bronze

 

En 9/9/2018 a las 20:34, Tryn dijo:

Hello together,

because im not that good with Python im gonna ask you guys if somebody can help me to archive this: https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif
It's a nice simpel improvment for the gauge in my opinion.

If you agree with me let me knew about it and maybe help me out.

Thanks in advance

Tryn

U mean this right?

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

 

Well i did this:

Onupdate:

		if self.max_hp > self.actual_hp:
			if app.GetTime() > self.time:
				self.max_hp -= 1
				dbg.TraceError(str(self.actual_hp)+"_"+str(self.max_hp))
				self.hpGauge.SetPercentage(self.max_hp, 100)
				self.time = app.GetTime() + 0.005

def sethp
 

	def SetHP(self, hpPercentage):
		if not self.hpGauge.IsShow():
		
			self.SetSize(200 + 7*self.nameLength, self.GetHeight())
			self.name.SetHorizontalAlignCenter()
			self.name.SetWindowHorizontalAlignCenter()
			self.name.SetPosition(0, 8)
			self.hpGauge.SetWindowHorizontalAlignCenter()
			self.hpGauge.SetPosition(0, 23)
			self.hpGauge.Show()
			self.percent.Show()
			self.UpdatePosition()
			self.max_hp = hpPercentage
	
		self.hpGauge.SetPercentage(hpPercentage, 100)
		self.actual_hp = hpPercentage

 

def init

		self.actual_hp = 0
		self.max_hp = 100
		self.time = 0

I did this fast, if it's bugged i dont know but if u find a bug, tell me.

 

You can play with this code, example: if the difference is too high u can make the hp goes faster and if the difference is not too much goes slower.

Good luck

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

vor einer Stunde schrieb ѕeмa™:

 

U mean this right?

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

 

Well i did this:

Onupdate:


		if self.max_hp > self.actual_hp:
			if app.GetTime() > self.time:
				self.max_hp -= 1
				dbg.TraceError(str(self.actual_hp)+"_"+str(self.max_hp))
				self.hpGauge.SetPercentage(self.max_hp, 100)
				self.time = app.GetTime() + 0.005

def sethp
 


	def SetHP(self, hpPercentage):
		if not self.hpGauge.IsShow():
		
			self.SetSize(200 + 7*self.nameLength, self.GetHeight())
			self.name.SetHorizontalAlignCenter()
			self.name.SetWindowHorizontalAlignCenter()
			self.name.SetPosition(0, 8)
			self.hpGauge.SetWindowHorizontalAlignCenter()
			self.hpGauge.SetPosition(0, 23)
			self.hpGauge.Show()
			self.percent.Show()
			self.UpdatePosition()
			self.max_hp = hpPercentage
	
		self.hpGauge.SetPercentage(hpPercentage, 100)
		self.actual_hp = hpPercentage

 

def init


		self.actual_hp = 0
		self.max_hp = 100
		self.time = 0

I did this fast, if it's bugged i dont know but if u find a bug, tell me.

 

You can play with this code, example: if the difference is too high u can make the hp goes faster and if the difference is not too much goes slower.

Good luck

Its close to that im searching for. If you look at my gif in the first post u can see there is a small effect which shows the gauge in an other color for an moment. But thanks anyways!
 

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

  • Bronze

Im im not wrong, the "effect" is just another gauge image red with the last 2 pixel in orange and when the hp is moving the gauge change the color and when it stops, change again to the red, so with my code you shoul be able to do it.

Will be something like this but instead green orange red only red and when is decreasing red+orange and then just red

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

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

Hm but it turns orange when the dmg get in. And it stops when there is no dmg. They didnt change it just at the end, like yours. It works for the full gaugebar.

I think it works like this:

1. DMG gets in.
2. The Red-Gaugebar gets removed
3. The Orange-Gaugebar appears where the red is gone
4. The Orange-Gaugebar moves slowly (like in your first exampel) until it completly disappears. (The range how much of the orange-bar should disappear is constantly updating because if more dmg gets in the orange bar gets "longer".

I hope you can understand what i mean.

Link to comment
Share on other sites

  • 1 month later...
Dnia 11.09.2018 o 5:46 PM, ѕeмa™ napisał:

 

U mean this right?

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

 

Well i did this:

Onupdate:


		if self.max_hp > self.actual_hp:
			if app.GetTime() > self.time:
				self.max_hp -= 1
				dbg.TraceError(str(self.actual_hp)+"_"+str(self.max_hp))
				self.hpGauge.SetPercentage(self.max_hp, 100)
				self.time = app.GetTime() + 0.005

def sethp
 


	def SetHP(self, hpPercentage):
		if not self.hpGauge.IsShow():
		
			self.SetSize(200 + 7*self.nameLength, self.GetHeight())
			self.name.SetHorizontalAlignCenter()
			self.name.SetWindowHorizontalAlignCenter()
			self.name.SetPosition(0, 8)
			self.hpGauge.SetWindowHorizontalAlignCenter()
			self.hpGauge.SetPosition(0, 23)
			self.hpGauge.Show()
			self.percent.Show()
			self.UpdatePosition()
			self.max_hp = hpPercentage
	
		self.hpGauge.SetPercentage(hpPercentage, 100)
		self.actual_hp = hpPercentage

 

def init


		self.actual_hp = 0
		self.max_hp = 100
		self.time = 0

I did this fast, if it's bugged i dont know but if u find a bug, tell me.

 

You can play with this code, example: if the difference is too high u can make the hp goes faster and if the difference is not too much goes slower.

Good luck

.....py ?

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

  • Bronze
hace 14 minutos, Legend dijo:

You mean this right? https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

 

If u are interesting you can buy it from me contact me at skype for more informations.

Are u really going to sell that????
You can extract from aeldra client....

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

15 minutes ago, ѕeмa™ said:

Well your gift look the same as aeldra, so... you could code a new one or "steal" it and sell it, who knows...

And yes, other people maybe want to buy it because they dont know how to get it for free

Anyway, i wont keep going with this, good luck both of you.

A lot of things look the same this don't mean is the same code, whatever.

Link to comment
Share on other sites

Am 6.11.2018 um 20:02 schrieb Legend:

You mean this right? https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

 

If u are interesting you can buy it from me contact me at skype for more informations.

its public google at it

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

  • 11 months later...

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.