Jump to content

Simplified Battle Loading and Statistics tab


Recommended Posts

Ok, so I'm trying to edit my XVM-settings to suit my own personal needs. However, the documentation on XVM is rather lacking, at least in English. The links and documents available online are either in Russian, outdated or just plain not very easy to read and understand. I have basic coding knowledge so I'm not unfamiliar with writing code, mainly html but also other basic programming. When it comes to XVM though, there's not enough in-depth documentation and reference for me to understand some parts of the files. I guess it doesn't make it easier that I'm using Aslains Modpack and thus aren't using the default XVM settings.

 

So, here's my request: Could someone post some links to in-depth documentation of the XVM syntax?

 

Here are some documents I've been using to read up and use as reference:

 

XVM Documentation:
https://bitbucket.org/XVM/xvm/src/47bdf3e4a8c6/release/doc/?at=default

 

Matra’s Guide To Making Your Own XVM Config:

https://docs.google.com/document/d/1CyA1b4dsbmU-CQOFgXUpP9l55xUtnlzvWE-IIFEUaNM/edit

 

 

Since I'm using Aslains Modpack, I'll use his code as an example:

    // Display format for the left panel (macros allowed, see macros.txt).
    // Формат отображения для левой панели (допускаются макроподстановки, см. macros.txt).
    "formatLeftVehicle": "
    <font face='Consolas' size='12'> 
     <font color='{{c:kb|#666666}}'>{{kb%2d~k|--k}}
     </font> 
     <font color='{{c:r|#666666}}'>{{r}}
     </font> 
     <font color='{{c:winrate|#666666}}'>{{winrate%2d~%|--%}}
     </font>
    </font>",

So, in the above code, these are the parts I don't understand:

In the font colour there is this macro: {{c:kb|#666666}}

I understand the c:kb part but not the #666666 which to me looks like an RGB-code for gray. I'm assuming this is in case there is no data to display?

 

Then there's the next part on the same line: {{kb%2d~k|--k}} I'm assuming that's the actual data displayed.

Kb = Meaning Kilo Battles

% = why is the questionmark there? I'm assuming it has to do with how the kb is displayed?

2d = Meaning it will cut numbers longer than two.

~ = The tilde represents a space?

k = simply the letter k displayed after the number

| = The if/or separating the alternate lack of data?

 

 

________________________________________________________________________________________

 

My goal is th de-clutter my panels. I don't really need  as many numbers as are displayed on most XVM-setups. Basically, all I want is the following:

Name [Clan]          Kb | Tank Name | Tier | Contour Icon

 

Name coloured by WN8-rating.

Tank Name preferably coloured by number of games played in that particular tank which, to me, in conjunction with the overall player rating is a much more interesting fact than showing a players WN8 rating or something else which is rather abstract. My reasoning is that if the player is a very good player and he has played that particular tank a lot, you can assume that he is very skilled with that vehicle.

 

So, if I'm not completely off, my code should look something like this:

 

	"formatLeftNick": "
	<img src='xvm://res/icons/flags/default.png' width='16' height='13'> 
	<img src='xvm://res/icons/xvm/none.png'> 
	<font color='{{c:r}}'>
	 <font size='13'>
	  {{name%.20s~..}}
	 </font> 
	 <font face='Consolas'>
	  <font size='10'>
	   {{clan}}
	  </font>
	 </font>
	</font>",

I didn't mess much with that part except change the order of the Name and Clan.

 

Second part is a bit trickier though:

 

    "formatLeftVehicle": "
	<font face='Consolas' size='12'> 
	 <font color='{{c:kb|#666666}}'>{{kb%2d~k|--k}}
	 </font> 
	 <font color='{{t-battles|#666666}}'>{{vehicle}} {{rlevel}}
	 </font>
	</font>",

If I'm correct the above code should give me the players KB coloured based on the number of battles he's played, plus the name and tier of the vehicle coloured based on the number of battles played in that vehicle.

 

For the opponents I will simply reverse the above code and it will display mirrored with the same info, making it easy to read.

 

I will also use the same code for the statistics tab.

 

 

So if any of you codies who are familiar enough with this stuff could just take a peek and tell me if I'm correct.

 

Much appreciated, hope you don't mind me putting this here Aslain, since it is based on your modpack.

 

/Herb

Edited by HerbertNimble
Link to comment
  • Moderator
31 minutes ago, HerbertNimble said:

So, in the above code, these are the parts I don't understand:

In the font colour there is this macro: {{c:kb|#666666}}

I understand the c:kb part but not the #666666 which to me looks like an RGB-code for gray. I'm assuming this is in case there is no data to display?

Fairly sure the part after | is the null-value, so if there's no value to display, it'll show grey text.

 

Then there's the next part on the same line: {{kb%2d~k|--k}} I'm assuming that's the actual data displayed.

Same goes here.. the null value would display "--k" instead of "20k"

Kb = Meaning Kilo Battles

% = why is the questionmark there? I'm assuming it has to do with how the kb is displayed?

You mean percentage mark? :P Hehe.. it's needed before the 2d, for example, or another value, if it's going to be there

~ = The tilde represents a space?

Not 100% sure on that one.

 

Answers/Ideas inside the quote, in red text.

 

You can easily test your values, by loading up replays, instead of going through a real battle each time :)

Then you can quickly find out which suits your needs, using the various macros from the macros.txt file :)

Link to comment
	"formatLeftNick": "
	<img src='xvm://res/icons/flags/default.png' width='16' height='13'> 
	<img src='xvm://res/icons/xvm/none.png'> 
	<font color='{{c:r}}'>
	 <font size='13'>
	  {{name%-15.15s}}
	 </font> 
	 <font face='Consolas'>
	  <font size='10'>
	   {{clan}}
	  </font>
	 </font>
	</font>",

So after some more digging and trying to figure out this stuff, if I change the name section to the above {{name%-15.15s}} the names should be displayed up to 15 characters and if the name is shorter than 15 characters it should get filled to 15 characters. I'm thinking this has something to do with the alignment of the clan-tags and give a "neater" result?

 

I'm going to do some changes and try a replay but the problem with replays is that they don't show the pre-battle loading screens but nevertheless, I can check the formatting on the statistics tab.

Link to comment

Can someone tell me how to use these functions:
 

    // X offset for "formatLeftVehicle" field
    // C??????? ?? ??? X ???? ???????? ????? ?????????
    "vehicleFieldOffsetXLeft": 20,
    // X offset for "formatRightVehicle" field
    // C??????? ?? ??? X ???? ???????? ????? ???????????
    "vehicleFieldOffsetXRight": -20,
      
    // X offset for allies vehicle icons
    // ???????? ?? ??? X ?????? ????? ?????????
    "vehicleIconOffsetXLeft": 20,
    // X offset for enemies vehicle icons
    // ???????? ?? ??? X ?????? ????? ???????????
    "vehicleIconOffsetXRight": -20,

I'm trying to get the Vehicle Icons to be aligned in the same way on both sides but it doesn't work to do what I did in the snippet above.

 

 

EDIT:

Could I use something like this for the alignments?

// Display format for the left panel (macros allowed, see readme-en.txt).
// Формат отображения для левой панели (допускаются макроподстановки, см. readme-ru.txt).
"formatLeft": "<textformat leading='-16' tabstops='[1,79,1,54]'><p align='left'><tab><font color='{{c:xwn8}}'>{{vehicle}}</font><tab><font color='{{c:hp-ratio}}'>[HP: {{hp}}]</font><\p></textformat>",
// Display format for the right panel (macros allowed, see readme-en.txt).
// Формат отображения для правой панели (допускаются макроподстановки, см. readme-ru.txt).
"formatRight": "<textformat leading='-16' tabstops='[40,25,50,30]'><p align='left'><font color='{{c:hp-ratio}}'>[HP: {{hp}}]   </font><tab><font color='{{c:xwn8}}'>{{vehicle}}</font><\p></textformat>"

Source: http://www.koreanrandom.com/forum/topic/14973-hp-ears/#entry178317

Edited by HerbertNimble
Link to comment

So I tried this:

// Display format for the left panel (macros allowed, see macros.txt).
// ?????? ??????????? ??? ????? ?????? (??????????? ????????????????, ??. macros.txt).
"formatLeftNick": "<img src='xvm://res/icons/flags/default.png' width='16' height='13'> <img src='xvm://res/icons/xvm/none.png'> <textformat tabstops='[1,4,8,12]'> <p align='left'> <font color='{{c:r}}'> <font size='13'> {{name%-15.15s}} </font> <tab> <font face='Consolas'> <font size='10'> {{clan}} </font> </font> </font> </p> </textformat>",

So I fiddled around with the tabstops a bit but it doesn't seem to work. Iäve changed the numbers in the tabstop part to different numbers but it doesn't seem to change anything.

 

So the tabstops-property is the one I want to manipulate to get the text fields properly aligned but I don't understand the numbers [1,79,1,54]..

They represent pixels? If so, why is there two number ones? Shouldn't there just be one number per tabstop at increments that are increasing? For example: [1,50,100,150] or am I not understanding it correctly?

Edited by HerbertNimble
Link to comment
  • Moderator
1 hour ago, HerbertNimble said:

<textformat tabstops='[1,4,8,12]'> <p align='left'> <font color='{{c:r}}'> <font size='13'> {{name%-15.15s}} </font> <tab> <font face='Consolas'> <font size='10'> {{clan}} </font> </font> </font> </p> </textformat>

You have first tabstop after 1, and you only included 1 tab command, so there should be 1 space between the name, and the clan.

 

And yes, it's in pixels. So you should have a 1 pixel space between name and clan tag. In the line you posted :)

 

(As example, most uses I've seen, start at values between 30 and 105..)

Link to comment
6 hours ago, Quaksen said:

You have first tabstop after 1, and you only included 1 tab command, so there should be 1 space between the name, and the clan.

 

And yes, it's in pixels. So you should have a 1 pixel space between name and clan tag. In the line you posted :)

 

(As example, most uses I've seen, start at values between 30 and 105..)

Well then I have to assume that the tabstop tag doesn't work properly on the statisticform.xc because the following code produces the result seen in the screenshot..

 

"formatLeftNick": "<img src='xvm://res/icons/flags/default.png' width='16' height='13'> <img src='xvm://res/icons/xvm/none.png'> <textformat tabstops='[1,4,8,12]'> <font color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{name%-13.13s~..}} <tab> <font face='Consolas'><font size='10'>{{clan}}</font></font></font></textformat>",

There's definitely not just one pixel between the name and clan in the image..  ..and it's not even aligning up either..

shot_019.jpg

 

Never mind the rest of the statistics, I decided to go back to the default config by Aslain until I could figure out how to properly format the fields the way I want them. Only the left side uses my own attempt at formatting.

 

Perhaps I'm overcomplicating things but I'd really like to have the clan-tags in a separate column.

Edited by HerbertNimble
Link to comment

Well, seems I was overly complicating things..

 

    // Display format for the left panel (macros allowed, see macros.txt).
    // ?????? ??????????? ??? ????? ?????? (??????????? ????????????????, ??. macros.txt).
    "formatLeftNick": "<img src='xvm://res/icons/flags/default.png' width='16' height='13'> <img src='xvm://res/icons/xvm/none.png'> <font color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{name%-13.13s~..}}</font><font face='Consolas'><font size='10'>{{clan%-s}}</font></font>",
    // Display format for the right panel (macros allowed, see macros.txt).
    // ?????? ??????????? ??? ?????? ?????? (??????????? ????????????????, ??. macros.txt).
    "formatRightNick": "<font face='Consolas'><font size='10'>{{clan}}</font></font> <font color='{{c:r}}' alpha='{{alive?#FF|#80}}'>{{name%13.13s~..}}</font> <img src='xvm://res/icons/xvm/none.png'> <img src='xvm://res/icons/flags/default.png' width='16' height='13'>",
    // Display format for the left panel (macros allowed, see macros.txt).
    // ?????? ??????????? ??? ????? ?????? (??????????? ????????????????, ??. macros.txt).
    "formatLeftVehicle": "<font color='{{c:t-battles|#666666}}' alpha='{{alive?#FF|#80}}'>{{vehicle}}</font> <font face='Consolas' size='11'> <font color='{{c:kb|#666666}}' alpha='{{alive?#FF|#80}}'>{{kb%2d~k|--k}}</font> </font>",
    // Display format for the right panel (macros allowed, see macros.txt).
    // ?????? ??????????? ??? ?????? ?????? (??????????? ????????????????, ??. macros.txt).
    "formatRightVehicle": "<font face='Consolas' size='11'> <font color='{{c:kb|#666666}}' alpha='{{alive?#FF|#80}}'>{{kb%-2d~k|--k}}</font> </font> </font><font color='{{c:t-battles|#666666}}' alpha='{{alive?#FF|#80}}'>{{vehicle%-s}}</font>",

That code seems to do the trick for the most part but I'm still not satisfied with the clan-tag placement. I would prefer to have it in a column of its own but I'm fine with the result as seen in the screenshot below.

 

shot_023.jpg

Link to comment

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.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.