Jump to content
Korean Random
locorebelde

help with battle_templates.xc

Recommended Posts

hello, I want to know how to add to my file labeltemplates the following codes:
{{py: xvm.totalDamagesBlocked}}
{{py: xvm.totalDamagesAssist}}
{{py: xvm.totalDamagesBlockedAssist}}
{{py: xvm.totalDamagesBlockedReceived}}

 

ej. y have in label_templates  the following code for assisted damage:

"totalAssist": {
      "enabled": true,
      "hotKeyCode": 56, "onHold": "true", "visibleOnHotKey": false,
      "updateEvent": "PY(ON_TOTAL_EFFICIENCY), ON_PANEL_MODE_CHANGED",
      "x": "{{py:math.sum({{pp.widthLeft}},80)}}",
      "y": "{{py:xvm.screenHeight<950?{{py:math.sub({{py:xvm.screenHeight}}, 100)}}|0}}",
      "alpha": "{{py:xvm.totalAssist>0?100|60}}",
      "width": 70,
      "height": 35,
      "screenHAlign": "{{py:xvm.screenWidth>1701?left|center}}",
      "textFormat": {"color": "{{py:xvm.totalAssist>0?0xFFCC66|0xFFFFFF}}","font": "$TitleFont", "size": 20, "align": "left", "bold": false },
      "format": "<img src='cfg://default/img/Efficiency/assist.png' vspace='-2'> <b>{{py:xvm.totalAssist}}</b>",
      "shadow": ${ "def.textFieldShadow" }
    },

Share this post


Link to post

Short link
Share on other sites

Not quite sure what to help you with...

Are you saying that:

i. the example was created by you and somehow it doesn't work the way you want it to, and that's preventing you from working on the rest?

ii. the example was created by someone else and it works, and you want to understand how it works so you can apply it to the rest?

iii. something else altogether?

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites
1 час назад, scyorkie сказал:

ii. the example was created by someone else and it works, and you want to understand how it works so you can apply it to the rest?

 

exactly, I have codes that work and when applied to other macros do not work.I want to have in battle the damage assisted by the peloton

Share this post


Link to post

Short link
Share on other sites

I. What the macros do

 

1. Before I explain how to customise your labels, do note that none of the macros deal with PLATOON damage. Instead, they deal only with YOUR performance:
    {{py: xvm.totalDamagesBlocked}} = your damage dealt + your blocked damage
    {{py: xvm.totalDamagesAssist}} = your damage dealt + your assisted damage (tracking/spotting) -- this would be relevant for pushing your MOE%
    {{py: xvm.totalDamagesBlockedAssist}} = your damage dealt + your blocked damage + your assisted damage (tracking/spotting)
    {{py: xvm.totalDamagesBlockedReceived}} = your damage dealt + your blocked damage + your received damage -- this would be relevant for mission HT.15

 

II. battleLabels.xc and battleLabelsTemplates.xc

 

2. Labels are activated using 2 separate files in your configs folder: battleLabels.xc "calls up" to the labels you want to display, and battleLabelsTemplates.xc defines these labels.

 

3. As an example, let's look at the label "totalHP". In battleLabels.xc you see the "call up" line ${ "battleLabelsTemplates.xc":"def.totalHP" }, while in battleLabelsTemplates.xc the definition looks something like this (I've compressed mine into fewer lines): 

 

    "totalHP": {
      "enabled": true,

      "updateEvent": "PY(ON_UPDATE_HP)",
      "x": 0, "y": 30, "screenHAlign": "center", "align": "center",
      "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 },
      "textFormat": { "font": "mono", "size": 18, "align": "center" },
      "format": "{{py:xvm.total_hp.text}}"
    },

 

III. Creating your own label

 

