energy bar (and other bars...)

Talk about Severance Blade of Darkness modifications and maps here. No tips or tech support questions please, use the forum above. Note that the game is rated 18 so some content may be unsuitable for younger readers.

Moderators: Ade, prospero

User avatar
cieply
Dragon
Posts: 327
Joined: Wed Jun 26, 2013 3:43 pm

energy bar (and other bars...)

Postby cieply » Wed Jun 26, 2013 3:52 pm

## energy bar mod
it would be nice to see actual amount of energy not just the max one so I did the mod:

@ $BOD/Lib/Scorer.py

after
``wEnergyBar.AddLabel(wEnergyMaxLabel,7,0.5,
(...)
)
''
--- @ line 422

Code: Select all

##i1: wEnergyLabel wEnergyLabel=WidgetsExtra.B_FlashTextWidget(wEnergyBar,"EnergyLabel","100",ScorerWidgets.font_server,"../../Data/Mapa de letras.bmp") wEnergyLabel.SetColor(0,255,128) #wEnergyLabel.SetColor(0,255,128) wEnergyLabel.SetAlpha(1) wEnergyLabel.SetVisible(1) #wEnergyBar.AddLabel(wEnergyLabel,0.4,0.5, # przesunięcie? X (w prawo), Y (w dół) (jednostka to chyba szerokość i wysokość etykiety wEnergyBar.AddLabel(wEnergyLabel,0.125,0.4, BUIx.B_Widget.B_LAB_HCenter, BUIx.B_Widget.B_LAB_VCenter, BUIx.B_Widget.B_FR_HRelative, BUIx.B_Widget.B_FR_HCenter, BUIx.B_Widget.B_FR_VRelative, BUIx.B_Widget.B_FR_VCenter )
---

after
``wEnergyMaxLabel.SetAutoScale(1)''
--- @ line 698

Code: Select all

##i1: wEnergyLabel wEnergyLabel.SetAutoScale(1)
---

function ``def SetEnergyBarValue(v, max_v):''
--- @ line 885

Code: Select all

def SetEnergyBarValue(v, max_v): wStrengthBar.SetVisible(0) if VISIBLE: wEnergyBar.SetVisible(1) pos= min(max(v/max_v, 0),1.0) wEnergyBar.SetPositionPercentage(pos*(6.5/8.0)) ##i1: wEnergyLabel: round current energy and display if v<max_v: if abs(v)<100: nrgy=(int(v)/1)*1 elif abs(v)<1000: nrgy=(int(v)/10)*10 elif abs(v)<10000: nrgy=(int(v)/100)*100 else: nrgy=(int(v)/1000)*1000 else: nrgy=int(max_v) # wEnergyLabel.SetText(`nrgy`) # wEnergyMaxLabel.SetText(`max_v`) wEnergyLabel.SetVisible(0) wEnergyMaxLabel.SetText(`nrgy`) wEnergyBar.RecalcLabelLayout(BUIx.B_Widget.B_LAB_Left,BUIx.B_Widget.B_LAB_VCenter) if pos<=ENERGY_LOW_LEVEL: wDangerLabel.SetFlash(14) wDangerLabel.SetVisible(1) # wEnergyLabel.SetVisible(0) else: wDangerLabel.SetVisible(0) # wEnergyLabel.SetVisible(1)
---

and analogic changes for $BOD/Lib/NetScorer.py

question is: how to make it a mod so original files are not changed but function/s (``SetEnergyBarValue(v, max_v)'') are modified
in other worlds how to not alter original files and still use it
Last edited by cieply on Mon Jul 15, 2013 2:47 pm, edited 1 time in total.
l'aria fresca,
vino puro, ...

User avatar
MBK_MBK
Dragon
Posts: 390
Joined: Sun Jun 19, 2011 9:06 am
Location: Spain
Contact:

Re: energy bar

Postby MBK_MBK » Wed Jun 26, 2013 5:19 pm

Hello Cieply, Wellcome :D

Good idea, I'll try it. Many thanks! :mrgreen:

About the question:
I am also developing my mod, modifying the original files. I also had the same question as you, but I guess it would be easier to copy the entire file, including your modifications. And then make a mod, that make a backup of the original files in another directory, and then, replace the original files for your mod files.

