• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Discussion: Aligning the health bar to the compass.

Shino

New member
I've written a small modlet that enables Target Health Bars because I like seeing how much dmg I make. 
I've also taken the liberty of deleting both the name and the hp values, leaving me with a beautiful red rectangle.

Problem is, I can't make it smaller than 280ish pixels and I want to align it to the compass so when a zombie's health appears, the compass will turn red acting as a makeshift container for the health. 
 

<configs>
<!-- Activate the Healthbar outside Deubg Mode -->
<set xpath="/windows/window[@name='windowTargetBar']/@visibility">always</set>

<!-- Adjust the shape of the healthbar -->
<set xpath="/windows/window[@name='windowTargetBar']/rect[1]/@pos">-200,-11</set>
<set xpath="/windows/window[@name='windowTargetBar']/rect[1]/@width">200</set> <!-- doesn't change below 280px -->
<set xpath="/windows/window[@name='windowTargetBar']/rect[1]/@height">39</set>

<!-- Remove all text -->
<removeattribute xpath="/windows/window[@name='windowTargetBar']/rect[1]/label/@text"></removeattribute>

</configs>



gets the HP bar looking like

image.png

This does the job but its ever so slightly bigger than the compass itself and it's bugging me a lot. Is there a way to make it so the healthbar shrinks below that 280px size?
Or maybe there is any better way to do what I did? Any tips are appreciated.

 
Back
Top