4. To create your own label, let's use the existing "totalHP" as a starting point. You will want to:
a. create a new "call up" in battleLabels.xc: ${ "battleLabelsTemplates.xc":"def.totalDamagesBlocked" },
b. create a new definition in battleLabelsTemplates.xc (I'm simply copying "totalHP", renaming the label, and changing the "updateEvent"):
  
    "totalDamagesBlocked": {
      "enabled": true,

      "updateEvent": "PY(ON_TOTAL_EFFICIENCY)",
      "x": 0, "y": 30, "screenHAlign": "center", "align": "center",
      "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 },
      "textFormat": { "font": "mono", "size": 18, "align": "center" },
      "format": "{{py:xvm.totalDamagesBlocked}}"
    },

 

5. There are 6 lines within the definition above. Here's what they do:
    line 1: toggles your label on or off

    line 2: determines when the label contents update (see \res_mods\mods\shared_resources\xvm\doc\extra-field.txt)

    line 3: deals with the positioning of your label on the screen
    line 4: formats the shadow displayed
    line 5: formats the text displayed
    line 6: determines the contents of the text displayed
    
6. Tinker with lines 3-5 of the definition above to achieve your desired outcome. For the options available, see extra-field.txt (path as above).

 

7. Repeat paragraphs 4-6 for each of the other labels you want to create.

 

IV. Advanced functions

 

8. The example you posted has a number of advanced functions which you may not even need:

 

    "hotKeyCode": 56, "onHold": "true", "visibleOnHotKey": false,
    hotKeyCode 56 = left Alt (see hotkeys.xc). The above hides the label when left Alt is held down.
    
    "x": "{{py:math.sum({{pp.widthLeft}},80)}}",
    The "x" value is 80 greater than the width of the playersPanel; it varies depending on which mode you choose.
    
    "y": "{{py:xvm.screenHeight<950?{{py:math.sub({{py:xvm.screenHeight}}, 100)}}|0}}",
    The "y" value depends on whether screenHeight is less than 950.
    If yes, "y" value is screenHeight minus 100. If no, "y" value is 0.
    (This makes no sense to me btw.)
    
    "alpha": "{{py:xvm.totalAssist>0?100|60}}",
    The transparency value depends on whether you have any assisted damage.
    If so, the label is fully opaque. If not, the label is translucent.

 

    "screenHAlign": "{{py:xvm.screenWidth>1701?left|center}}",
    The label aligns to the left if screenWidth > 1701. If not, it aligns to the center.
    (This also makes no sense to me btw.)
    
    "textFormat": {"color": "{{py:xvm.totalAssist>0?0xFFCC66|0xFFFFFF}}", "font": "$TitleFont", "size": 20, "align": "left", "bold": false },
    The text colour value depends on whether you have any assisted damage.
    If so, the colour is orange. If not, it is white.
        
    "shadow": ${ "def.textFieldShadow" }
    The formatting of the shadow is contained in another label "textFieldShadow" within the same file battleLabelsTemplates.xc

 

9. Don't worry about the advanced functions until you get your basic label working. I don't even use much of these myself.

Edited by scyorkie
  • Upvote 2

Share this post


Link to post

Short link
Share on other sites

Thank you very much, I am sincerely now very lost with the xvm, also to the files that come in the eighteenth exixte a page where it comes well explained all macros xvm.Por I do not understand many as you can happen to you.

Share this post


Link to post

Short link
Share on other sites

You can help me in this config: i need config the hp team:config.jpg.14dbbc69506ae297e0714c985c54f77b.jpg

The config the first and shading the sidebar  of second imag.

Только что, locorebelde сказал:

You can help me in this config: i need config the hp team:config.jpg.14dbbc69506ae297e0714c985c54f77b.jpg

The config the first and shading the sidebar  of second imag.The first image is the config the Enot.

 

Share this post


Link to post

Short link
Share on other sites

It looks like you have more than one mod displaying team HP at the top of the screen. 

 

Can you zip your mods\ and res_mods\ folders, and upload to a file sharing site (Dropbox, Google Drive, etc) for me to download and take a look?

Edited by scyorkie

Share this post


Link to post

Short link
Share on other sites

Yes, the first image I was wrong and I put two mods, but my intention is to put the enot mod of the totalhp with the icons of the tank types and also to place that opaque bar of the mod of XSerzHX. I usually test all the configurations that exist here and I keep what I like most about them.

Share this post


Link to post

Short link
Share on other sites

1. Create a new "call up" in battleLabels.xc:

 

    ${ "battleLabelsTemplates.xc":"def.topBarBG" },


2. Create a new definition in battleLabelsTemplates.xc:

 

    "topBarBG": {
      "enabled": true,
      "x": 0, "y": 0, "layer": "bottom",
      "height": 32, "width": "{{py:xvm.screenWidth}}",
      "bgColor": "0", "alpha": "25"
    },

 

3. Change the "height" to whatever you need.

 

4. The commas after the closing bracket } need to be there unless you insert the above lines at the end of the respective files. If you don't know where to insert the lines, upload your battleLabels.xc and battleLabelsTemplates.xc here (do not copy-paste the contents, but upload the files).

Edited by scyorkie

Share this post


Link to post

Short link
Share on other sites

OK, I learn the mistakes I have not putting commas or quotes. I will try to do that you write me, you could tell me how to put the totalhp of Enot, I can not know how to do it

Share this post


Link to post

Short link
Share on other sites

is the totalHP in battlelabels templates.xc