I have seen several mods that do it. I think it is necessary to know the path of the files, according to the version of each language (Spanish or English).

Surely, for example Sir Random or Prospero, could talk to you about how to make the code of your mod. 8)

Greetings :mrgreen:
Loose your ghosts, because they keep suspiciously your freedom.

User avatar
cieply
Dragon
Posts: 327
Joined: Wed Jun 26, 2013 3:43 pm

Re: energy bar

Postby cieply » Fri Jun 28, 2013 1:27 pm

Good idea, I'll try it.
you should, it works. First I tried to put that label inside a bar and it worked as well, you can see that in code if you read it carefully, but I decided to put into maximal value place. Feel free to experiment.
I guess it would be easier to copy the entire file, including your modifications. And then make a mod, that make a backup of the original files in another directory, and then, replace the original files for your mod files.
well, I don't know, ideally it should be done the way that I could install mod and disable without uninstalling and not to "spoil" original files cause it should not interfere with other mods.

btw. I'm not that good with creating mods with bodloader but I'm working on it
l'aria fresca,
vino puro, ...

User avatar
MBK_MBK
Dragon
Posts: 390
Joined: Sun Jun 19, 2011 9:06 am
Location: Spain
Contact:

Re: energy bar

Postby MBK_MBK » Sat Jun 29, 2013 5:34 am

well, I don't know, ideally it should be done the way that I could install mod and disable without uninstalling and not to "spoil" original files cause it should not interfere with other mods.
Yes, you're right... to replace the original files can result conflicts with other mods. I do not know how to do it, might work if another mod not coincides to modify the same files. :( Because of this same type of problem, my mod is not compatible with BodLoader.

I hope that Prospero or Sir Random can help you soon ...
First I tried to put that label inside a bar and it worked as well, you can see that in code if you read it carefully, but I decided to put into maximal value place. Feel free to experiment.
Great, when I have more free time I'll try. :)
I would add a score, which indicate how much experience provided the enemies, and how much experience remains to increase level. :idea: When kill an enemy, something like this: +150 xp. Get 1350xp for next level.
And counter points, which add up how many damage points have inflicted, and add up all the enemies you've killed. As my mod is "Expert difficulty", there are hundreds of enemies ... 8) But I don´t know how to do it. :(


Greetings. :mrgreen:
Loose your ghosts, because they keep suspiciously your freedom.

User avatar
cieply
Dragon
Posts: 327
Joined: Wed Jun 26, 2013 3:43 pm

Re: energy bar

Postby cieply » Tue Jul 02, 2013 2:42 pm

I would add a score, which indicate how much experience provided the enemies, and how much experience remains to increase level. When kill an enemy, something like this: +150 xp. Get 1350xp for next level.
And counter points, which add up how many damage points have inflicted, and add up all the enemies you've killed. As my mod is "Expert difficulty", there are hundreds of enemies ... But I don´t know how to do it.
> something like this: +150 xp.
it should be at the monster icon and only problem is to make actual label, all data are in $BOD/Stats/CharData.py

i'll think of it, it shouldn't be difficult
l'aria fresca,
vino puro, ...

User avatar
MBK_MBK
Dragon
Posts: 390
Joined: Sun Jun 19, 2011 9:06 am
Location: Spain
Contact:

Re: energy bar

Postby MBK_MBK » Wed Jul 03, 2013 4:11 pm

it should be at the monster icon and only problem is to make actual label, all data are in $BOD/Stats/CharData.py

i'll think of it, it shouldn't be difficult
It sounds great! Thank you very much! :D
I added a different ending, depending on the difficulty you choose, with a message saying: "Congratulations newbie, but you should play on expert difficulty," or "Congratulations warrior, you has proven to be a master."
The adder of points will be another incentive to kill many orcs ... 8) :lol:

Greetings :mrgreen:
Loose your ghosts, because they keep suspiciously your freedom.

User avatar
cieply
Dragon
Posts: 327
Joined: Wed Jun 26, 2013 3:43 pm

Re: energy bar

Postby cieply » Wed Jul 10, 2013 1:36 pm

i've started and tried to show experience reward in down, right corner of monster icon (below level) and game hangs just at start

$ cd Lib/Widgets
$ patch -i ScorerWidgets.py.diff


--- cut ScorerWidgets.py.diff ---

Code: Select all

