Jump to content
Korean Random
Sign in to follow this  
Ress

Need help with TeamHP PoolBar

Recommended Posts

I am trying to create Team HP Pool Bar without extra py_macros.
So far so good, but i hit the wall with actual direction of bars. :confused:
Can't figure out how to make bars fade in one direction only (from left to right for allies/from right to left for enemy) and not from both sides.

Any suggestions?
battleLabelsTeamHPBar.xc
1.jpg.9c0f006aeea34f832501de0093cfba06.jpg

Share this post


Link to post

Short link
Share on other sites

Here is mine, thx to MarsOne, he made it:

 

"TEAM_HP_bar": {
      "enabled": true,
      "updateEvent": "PY(ON_UPDATE_HP)",
      "x": -1010,   // "-{{py:sum(50,{{py:xvm.screenHCenter}})}}",
      "y": 32,
      "w": "{{py:xvm.total_hp.ally(240)}}",
      "h": 26,
      "screenHAlign": "right",
      "alpha": 75,
      "bgColor": "{{.colors.system.ally_alive}}"
    },
    "ENEMY_HP_bar": {
      "enabled": true,
      "updateEvent": "PY(ON_UPDATE_HP)",
      "x": 1010,   // "{{py:sum(50,{{py:xvm.screenHCenter}})}}",
      "y": 32,
      "w": "{{py:xvm.total_hp.enemy(240)}}",
      "h": 26,
      "screenHAlign": "left",
      "alpha": 75,
      "bgColor": "{{.colors.system.enemy_alive}}"
    },

value x -1010 and x 1010 is for 1920x1080 resolution, for other resolution use the py:sum or change it to your own value.

Share this post


Link to post

Short link
Share on other sites
1 hour ago, Heliomalt said:

value x -1010 and x 1010 is for 1920x1080 resolution, for other resolution use the py:sum or change it to your own value.


Personally avoiding to use high x-y off screen positioning,because i share config with friends that play on lower res.

As for sum with screenHCenter, initially i did found older topic with almost same macro but couldn't make it work (enemy bar was on left, and when added screenHalign:center, it was centered but then everything else was on opposite side...i was staring on macro for like 10min couldn't figure out what was wrong :facepalmic:..),
so i switched to regular x-y with screenH/Valign and got new issues.

49 minutes ago, ktulho said:


Huh interesting, now this actually works.
...had to correct enemy bar to x180 {{py:math.sum({{py:math.div({{py:xvm.total_hp.enemy(180)}},2)}}, 4)}}, but it work.
finally.thumb.jpg.50497415930799b4e2af07edf3175c66.jpg
Thanks @ktulho!:honoring:

Share this post


Link to post

Short link
Share on other sites

This is the complete script, it works for me and others, maybe this help someone else:

 

    "TEAM_ENEMY_HP_ground": {
      "enabled": true,
      "x": 0,
      "y": 32,
      "w": 100,
      "h": 26,
      "screenHAlign": "center",
      "alpha": 20,
      "bgColor": "#333333"
    },
    "TEAM_HP_ground": {
      "enabled": true,
      "x": -170,
      "y": 32,
      "w": 240,
      "h": 26,
      "screenHAlign": "center",
      "alpha": 50,
      "bgColor": "#333333"
    },
    "ENEMY_HP_ground": {
      "enabled": true,
      "x": 170,
      "y": 32,
      "w": 240,
      "h": 26,
      "screenHAlign": "center",
      "alpha": 50,
      "bgColor": "#333333"
    },
    "TEAM_HP_bar": {
      "enabled": true,
      "updateEvent": "PY(ON_UPDATE_HP)",
      "x": -1010,   // "-{{py:sum(50,{{py:xvm.screenHCenter}})}}",
      "y": 32,
      "w": "{{py:xvm.total_hp.ally(240)}}",
      "h": 26,
      "screenHAlign": "right",
      "alpha": 75,
      "bgColor": "{{.colors.system.ally_alive}}"
    },
    "ENEMY_HP_bar": {
      "enabled": true,
      "updateEvent": "PY(ON_UPDATE_HP)",
      "x": 1010,   // "{{py:sum(50,{{py:xvm.screenHCenter}})}}",
      "y": 32,
      "w": "{{py:xvm.total_hp.enemy(240)}}",
      "h": 26,
      "screenHAlign": "left",
      "alpha": 75,
      "bgColor": "{{.colors.system.enemy_alive}}"
    },
    "TEAM_HP_border": {
      "enabled": true,
      "x": -170,
      "y": 32,
      "w": 240,
      "h": 26,
      "screenHAlign": "center",
      "alpha": 100,
      "borderColor": "#FFFFFF"
    },
    "ENEMY_HP_border": {
      "enabled": true,
      "x": 170,
      "y": 32,
      "w": 240,
      "h": 26,
      "screenHAlign": "center",
      "alpha": 100,
      "borderColor": "#FFFFFF"
    },
    "TEAM_ENEMY_HP_diff": {
      "enabled": true,
      "updateEvent": "PY(ON_UPDATE_HP)",
      "x": 0,
      "y": 35,
      "screenHAlign": "center",
      "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 },
      "textFormat": { "size": 13, "bold": "true" },
      "format": "{{py:xvm.total_hp.ally>{{py:xvm.total_hp.enemy}}?+{{py:sub({{py:xvm.total_hp.ally}}, {{py:xvm.total_hp.enemy}})}}|{{py:sub({{py:xvm.total_hp.ally}}, {{py:xvm.total_hp.enemy}})}}}}"
    },
    "TEAM_HP": {
      "enabled": true,
      "updateEvent": "PY(ON_UPDATE_HP)",
      "x": -170,
      "y": 33,
      "screenHAlign": "center",
      "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 },
      "textFormat": { "size": 16, "bold": true },
      "format": "{{py:xvm.total_hp.ally}}"
    },
    "ENEMY_HP": {
      "enabled": true,
      "updateEvent": "PY(ON_UPDATE_HP)",
      "x": 170,
      "y": 33,
      "screenHAlign": "center",
      "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 },
      "textFormat": { "size": 16, "bold": true },
      "format": "{{py:xvm.total_hp.enemy}}"
    },
    "mainGun": {
      "enabled": true,
      "updateEvent": "PY(ON_UPDATE_HP)",
//      "hotKeyCode": 56,
//      "onHold": true,
      "x": 320,
      "y": 5,
      "screenHAlign": "center",
      "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 },
      "textFormat": { "size": 15, "align": "center" },
      "format": "<textformat tabstops='[125]' leading='-22' ><img src='img://gui/maps/icons/achievement/32x32/mainGun.png' width='24' height='24'>\n<tab>{{l10n:mainGun}}: <font color='#FFCC33'><b>{{py:xvm.total_hp.mainGun('',{{py:xvm.totalDamage}})}}</b></font></textformat>"
    },

Share this post


Link to post

Short link
Share on other sites

would need some help with HP team pool bar   after last stable XVM update, pool hp graphics is messed like in picture (impossible to play, because graphic is covering whole display, I dont remeber anymore where did I pick that graphics config, somewhere from this xvm forum-. Anyone knows what I have to fix?

 

 

shot_006.thumb.jpg.68ff6648cde88f590b3c3d3999ff373a.jpg

shot_040.jpg

Edited by Andyss

Share this post


Link to post

Short link
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...