ANGEL.jpg.7084c2de2753d8e18c1275f5335365ae.jpg

Then I try to put it in Spanish which is my language

1 час назад, scyorkie сказал:

1. Create a new "call up" in battleLabels.xc:

 

    ${ "battleLabelsTemplates.xc":"def.topBarBG" },


2. Create a new definition in battleLabelsTemplates.xc:

 

    "topBarBG": {
      "enabled": true,
      "x": 0, "y": 0, "layer": "bottom",
      "height": 32, "width": "{{py:xvm.screenWidth}}",
      "bgColor": "0", "alpha": "25"
    },

 

3. Change the "height" to whatever you need.

 

4. The commas after the closing bracket } need to be there unless you insert the above lines at the end of the respective files. If you don't know where to insert the lines, upload your battleLabels.xc and battleLabelsTemplates.xc here (do not copy-paste the contents, but upload the files).

 

 it works perfectly, thank you very much:flag:

Edited by locorebelde

Share this post


Link to post

Short link
Share on other sites

Can you upload the zip file that you download from that guy's links?

There are too many ads to jump through / pages to translate.

I'm not interested in clicking through 10+ Russian pages, each with its own popup ads.

Edited by scyorkie

Share this post


Link to post

Short link
Share on other sites

this is battlelabels.xc

Цитата

/** Настройка P.S.Enot
 * List of battle interface labels.
 * Список текстовых полей боевого интерфейса.
 */
{
  "labels": {
    // Referenced labels:
    // * every custom field can be separate enabled or disabled by "enabled" switch in their settings.
    // * extended format supported, see extra-field.txt
    // Подключенные текстовые поля:
    // * кастомные поля можно отдельно отключать и включать с помощью "enabled" в их настройках.
    // * поддерживается расширенный формат, см. extra-field.txt
    "formats": [
//--------------
//================================================================================================
      ${ "addons/hpBar.xc":"def.hpBar"},                        // ХП Бар
      ${ "addons/hpBar.xc":"def.hpBar_Background"},             // Фон ХП Бара
      ${ "addons/hpBar.xc":"def.hpBar_text"},                   // Текст ХП Бара
      ${ "addons/hpBar.xc":"def.hpBar_text_name"},              // Ник Игрока
      ${ "addons/hpBar.xc":"def.hpBar_text_vehicle"},           // Название техники
//================================================================================================
      ${ "addons/clock.xc":"def.clock"},                        // Часы в бою
//================================================================================================     
      ${ "addons/fragCorrelationBar.xc":"def.fragCorBarEnemy"},   
      ${ "addons/fragCorrelationBar.xc":"def.fragCorBarAlly"},  // Панель счета
      ${ "addons/fragCorrelationBar.xc":"def.substrate" },      // Подложка в виде стрелки
//================================================================================================
      ${ "addons/debugPanel.xc":"def.statusPanel" },            // Пинг
      ${ "addons/debugPanel.xc":"def.statusPanel_2" },
      ${ "addons/debugPanel.xc":"def.statusPanel_indicator" },
      ${ "addons/debugPanel.xc":"def.statusPanelFps" },
      ${ "addons/debugPanel.xc":"def.statusPanelPing" },
      ${ "addons/debugPanel.xc":"def.podloga" },
//================================================================================================
      ${ "addons/WN8_EFF.xc":"def.battleEfficiency" },          // Калькулятор эффективности в бою
      ${ "addons/WN8_EFF.xc":"def.battleEfficiencyWN8" },       // по WN8
      ${ "addons/WN8_EFF.xc":"def.battleEfficiencyEFF" },       // по EFF
//================================================================================================

      ${ "addons/panelAccount.xc":"def.totalHP_bg" },           // Подложка хп команд WGL
      ${ "addons/panelAccount.xc":"def.totalHP_Bg_sing" },      // Центральая подложка
      ${ "addons/panelAccount.xc":"def.totalHP_Bg_Ally" },      // Подсветка союзник
      ${ "addons/panelAccount.xc":"def.totalHP_Bg_Enemy" },     // Подсветка противник
      ${ "addons/panelAccount.xc":"def.totalHP_frags_ally" },   // Фраги союзник
      ${ "addons/panelAccount.xc":"def.totalHP_frags_enemy" },  // Фраги противник
//================================================================================================
      ${ "addons/totalEfficiency.xc":"def.totalEfficiency" },   // Общая эффективность
//================================================================================================
      ${ "addons/repairTimer.xc":"def.repairTimeEngine" },      // Таймер ремонта
      ${ "addons/repairTimer.xc":"def.repairTimeGun" },
      ${ "addons/repairTimer.xc":"def.repairTimeTurret" },
      ${ "addons/repairTimer.xc":"def.repairTimeTracks" },
      ${ "addons/repairTimer.xc":"def.repairTimeSurveying"},
      ${ "addons/repairTimer.xc":"def.repairTimeRadio" },
//================================================================================================
      ${ "addons/battleTimer.xc":"def.battleTimer"},            // Таймер в бою
//==============================================================================================
      ${"addons/sixthSenseTimer.xc":"def.sixthSenseTimerIcon"}, // Изображение лампочки    
      ${"addons/sixthSenseTimer.xc":"def.sixthSenseTimerFon"},  // Фон лампочки
        ${"addons/sixthSenseTimer.xc":"def.sixthSenseTimerDyn"},  // Динамический отсчёт времени действия лампочки         
//================================================================================================
      ${ "addons/hitlogHeader.xc":"def.hitlogHeader" },         // Хит лог
      ${ "addons/hitlogBody.xc":"def.hitlogBody" },
//================================================================================================
      
//================================================================================================  
      ${ "addons/winChance.xc":"def.winChance" },               // Шанс на победу
//================================================================================================
      ${ "addons/totalHP.xc":"def.totalHP" },                   // Индикатор общего HP команд
//================================================================================================    
      ${ "addons/avgDamage.xc":"def.avgDamage" },               // Средний урон на текущей технике
//================================================================================================    
      ${ "addons/mainGun.xc":"def.mainGun" },                   // Основной калибр
//================================================================================================   
      ${ "addons/damageLog.xc":"def.damageLog" },               // Лог полученого урона
      ${ "addons/damageLog.xc":"def.damageLogBackground"},      // Подложка damageLog
//================================================================================================    
      ${ "addons/lastHit.xc":"def.lastHit" },                   // Отоброжение последнего урона
//================================================================================================   
      ${ "addons/fire.xc":"def.fire" },                         // Пожар  
//================================================================================================
      ${ "addons/repairControl.xc":"repairCtrlEngine" },        // Роза ремонта
      ${ "addons/repairControl.xc":"repairCtrlAmmoBay" },
      ${ "addons/repairControl.xc":"repairCtrlGun" },
      ${ "addons/repairControl.xc":"repairCtrlTurret" },
      ${ "addons/repairControl.xc":"repairCtrlTracks" },
      ${ "addons/repairControl.xc":"repairCtrlSurveying" },
      ${ "addons/repairControl.xc":"repairCtrlRadio" },
      ${ "addons/repairControl.xc":"repairCtrlFuelTank" },
      ${ "addons/repairControl.xc":"healCtrlCommander" },
      ${ "addons/repairControl.xc":"healCtrlRadioman" },
      ${ "addons/repairControl.xc":"healCtrlDriver" },
      ${ "addons/repairControl.xc":"healCtrlGunner" },
      ${ "addons/repairControl.xc":"healCtrlLoader" }

     ]}}   