diff -rup ScorerWidgets.py,oryg ScorerWidgets.py --- ScorerWidgets.py,oryg 2001-01-11 12:21:06.000000000 +0100 +++ ScorerWidgets.py 2013-07-10 08:28:56.000000000 +0200 @@ -409,7 +409,17 @@ if netgame.GetNetState() == 0: BUIx.B_Widget.B_FR_Right,BUIx.B_Widget.B_FR_Right, BUIx.B_Widget.B_FR_AbsoluteTop,BUIx.B_Widget.B_FR_Top ) - + + ###i1: + wEnemyExpRewardLabel=BUIx.B_TextWidget(wEnemy,RootName+"ExpRewardLabel","8",font_server,"../../Data/Mapa de letras.bmp") + wEnemyExpRewardLabel.SetColor(0,159,220) + wEnemyExpRewardLabel.SetAlpha(0.5) + wEnemy.AddLabel(wEnemyExpRewardLabel,1,0, + BUIx.B_Widget.B_LAB_HCenter,BUIx.B_Widget.B_LAB_VCenter, + BUIx.B_Widget.B_FR_Right,BUIx.B_Widget.B_FR_Right, + BUIx.B_Widget.B_FR_AbsoluteBottom,BUIx.B_Widget.B_FR_Bottom + ) + ### wEnemyLifeBar=WidgetsExtra.B_FlashBarWidget(wEnemy,RootName+"LifeBar",32,5) wEnemyLifeBar.SetFlashColor(53, 141, 36) wEnemyLifeBar.SetColor(255,0,0)
--- EOF cut ---

don't know how to dump console log to file because game crashes at loading and disappears with console so I don't know what is happening - can't see any error message
l'aria fresca,
vino puro, ...

User avatar
cieply
Dragon
Posts: 327
Joined: Wed Jun 26, 2013 3:43 pm

how to make smooth level bar faster when loading game?

Postby cieply » Mon Jul 15, 2013 2:57 pm

I tried to remove level bar increasing at load game (it doesn't happen with other bars), it annoys me and i'd like to make it more "normal" - just remove this effect (perfectly at load game only not in general)
I thought it's in class B_SmoothBarWidget(BUIx.B_BarWidget): @ Lib/Widgets/ScorerWidgets.py
but I don't understand it actually and what I've done

--- cut in Lib/Widgets/ScorerWidgets.py

Code: Select all

class B_SmoothBarWidget(BUIx.B_BarWidget): def __init__(self,parent,name,width,height): BUIx.B_BarWidget.__init__(self,parent,name,width,height) self.interpolator=Interpolator.Interp("interp"+name,0) self.Updating=0 self.CurrentTarget=self.GetPosition() def SetPosition(self,pos,smooth=1): currpos=self.GetPosition() if currpos==pos: return if smooth: if self.Updating==1: if self.CurrentTarget!=pos: #Si ya estß actualizando y recibe una nueva peticiˇn para otra posiciˇn # Trata de atenderla mßs tarde ###i1: #Bladex.AddScheduledFunc(Bladex.GetTime()+1.5,self.SetPosition,(pos,1)) Bladex.AddScheduledFunc(Bladex.GetTime()+0.01,self.SetPosition,(pos,1)) # this i guess is adjournment #self.SetPosition(pos,1) print "Postponed SetPosition",pos,smooth return else: self.Updating=1 self.CurrentTarget=pos now=Bladex.GetTime() #print "Updating level bar: now:",now,"pos:",pos,"currpos:",currpos m_interp=BarIncClass(currpos,pos,self) ###i1: #self.interpolator.AddAction(now,now+1.5,m_interp) self.interpolator.AddAction(now,now+0.01,m_interp) # but this... have no idea else: BUIx.B_BarWidget.SetPosition(self,pos) def FinalUpdate(self): self.Updating=0 BUIx.B_BarWidget.SetPosition(self,self.CurrentTarget)
--- EOF cut

all I achieved is to make it faster in general which means getting experience it increasing bar instantly not gradually like originally

if nothing more I'd like to make it yet starting from value of 0% not 100%
which would be improvement but this is a mystery for me
l'aria fresca,
vino puro, ...


Return to “Severance BoD: Modding Community”

Who is online

Users browsing this forum: No registered users and 2 guests

cron