kupjones
Forum Replies Created
-
AuthorPosts
-
kupjonesMember
XVM and Using Fonts
This is a translated copy of the thread on KoreanRandom covering the XVM embedded fonts and how to use them. ( http://www.koreanrandom.com/forum/topic/22846-%D0%B2%D1%81%D1%82%D1%80%D0%BE%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5-%D1%88%D1%80%D0%B8%D1%84%D1%82%D1%8B-embeded-fonts/ )
<hl>
Starting with version XVM mod for WoT 9.7 has built-in fonts to design custom configurations.
These fonts do not require the installation of the system and called directly from the mod config if, in the format specified its specialized font name.
1. The character font.
Real-name XVMSymbol, the name of font built xvm. It is intended to be implemented in a variety of game interface icons and symbols.
An example of the format:
<font face = ‘xvm’> & # x4E; </ font>, where & # x4E; – HTML code is hexadecimal character font. You can write the same symbol as Unicode code u004E symbol or keyboard, which corresponds to its code, to take an example is N, but the hexadecimal code HTML is the most versatile recording.
Character codes the current version of the font:
The letter h is that it is a hexadecimal code of its account do not take, and from the rest, form a character code to write to the configuration, for example, the first character of 21h should be written as <font face = ‘xvm’> & # x21; </ font >.
When recording format the font with its original name to be used is not an embedded font, and the original, with the proviso that it is installed in your system, otherwise, instead of the desired character, you will see many of the already known “squares”
For the average user is more convenient to use built-in font.
Codes established by the original character font can be found in standard table symbols Windows, which can be found in the “Start” menu:
Author: demon2597
The character font is in constant development, their wishes to add new characters you can post in this thread. Please note that all successively added in a font is not only a really good idea or something you need.
2. Monospace.
Real-name ZurichCondMono, the name of font built-in mono. In fact it is one of the standard fonts game, reduced to monospaced. Designed for smooth implementation of the columns of numbers, as in the screen TAB.
This font is not suitable for high-grade writing text because it does not fit wide characters, such as for example the letter W, is only possible to use some letters and icons with the figures for the reductions, etc.
An example of the format:
<font face = ‘mono’ color = ‘{{c: kb}}’> {{kb% 2d ~ k | –k}} </ font>
Alteration: demon2597
3. Font types of equipment.
Real-name VehicleType, the name of font built vtype. It contains advanced technology icon set of classes and their accompanying symbols.
Sample size:
<font face = ‘vtype’> {{vtype}} </ font>, where {{vtype}} – macro technology type whose values are specified in the config file texts.xc in this case are the characters in the font codes:
For more information about character codes refer to. Claim 1.
<font face = ‘vtype’> {{vehicle-class}} </ font>, where {{vehicle-class}} – a macro-type appliances for the minimap, the values of which are set in minimapLabels.xc similarly to the first example.
Character codes the current version of the font:
Author: XSerzHX
4. Fonts indicators.
Real-name DynamicDefault, the name of font embedded dynamic. Contains a set of bar graphs. The real-name DynamicOutline, the name of font built dynamic2. Contains a set of graphical indicators with a stroke. Designed to double graphic performance statistics, such as the filling strip or ring. Examples of the format: <font face = ‘dynamic or dynamic2′> {{macro% .234a}} </ font> – vertical flasher<font face = ‘dynamic or dynamic2′> {{macro% .335a}} </ font> – a circular indicator, <font face = ‘dynamic or dynamic2′> {{macro% .436a}} </ font> – Horizontal indicator, where as the “macro” macro names may be used double-digit performance rating (xte, xeff, etc.) or the name of the macro percent of the remaining points of strength (hp-ratio). Author: XSerzHX
—————————————————————————————————————————————————————————————————————————
So, here are the embedded XVM fonts and the location of the .swf font file:
—————————————————————————————————————————————————————————————————————————
the fonts are in the xvm folder containned within a .swf file
there actually five not four as xvm state
package
{
import xfwfonts.*;public class xfwfonts extends Object
{
private var xvm:Class;
private var mono:Class;
private var vtype:Class;
private var dynamic:Class;
private var dynamic2:Class;public function xfwfonts()
{
this.xvm = xfwfonts_xvm;
this.mono = xfwfonts_mono;
this.vtype = xfwfonts_vtype;
this.dynamic = xfwfonts_dynamic;
this.dynamic2 = xfwfonts_dynamic2;
return;
}// end function}
}Font file location and file
World_of_Tanksres_modsmodsxfwactionscriptxfwfonts.swf
kupjonesMemberXVM and minimap labels
This all started from a question: How does one make those HP circles show up on the minimap? I know one can as I had seen them before. OverripeTomato (herein known as OT because that is too much to type) stepped in and offered to help. What I am putting here are excerpts from a now defunct thread that was on RN Mods (as RN no longer supports XVM configs) thread that explains how OT coerced XVM to produce:


This is how the new reworked minimap labels work:
First, in minimapLabelsTemplates.xc you need to make “defs” of what you want to show with your vehicle icons. For example,
“nickSpotted”: { <<< name of “def”, which will be included in minimapLabels.xc
“$ref”: { “path”:”def.defaultItem” }, <<< just the standard characteristics (such as shadow) of the item defined in the “def”
“flags”: [ “squadman”, “spotted”, “alive” ], <<< on which player you want the “def” to appear, could also be “enemy”, “ally”, “teamkiller”, “lost”, or “dead”
“format”: “<font size=’8′ color='{{.minimap.labelsData.colors.txt.{{sys-color-key}}}}’><i>{{name%.7s~..}}</i></font>”, <<< this is what you want to appear.
“x”: 2, <<< x position of the “def” relative to the vehicle icon
“y”: -9 <<< y position of the “def” relative to the vehicle icon
},“format”: is limited only by your imagination, it can text or an image. The circles and hpbars are PNG image files. lol in my own zoomed minimap, I have tombstone crosses for dead allies and enemies, so the battlefield is like a cemetery towards the end of the battle. lol.

In minimaplabels.xc, you insert the “defs”, below for example
“formats”: [
//${ “minimapLabelsTemplates.xc”:”def.vtypeSpotted” },
${ “minimapLabelsTemplates.xc”:”def.vehicleSpotted” },
${ “minimapLabelsTemplates.xc”:”def.hpBars” },
${ “minimapLabelsTemplates.xc”:”def.vehicleHP” },
${ “minimapLabelsTemplates.xc”:”def.nickSpotted” },
${ “minimapLabelsTemplates.xc”:”def.vtypeLost” },
${ “minimapLabelsTemplates.xc”:”def.vehicleLost” },
${ “minimapLabelsTemplates.xc”:”def.nickLost” },
${ “minimapLabelsTemplates.xc”:”def.vtypeDead” }You can turn feature off by commenting them out with a //. So if you don’t want the hpBars for example, just add a // before the $ in that line, e.g.,
//${ “minimapLabelsTemplates.xc”:”def.hpBars” },
minimaplabelsAlt.xc is for the alt (zoomed) map. Sometimes you may want to add more info on the zoomed because it is larger, if at all you use the zoomed minimap when you play. I rarely use the zoomed minimap when I am still alive because I’m busy dodging shots (very hostile game this is lol), mostly only when I’m dead and watch how the battle progresses and ends.
minimaplabelsData.xc is for colors used in the “defs” above. Most modders use the default, but you can play around with them.
Recap: Define the labels you want in minimapLabelsTemplate.xc, and activate the labels in minimapLabels.xc.
That’s about it I guess,

————————————————————————————————————————————————————————————–
What the …. ? But this is freaking magic — then I got a post to not forget about “Colors.xc”. I am really not seeing how this bit of editing can make those circles and lines. Well, read on:
————————————————————————————————————————————————————————————–
colors.xc, ok, yeah.
I introduced those “hp_ratio” in 10 graduations so that {{c:hp-ratio}},png will change in 10% hp-ratio increments this 10%, 20%, 30%, 40%, etc. The default hp-ratio colors had only 4 graduations, so only 25%, 50%, 75% 100%, not very iO-ish.
The hp bars (or circles as the case may be) are named using the color graduations, e.g., #00B4FF for 90%, or #666666 for 10%, etc.
See inside kupjones/img/hpbars

Compare the names of the PNGs above to the color graduations in color.xc, they will jive.

Well you can introduce more graduations, 25? 50? up to 100 max. but you have to have more PNG files.
Nope, you will not see any color change on the minimap labels. It’s just once of the tricks to use {{c:hp-ratio}} to pull a PNG file. Don’t be distracted by {{c:hp-ratio}}.
“hpBars”: {
“$ref”: { “path”:”def.defaultItem” },
“flags”: [ “ally”, “squadman”, “spotted”, “teamKiller”, “alive” ],
“format”: “<img src=’cfg://default/kupjones/img/hpbars/{{c:hp-ratio}}.png‘ width=’24’ height=’2′>”, <<< e.g., #666666.png = 10% or #00B4FF.png = 90%
“x”: 2,
“y”: -3
},I’m sure there are other ways of creating the hp-bars or hp-circles, and probably in a more efficient way without having to create PNGs. I have not found it yet. XVM has embedded the fonts below (that have 1% graduations) after demon2597’s lobbying.
Dynamic fonts (See next post for dynamic fonts)
————————————————————————————————————————————————————————————–
Then Soulza pitched in:
————————————————————————————————————————————————————————————–
this is a common xvm trick , to use images for values , at first you may think wtf?
but consider if you had a folder with 10 ,png image files within, now you name these images , for the case above ,the values you want to represent like this,

now i think a man with your knowhow will suddenly see a light go on somewhere ?:) like i said , this is an old trick you can use in xvm for any number of items.
————————————————————————————————————————————————————————————–
I’ve now been challenged — how can this technique be extended to other areas? For that matter, how can we use the XVM embedded fonts to achieve something perhaps more FPS friendly?
————————————————————————————————————————————————————————————–
Time goes by ……. and:
The answer to this question came from — Aslain! Aslain’s modpack includes an XVM config and supports minimap circles using the dynamic font char map. so looking at the code we see:
minimapLabelsTemplates.xc where the format line pretty much spells out the most obtuse embedded formatting:
—————————————————————————-
“HealthPointsSpottedAlly”: {
“$ref”: { “path”:”def.defaultItem” },
“flags”: [ “ally”, “spotted”, “alive” ],
“format”: “<font face=’dynamic2′ size='{{vtype-key=HT?16|14}}’ color='{{.minimap.labelsData.colors.dot.{{sys-color-key}}}}’>{{hp-ratio%.335a}}</font>”,
“align”: “center”,
“valign”: “center”,
“x”: 0.2,
“y”: 0.8———————————————————————————
Note that:
face= specifies the char map we are using
“color” renders the font the color of the ally or enemy
The workhorse is “{{hp-ratio%. —- and a series of numbers. These numbers indicate (and this is pure guesswork) to the hp-ratio macro to ‘start’ at char location <blah> (in our case char 335 in char map ‘dynamic2’, add the integer result of hp-ratio to that starting map char, and return the new char that we now point to. So, without params hp-ratio will return an integer from 0 – 100. It so happens that the new dynamic fonts in XVM have HP chars that magically increment by 1, from a relative 0 (no health or dead) to 100 (full health). The hp-ratio macro then provides a convenient dynamic indexer into that char map and returns the char that visually represents an Ally/enemy health status.
BTW, THIS IS ALL GUESSWORK. There is no easily found documentation on this and Aslain was kind enough to say that the inner workings were a mystery to him as well. So, how about some pictures? Below is an exchange on just how the &$*# does this work:
Quote from Overripe: “Though I still don’t understand the inner workings of why e.g., 335a for circular, or .436a for horizontal indicators”
My response based on a night of change one thing, replay, curse, change another “ONE” thing, reply, curse.
335a and 436a explanation is simple — those are the the decimal-equiv of the beginning char that designates DEAD or zero HP.

hp-ratio returns an integer from 0-100. A “new” tank has 100HP + 436 == 536 or ———-

Now, how does hp-ratio perform all of this magic??? the XVM guys aren’t documenting it so its a trial and error. I spent last night doing multiple configs — Its cool and weird at the same time.
kupjonesMemberPlace Taken!!
I’m starting “Demystifying XVM” based on my inquiry about creating minimap “HP circles” and it resulted in my XVM tutelage under OverripeTomato and Soulza. What I am adding right now is content supplied by them both, gathered in a single location and I will add my own discoveries as I develop them.
In addition, I am including an interesting piece from Korean Random on XVM and font useage with built-in macros. The use of fonts rather than flash or graphics makes one wonder about the inherent efficiency of using char- based “graphics” over true graphic images. There was a time when this was a truism — perhaps not so much today. But in the use of a gameplay client the issue of “FPS Loss” is a topic of continual discussion so — here we are!
Finally, I see XVM as an extensible framework but one that itself can be an FPS “suck” – depending on what features are enabled (or disabled). For me this is not only gameplaying but also me figuring out how the XVM system works. I know I am likely re-discovering what others already know, but Google didn’t turn up much and what seems to be available is in Russian and translations simply dont make a whole lot of sense.
-
AuthorPosts