I think that image is in the file "addons / totalHP.xc": "def.totalHP"

Цитата

// Настройка P.S.Enot
{
 "def": {
//===============================================================================================
//------------------------------------Индикатор общего HP команд.
    "totalHP": {
      "enabled": true,
      "updateEvent": "PY(ON_UPDATE_HP)",
      "x": 0,
      "y": 52,
      "screenHAlign": "center",
      "align": "center",
      "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 },
      "textFormat": { "font": "New Style", "size": 18, "align": "center" },
      "format": "{{py:xvm.total_hp.text()}}"}}}

but it does not come out as it does

 

https://www.dropbox.com/s/vpusd25qg5dfsml/Сборка Salamandra XVM 7.0.2.zip?dl=0

 

this is your conf. complete

Share this post


Link to post

Short link
Share on other sites

in the dropbox I uploaded all its configuration, but I think already understand how your battlelabel.xc works, and especially in the case of totalhp configuration. Thanks for your time, to see if tomorrow I can make a capture with my changes, I already have I made a change.

substrate.thumb.png.e484c3dd2638d06bb92faad12bc694f2.png

as you can see I put it in my language .

If I get stuck I ask you again, I would not want to take time for my questions. Thank you, thank you very much.

Share this post


Link to post

Short link
Share on other sites

No problem.

 

FYI "totalHP" is for the "19700 < 19720" part of the screenshot in your post above.

 

Edit: I just saw your edits to your earlier posts, and assume that you've managed to make the grey background work and have no other questions that I've missed. Have fun tweaking your configs. :)

Edited by scyorkie

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.

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.


  • Recently Browsing   0 members

    No registered users viewing this page.

×