Setting colors and alpha in XVM
Published by ORT on
BLACKWOT › Forums › Stats & Other Mods for World of Tanks › XVM: eXtended Visualization Mod › Everything XVM › XVM Tutorials › Setting colors and alpha in XVM
- This topic has 1 reply, 1 voice, and was last updated 10 years, 3 months ago by ORT.
-
AuthorPosts
-
07.05.2016 at 08:35 #109814ORTMember
This is a short tutorial on how to set custom colors and alpha in your XVM configs.
The “color” parameterYou will see the “color” parameter is almost all the XVM config files. Any config file which displays text on the screen will have a “color” parameter. Colors are not limited to text, they are also applicable to other elements such as health bars over the target, or health bars in players panels.
Introduction on colors’ hexadecimal format RGB. Colors are defined in hexadicmal format or haxadecimal values, i.e., XXYYZZ. XX represents the color Red, YY represents Green, and ZZ Blue. R, G, and B represents how much of each colors red, green, and blue is in a particular color. The amount of each RGB color is defined in hexadecimal values.
‘RGB’ defines how much of each color in put in the mix. Each of the colors RED, GREEN, and BLUE are defined with a value ranging from 00 to FF.
00 = 0 (or 0% which is the minimum value) up to FF = 255 (or 100% which is the maximum value).
As an example YELLOW is a combination of of 100% RED, 100% GREEN, and 0% BLUE, or in hex format “FFFF00”. The first two FF’s represent RED, the second (or middle) FF’s represent GREEN, and the last 00’s represent blue.
000000 = is black because R=00, G=00, B=00, in other words 0% red, 0% green, 0% blue. Black is the absence of all colors.
FFFFFF = is white because R=255, G=255, B=255, or 100% red, 100% green, 100% blue. White is the presence of all colors.
FFFF00 = is yellow, because R=255, G=255, B=00, or 100% red, 100% green, 0% blue.
00FFFF = is cyan (or light blue) because R=00, G=255, B=255, or 0% red, 100% green, 100% blue.
Color hex values are not case-sensitive.
ff0000 = is red because 100% red, 0% green, and 0% blue.
00ff00 = is green because 0% red, 100% green, 0% blue.
0000ff = is blue because 0 part red, 0 part green, and 1 part blue.
AAff55 = is lime green because 67% red, 100% green, 33% part blue. Just like mixing cocktail drinks, e.g., 1 part lime juice, 1-1/2 parts tequila, 1/2 part triple sec, add lots of crushed ice and you have a nice cool Margarita.
For reference, you can see the hex values of different colors in http://www.color-hex.com/ There is also a color picker on the top of the page, when you pick a color, it will show you what the hex value is.
Or, you can use this other online resource where you can find out the hexadecimal value of any color you prefer: http://html-color-codes.info/. Or even better (and which I personally recommend), download and use paint.net (free download at http://www.getpaint.net/index.html) and use the color wheel.SpoilerOpen paint.net, on the upper right-hand corner, click on the color wheel icon.

Click “More>>>” on the pop-up color wheel, select a color, get the hex code.

You can set your colors as shown in the following examples. The hexadecimal value of the color is prefixed with “0x”.
“color”: “0x000000”, <<<< color set to black
“color”: “0xFFFFFF”, <<<< color set to white
“color”: “0xFFFF00”, <<<< color set to yellow
“color”: “0x00FFFF”, <<<< color set to cyan or light blue
“color”: “0xFF0000”, <<<< color set to red
“color”: “0x00FF00”, <<<< color set to green
“color”: “0x0000FF”, <<<< color set to blue
“color”: “0xAAFF55”, <<<< color set to lime greenThese hex values are also used in other color-related graphic parameters such as
“bgColor”:
“borderColor”:
“lcolor”:
or even in one of the characteristics of the “shadow” parameter
“shadow”: {
“alpha”: 100,
“color”: “0x000000”, <<<< shadow set to black
“angle”: 45,
“distance”: 0,
“size”: 6,
“strength”: 200The “alpha” or transparency/opacity parameter
The alpha parameter defines how transparent or how opaque you would want the text to appear. The value ranges from 0 (completely transparent or invisible) to 100 (completely opaque). The value 50 means half-transparent or half-opaque. To brighten up the text, use higher values. To dull down the text color, use a lower value.
The use of the alpha parameter is quite straightforward, for example:
“alpha”: 100, = most opaque
“alpha”: 50, = half-transparent or half-opaque
“alpha”: 75, = more opaque than transparent
“alpha”: 0, = most transparent or invisible.
Taking an example from markersAliveNormal.xc, which is the config file or alive over-target-markers (OTM) in normal (non-Alt), we set the tank name to blue with full opacity, and the text shadow to black and with full opacity, thus:
…
“tankName”: {
“name”: “Tank name”,
“visible”: true,
“x”: 0,
“y”: -36,
“alpha”: 100, <<<< 100% opacity
“color”: “0x0000FF”, <<<< blue color
“font”: {
“name”: “$FieldFont”,
“size”: 13,
“align”: “center”,
“bold”: false,
“italic”: false
},
“shadow”: {
“alpha”: 100, <<<< 100% opacity
“color”: “0x000000”, <<<< black color
“angle”: 45,
“distance”: 0,
“size”: 6,
“strength”: 200
},
“format”: “{{vehicle}}”
},
…
In XVM, colors and alpha can also be defined using winrates, WN8, hp, dmg, etc.07.05.2016 at 08:45 #109815ORTMemberHow to define colors according with macros
If, for example, you would like a text to be colored using a player’s WN8, then…
“color”: “{{c.wn8}}” <<<< {{c.wn8}} is a static mecro that defines the color according to the player’s WN8.
or player’s winrate, then…
“color”: “{{c.dmg-kind}}” <<<< {{c.dmg-kind}} is a dynamic macro that defines the color according to the source of the damage, e.g., shot, ramming, fire, etc.
Static macros are those that do not change during the course of the battle. They only update when WG updates a player’s stats.
Dynamic macros change as the battle progresses or according to a kind, such {{c:hp}} or {{c:dmg-kind}}.
{{c:hp}} changes as the battles progreses, such as the health/hitpoints of a player decreases when hit. The color used in {{c:dmg-kind}} depends on the the source of the damage inflicted, such as a shot, ramming, fire, etc.
The list of color macros and alpha macros can be found in res_mods/mods/shared_resources/xvm/doc/macros.txt, and specifically for hangar carousel macros in res_mods/mods/shared_resources/xvm/doc/macros-hangar.txt of your XVM installation, herein reproduced for reference:SpoilerColor and alpha macros available in the game
Personal macros (applied for player)
{{c:spotted}} – Dynamic color by vehicle spotted status
{{a:spotted}} – Dynamic transparency by vehicle spotted status
{{c:hp}} – color depending on current health points (only in vehicle markers)
{{c:hp-ratio}} – color depending on current health ratio (only in vehicle markers)
{{a:hp}} – transparency depending on current health points (only in vehicle markers)
{{a:hp-ratio}} – transparency depending on current health ratio (only in vehicle markers)
{{c:dmg}} – color depending on damage source
{{c:dmg-kind}} – color depending on damage kind
{{c:dmg-total}} – color depending on total sum of hits
Statistic macros
{{c:r}} – color depending on rating type selected in the personal cabinet
{{c:xr}} – color depending on rating type selected in the personal cabinet
{{c:xte}} – color depending on player per-vehicle efficiency
{{c:xeff}} – color depending on XVM Scale for efficiency
{{c:xwn6}} – color depending on XVM Scale for WN6
{{c:xwn8}} – color depending on XVM Scale for WN8
{{c:xwgr}} – color depending on XVM Scale for WG rating
{{c:eff}} – color depending on player efficiency
{{c:wn6}} – color depending on WN6 rating
{{c:wn8}} – color depending on WN8 rating
{{c:wgr}} – color depending on WG rating
{{c:winrate}} – color depending on GWR
{{c:kb}} – color depending on kilo-battles
{{c:avglvl}} – color depending on average level of tanks
{{c:t-winrate}} – color depending on current vehicle win ratio
{{c:t-battles}} – color depending on current vehicle battles
{{c:tdb}} – dynamic colors for tdb
{{c:xtdb}} – dynamic colors for xtdb
{{c:tdv}} – dynamic colors for tdv
{{c:tfb}} – dynamic colors for tfb
{{c:tsb}} – dynamic colors for tsb* Any color macro you can change to transparency macro (e.g. {{a:tdb}}).
The colors for color macros are defined in colors.xc, and are all configurable according to the user’s preferences. For example, I prefer blue for ally colors instead of the usual green.
Default XVM colors.xc config
Spoiler/**
* Color settings.
*/
{
// Color values for substitutions.
“def”: {
“al”: “0x96FF00”, // ally
“sq”: “0xFFB964”, // squadman
“tk”: “0x00EAFF”, // teamKiller
“en”: “0xF50800”, // enemy
“pl”: “0xFFDD33”, // player
// Dynamic color by various statistical parameters.
“colorRating”: {
“very_bad”: “0xFE0E00”, // very bad
“bad”: “0xFE7903”, // bad
“normal”: “0xF8F400”, // normal
“good”: “0x60FF00”, // good
“very_good”: “0x02C9B3”, // very good
“unique”: “0xD042F3” // unique
},
// Dynamic color by remaining health points.
“colorHP”: {
“very_low”: “0xFF0000”, // very low
“low”: “0xDD4444”, // low
“average”: “0xFFCC22”, // average
“above_average”: “0xFCFCFC” // above-average
}
},
“colors”: {
// System colors.
“system”: {
// Format: object_state
// Object: ally, squadman, teamKiller, enemy
// State: alive, dead, blowedup
// —-
“ally_alive”: ${“def.al”},
“ally_dead”: “0x009900”,
“ally_blowedup”: “0x007700”,
“squadman_alive”: ${“def.sq”},
“squadman_dead”: “0xCA7000”,
“squadman_blowedup”: “0xA45A00”,
“teamKiller_alive”: ${“def.tk”},
“teamKiller_dead”: “0x097783”,
“teamKiller_blowedup”: “0x096A75”,
“enemy_alive”: ${“def.en”},
“enemy_dead”: “0x840500”,
“enemy_blowedup”: “0x5A0401”,
“ally_base”: ${“def.al”},
“enemy_base”: ${“def.en”}
},
// Dynamic color by damage kind.
“dmg_kind”: {
“shot”: “0xFFAA55”, // shot
“fire”: “0xFF6655”, // fire
“ramming”: “0x998855”, // ramming
“world_collision”: “0x228855”, // world collision
“death_zone”: “0xCCCCCC”, // TODO: value, description
“drowning”: “0xCCCCCC”, // TODO: value, description
“other”: “0xCCCCCC” // other
},
// Dynamic color by vehicle type.
“vtype”: {
“LT”: “0xA2FF9A”,
“MT”: “0xFFF198”,
“HT”: “0xFFACAC”,
“SPG”: “0xEFAEFF”,
“TD”: “0xA0CFFF”,
“premium”: “0xFFCC66”,
“usePremiumColor”: false
},
// Dynamic color by spotted status
“spotted”: {
“neverSeen”: “0x000000”,
“lost”: “0xD9D9D9”,
“spotted”: “0xFFBB00”,
“dead”: “0xFFFFFF”,
“neverSeen_arty”: “0x000000”,
“lost_arty”: “0xD9D9D9”,
“spotted_arty”: “0xFFBB00”,
“dead_arty”: “0xFFFFFF”
},
// Color settings for damage.
“damage”: {
// Format: src_dst_type.
// Src: ally, squadman, enemy, unknown, player.
// Dst: ally, squadman, allytk, enemytk, enemy.
// Type: hit, kill, blowup.
“ally_ally_hit”: ${“def.tk”},
“ally_ally_kill”: ${“def.tk”},
“ally_ally_blowup”: ${“def.tk”},
“ally_squadman_hit”: ${“def.tk”},
“ally_squadman_kill”: ${“def.tk”},
“ally_squadman_blowup”: ${“def.tk”},
“ally_enemy_hit”: ${“def.en”},
“ally_enemy_kill”: ${“def.en”},
“ally_enemy_blowup”: ${“def.en”},
“ally_allytk_hit”: ${“def.tk”},
“ally_allytk_kill”: ${“def.tk”},
“ally_allytk_blowup”: ${“def.tk”},
“ally_enemytk_hit”: ${“def.en”},
“ally_enemytk_kill”: ${“def.en”},
“ally_enemytk_blowup”: ${“def.en”},
“enemy_ally_hit”: ${“def.al”},
“enemy_ally_kill”: ${“def.al”},
“enemy_ally_blowup”: ${“def.al”},
“enemy_squadman_hit”: ${“def.al”},
“enemy_squadman_kill”: ${“def.al”},
“enemy_squadman_blowup”: ${“def.al”},
“enemy_enemy_hit”: ${“def.en”},
“enemy_enemy_kill”: ${“def.en”},
“enemy_enemy_blowup”: ${“def.en”},
“enemy_allytk_hit”: ${“def.al”},
“enemy_allytk_kill”: ${“def.al”},
“enemy_allytk_blowup”: ${“def.al”},
“enemy_enemytk_hit”: ${“def.en”},
“enemy_enemytk_kill”: ${“def.en”},
“enemy_enemytk_blowup”: ${“def.en”},
“unknown_ally_hit”: ${“def.al”},
“unknown_ally_kill”: ${“def.al”},
“unknown_ally_blowup”: ${“def.al”},
“unknown_squadman_hit”: ${“def.al”},
“unknown_squadman_kill”: ${“def.al”},
“unknown_squadman_blowup”: ${“def.al”},
“unknown_enemy_hit”: ${“def.en”},
“unknown_enemy_kill”: ${“def.en”},
“unknown_enemy_blowup”: ${“def.en”},
“unknown_allytk_hit”: ${“def.al”},
“unknown_allytk_kill”: ${“def.al”},
“unknown_allytk_blowup”: ${“def.al”},
“unknown_enemytk_hit”: ${“def.en”},
“unknown_enemytk_kill”: ${“def.en”},
“unknown_enemytk_blowup”: ${“def.en”},
“squadman_ally_hit”: ${“def.sq”},
“squadman_ally_kill”: ${“def.sq”},
“squadman_ally_blowup”: ${“def.sq”},
“squadman_squadman_hit”: ${“def.sq”},
“squadman_squadman_kill”: ${“def.sq”},
“squadman_squadman_blowup”: ${“def.sq”},
“squadman_enemy_hit”: ${“def.sq”},
“squadman_enemy_kill”: ${“def.sq”},
“squadman_enemy_blowup”: ${“def.sq”},
“squadman_allytk_hit”: ${“def.sq”},
“squadman_allytk_kill”: ${“def.sq”},
“squadman_allytk_blowup”: ${“def.sq”},
“squadman_enemytk_hit”: ${“def.sq”},
“squadman_enemytk_kill”: ${“def.sq”},
“squadman_enemytk_blowup”: ${“def.sq”},
“player_ally_hit”: ${“def.pl”},
“player_ally_kill”: ${“def.pl”},
“player_ally_blowup”: ${“def.pl”},
“player_squadman_hit”: ${“def.pl”},
“player_squadman_kill”: ${“def.pl”},
“player_squadman_blowup”: ${“def.pl”},
“player_enemy_hit”: ${“def.pl”},
“player_enemy_kill”: ${“def.pl”},
“player_enemy_blowup”: ${“def.pl”},
“player_allytk_hit”: ${“def.pl”},
“player_allytk_kill”: ${“def.pl”},
“player_allytk_blowup”: ${“def.pl”},
“player_enemytk_hit”: ${“def.pl”},
“player_enemytk_kill”: ${“def.pl”},
“player_enemytk_blowup”: ${“def.pl”}
},
// Values below should be from smaller to larger.
// —-
// Dynamic color by remaining absolute health.
“hp”: [
{ “value”: 201, “color”: ${“def.colorHP.very_low” } },
{ “value”: 401, “color”: ${“def.colorHP.low” } },
{ “value”: 1001, “color”: ${“def.colorHP.average” } },
{ “value”: 9999, “color”: ${“def.colorHP.above_average”} }
],
// Dynamic color by remaining health percent.
“hp_ratio”: [
{ “value”: 10, “color”: ${“def.colorHP.very_low” } },
{ “value”: 25, “color”: ${“def.colorHP.low” } },
{ “value”: 50, “color”: ${“def.colorHP.average” } },
{ “value”: 101, “color”: ${“def.colorHP.above_average”} }
],
// Dynamic color for XVM Scale
// http://www.koreanrandom.com/forum/topic/2625-/
“x”: [
{ “value”: 16.5, “color”: ${“def.colorRating.very_bad” } }, // 00 – 16.5 – very bad (20% of players)
{ “value”: 33.5, “color”: ${“def.colorRating.bad” } }, // 16.5 – 33.5 – bad (better than 20% of players)
{ “value”: 52.5, “color”: ${“def.colorRating.normal” } }, // 33.5 – 52.5 – normal (better than 60% of players)
{ “value”: 75.5, “color”: ${“def.colorRating.good” } }, // 52.5 – 75.5 – good (better than 90% of players)
{ “value”: 92.5, “color”: ${“def.colorRating.very_good”} }, // 75.5 – 92.5 – very good (better than 99% of players)
{ “value”: 999, “color”: ${“def.colorRating.unique” } } // 92.5 – XX – unique (better than 99.9% of players)
],
// Dynamic color by efficiency
“eff”: [
{ “value”: 615, “color”: ${“def.colorRating.very_bad” } }, // 0 – 614 – very bad (20% of players)
{ “value”: 870, “color”: ${“def.colorRating.bad” } }, // 615 – 869 – bad (better than 20% of players)
{ “value”: 1175, “color”: ${“def.colorRating.normal” } }, // 870 – 1174 – normal (better than 60% of players)
{ “value”: 1525, “color”: ${“def.colorRating.good” } }, // 1175 – 1524 – good (better than 90% of players)
{ “value”: 1850, “color”: ${“def.colorRating.very_good”} }, // 1525 – 1849 – very good (better than 99% of players)
{ “value”: 9999, “color”: ${“def.colorRating.unique” } } // 1850 – * – unique (better than 99.9% of players)
],
// Dynamic color by WN6 rating
“wn6”: [
{ “value”: 460, “color”: ${“def.colorRating.very_bad” } }, // 0 – 459 – very bad (20% of players)
{ “value”: 850, “color”: ${“def.colorRating.bad” } }, // 460 – 849 – bad (better than 20% of players)
{ “value”: 1215, “color”: ${“def.colorRating.normal” } }, // 850 – 1214 – normal (better than 60% of players)
{ “value”: 1620, “color”: ${“def.colorRating.good” } }, // 1215 – 1619 – good (better than 90% of players)
{ “value”: 1960, “color”: ${“def.colorRating.very_good”} }, // 1620 – 1959 – very good (better than 99% of players)
{ “value”: 9999, “color”: ${“def.colorRating.unique” } } // 1960 – * – unique (better than 99.9% of players)
],
// Dynamic color by WN8 rating
“wn8”: [
{ “value”: 380, “color”: ${“def.colorRating.very_bad” } }, // 0 – 379 – very bad (20% of players)
{ “value”: 860, “color”: ${“def.colorRating.bad” } }, // 380 – 859 – bad (better than 20% of players)
{ “value”: 1420, “color”: ${“def.colorRating.normal” } }, // 860 – 1419 – normal (better than 60% of players)
{ “value”: 2105, “color”: ${“def.colorRating.good” } }, // 1420 – 2104 – good (better than 90% of players)
{ “value”: 2770, “color”: ${“def.colorRating.very_good”} }, // 2105 – 2769 – very good (better than 99% of players)
{ “value”: 9999, “color”: ${“def.colorRating.unique” } } // 2770 – * – unique (better than 99.9% of players)
],
// Dynamic color by WG rating
“wgr”: [
{ “value”: 2495, “color”: ${“def.colorRating.very_bad” } }, // 0 – 2494 – very bad (20% of players)
{ “value”: 4345, “color”: ${“def.colorRating.bad” } }, // 2495 – 4344 – bad (better than 20% of players)
{ “value”: 6425, “color”: ${“def.colorRating.normal” } }, // 4345 – 6424 – normal (better than 60% of players)
{ “value”: 8625, “color”: ${“def.colorRating.good” } }, // 6425 – 8624 – good (better than 90% of players)
{ “value”: 10040, “color”: ${“def.colorRating.very_good”} }, // 8625 -10039 – very good (better than 99% of players)
{ “value”: 99999, “color”: ${“def.colorRating.unique” } } //10040 – * – unique (better than 99.9% of players)
],
// Dynamic color for win chance
“winChance”: [
{ “value”: 24.5, “color”: ${“def.colorRating.very_bad” } },
{ “value”: 39.5, “color”: ${“def.colorRating.bad” } },
{ “value”: 59.5, “color”: ${“def.colorRating.normal” } },
{ “value”: 74.5, “color”: ${“def.colorRating.good” } },
{ “value”: 89.5, “color”: ${“def.colorRating.very_good”} },
{ “value”: 101, “color”: ${“def.colorRating.unique” } }
],
// Dynamic color by win percent
“winrate”: [
{ “value”: 46.5, “color”: ${“def.colorRating.very_bad” } }, // 0 – 46.5 – very bad (20% of players)
{ “value”: 48.5, “color”: ${“def.colorRating.bad” } }, // 46.5 – 48.5 – bad (better than 20% of players)
{ “value”: 52.5, “color”: ${“def.colorRating.normal” } }, // 48.5 – 52.5 – normal (better than 60% of players)
{ “value”: 57.5, “color”: ${“def.colorRating.good” } }, // 52.5 – 57.5 – good (better than 90% of players)
{ “value”: 64.5, “color”: ${“def.colorRating.very_good”} }, // 57.5 – 64.5 – very good (better than 99% of players)
{ “value”: 101, “color”: ${“def.colorRating.unique” } } // 64.5 – 100 – unique (better than 99.9% of players)
],
// Dynamic color by kilo-battles
“kb”: [
{ “value”: 2, “color”: ${“def.colorRating.very_bad” } }, // 0 – 2
{ “value”: 6, “color”: ${“def.colorRating.bad” } }, // 2 – 6
{ “value”: 16, “color”: ${“def.colorRating.normal” } }, // 6 – 16
{ “value”: 30, “color”: ${“def.colorRating.good” } }, // 16 – 30
{ “value”: 43, “color”: ${“def.colorRating.very_good”} }, // 30 – 43
{ “value”: 999, “color”: ${“def.colorRating.unique” } } // 43 – *
],
// Dynamic color by average level of player tanks
“avglvl”: [
{ “value”: 2, “color”: ${“def.colorRating.very_bad” } },
{ “value”: 3, “color”: ${“def.colorRating.bad” } },
{ “value”: 5, “color”: ${“def.colorRating.normal” } },
{ “value”: 7, “color”: ${“def.colorRating.good” } },
{ “value”: 9, “color”: ${“def.colorRating.very_good”} },
{ “value”: 11, “color”: ${“def.colorRating.unique” } }
],
// Dynamic color by battles on current tank
“t_battles”: [
{ “value”: 100, “color”: ${“def.colorRating.very_bad” } }, // 0 – 99
{ “value”: 250, “color”: ${“def.colorRating.bad” } }, // 100 – 249
{ “value”: 500, “color”: ${“def.colorRating.normal” } }, // 250 – 499
{ “value”: 1000, “color”: ${“def.colorRating.good” } }, // 500 – 999
{ “value”: 1800, “color”: ${“def.colorRating.very_good”} }, // 1000 – 1799
{ “value”: 99999, “color”: ${“def.colorRating.unique” } } // 1800 – *
],
// Dynamic color by average damage on current tank
“tdb”: [
{ “value”: 500, “color”: ${“def.colorRating.very_bad” } },
{ “value”: 750, “color”: ${“def.colorRating.bad” } },
{ “value”: 1000, “color”: ${“def.colorRating.normal” } },
{ “value”: 1800, “color”: ${“def.colorRating.good” } },
{ “value”: 2500, “color”: ${“def.colorRating.very_good”} },
{ “value”: 9999, “color”: ${“def.colorRating.unique” } }
],
// Dynamic color by average damage efficiency on current tank
“tdv”: [
{ “value”: 0.6, “color”: ${“def.colorRating.very_bad” } },
{ “value”: 0.8, “color”: ${“def.colorRating.bad” } },
{ “value”: 1.0, “color”: ${“def.colorRating.normal” } },
{ “value”: 1.3, “color”: ${“def.colorRating.good” } },
{ “value”: 2.0, “color”: ${“def.colorRating.very_good”} },
{ “value”: 15, “color”: ${“def.colorRating.unique” } }
],
// Dynamic color by average frags per battle on current tank
“tfb”: [
{ “value”: 0.6, “color”: ${“def.colorRating.very_bad” } },
{ “value”: 0.8, “color”: ${“def.colorRating.bad” } },
{ “value”: 1.0, “color”: ${“def.colorRating.normal” } },
{ “value”: 1.3, “color”: ${“def.colorRating.good” } },
{ “value”: 2.0, “color”: ${“def.colorRating.very_good”} },
{ “value”: 15, “color”: ${“def.colorRating.unique” } }
],
// Dynamic color by average number of spotted enemies per battle on current tank
“tsb”: [
{ “value”: 0.6, “color”: ${“def.colorRating.very_bad” } },
{ “value”: 0.8, “color”: ${“def.colorRating.bad” } },
{ “value”: 1.0, “color”: ${“def.colorRating.normal” } },
{ “value”: 1.3, “color”: ${“def.colorRating.good” } },
{ “value”: 2.0, “color”: ${“def.colorRating.very_good”} },
{ “value”: 15, “color”: ${“def.colorRating.unique” } }
],
// Dynamic color by WN8 effective damage
“wn8effd”: [
{ “value”: 0.6, “color”: ${“def.colorRating.very_bad” } },
{ “value”: 0.8, “color”: ${“def.colorRating.bad” } },
{ “value”: 1.0, “color”: ${“def.colorRating.normal” } },
{ “value”: 1.3, “color”: ${“def.colorRating.good” } },
{ “value”: 2.0, “color”: ${“def.colorRating.very_good”} },
{ “value”: 15, “color”: ${“def.colorRating.unique” } }
],
// Dynamic color by damage rating (percents for marks on gun)
“damageRating”: [
{ “value”: 20, “color”: ${“def.colorRating.very_bad” } }, // 20% of players
{ “value”: 60, “color”: ${“def.colorRating.bad” } }, // better than 20% of players
{ “value”: 90, “color”: ${“def.colorRating.normal” } }, // better than 60% of players
{ “value”: 99, “color”: ${“def.colorRating.good” } }, // better than 90% of players
{ “value”: 99.9, “color”: ${“def.colorRating.very_good”} }, // better than 99% of players
{ “value”: 101, “color”: ${“def.colorRating.unique” } } // better than 99.9% of players
],
// Dynamic color by hit ratio (percents of hits)
“hitsRatio”: [
{ “value”: 47.5, “color”: ${“def.colorRating.very_bad” } },
{ “value”: 60.5, “color”: ${“def.colorRating.bad” } },
{ “value”: 68.5, “color”: ${“def.colorRating.normal” } },
{ “value”: 74.5, “color”: ${“def.colorRating.good” } },
{ “value”: 78.5, “color”: ${“def.colorRating.very_good”} },
{ “value”: 101, “color”: ${“def.colorRating.unique” } }
]
}
}
The alpha values for alpha macros are defined in alpha.xc, which are also all user-configurable.
Default XVM alpha.xc config
Spoiler/**
* Options for dynamic transparency. Values from smallest to largest.
*/
{
// Dynamic transparency by various statistical parameters.
“alphaRating”: {
“very_bad”: “100”, // very bad
“bad”: “70”, // bad
“normal”: “40”, // normal
“good”: “10”, // good
“very_good”: “0”, // very good
“unique”: “0” // unique
},
// Dynamic transparency by remaining health points.
“alphaHP”: {
“very_low”: “100”, // very low
“low”: “75”, // low
“average”: “50”, // average
“above_average”: “0” // above-average
},
“alpha”: {
// Dynamic transparency by spotted status
“spotted”: {
“neverSeen”: 100,
“lost”: 100,
“spotted”: 100,
“dead”: 100,
“neverSeen_arty”: 100,
“lost_arty”: 100,
“spotted_arty”: 100,
“dead_arty”: 100
},
// Dynamic transparency by remaining health.
“hp”: [
{ “value”: 200, “alpha”: ${“alphaHP.very_low” } },
{ “value”: 400, “alpha”: ${“alphaHP.low” } },
{ “value”: 1000, “alpha”: ${“alphaHP.average” } },
{ “value”: 9999, “alpha”: ${“alphaHP.above_average”} }
],
// Dynamic transparency by percentage of remaining health.
“hp_ratio”: [
{ “value”: 10, “alpha”: ${“alphaHP.very_low” } },
{ “value”: 25, “alpha”: ${“alphaHP.low” } },
{ “value”: 50, “alpha”: ${“alphaHP.average” } },
{ “value”: 101, “alpha”: ${“alphaHP.above_average”} }
],
// Dynamic transparency for XVM Scale
“x”: [
{ “value”: 16.5, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 33.5, “alpha”: ${“alphaRating.bad” } },
{ “value”: 52.5, “alpha”: ${“alphaRating.normal” } },
{ “value”: 75.5, “alpha”: ${“alphaRating.good” } },
{ “value”: 92.5, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 999, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by efficiency
“eff”: [
{ “value”: 615, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 870, “alpha”: ${“alphaRating.bad” } },
{ “value”: 1175, “alpha”: ${“alphaRating.normal” } },
{ “value”: 1525, “alpha”: ${“alphaRating.good” } },
{ “value”: 1850, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 9999, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by WN6 rating
“wn6”: [
{ “value”: 460, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 850, “alpha”: ${“alphaRating.bad” } },
{ “value”: 1215, “alpha”: ${“alphaRating.normal” } },
{ “value”: 1620, “alpha”: ${“alphaRating.good” } },
{ “value”: 1960, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 9999, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by WN8 rating
“wn8”: [
{ “value”: 380, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 860, “alpha”: ${“alphaRating.bad” } },
{ “value”: 1420, “alpha”: ${“alphaRating.normal” } },
{ “value”: 2105, “alpha”: ${“alphaRating.good” } },
{ “value”: 2770, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 9999, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by WG rating
“wgr”: [
{ “value”: 2495, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 4345, “alpha”: ${“alphaRating.bad” } },
{ “value”: 6425, “alpha”: ${“alphaRating.normal” } },
{ “value”: 8625, “alpha”: ${“alphaRating.good” } },
{ “value”: 10040, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 99999, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by win percent
“winrate”: [
{ “value”: 46.5, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 48.5, “alpha”: ${“alphaRating.bad” } },
{ “value”: 52.5, “alpha”: ${“alphaRating.normal” } },
{ “value”: 57.5, “alpha”: ${“alphaRating.good” } },
{ “value”: 64.5, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 101, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by kilo-battles
“kb”: [
{ “value”: 2, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 6, “alpha”: ${“alphaRating.bad” } },
{ “value”: 16, “alpha”: ${“alphaRating.normal” } },
{ “value”: 30, “alpha”: ${“alphaRating.good” } },
{ “value”: 43, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 999, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by average level of player tanks
“avglvl”: [
{ “value”: 2, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 3, “alpha”: ${“alphaRating.bad” } },
{ “value”: 5, “alpha”: ${“alphaRating.normal” } },
{ “value”: 7, “alpha”: ${“alphaRating.good” } },
{ “value”: 9, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 11, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by battles on current tank
“t_battles”: [
{ “value”: 100, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 250, “alpha”: ${“alphaRating.bad” } },
{ “value”: 500, “alpha”: ${“alphaRating.normal” } },
{ “value”: 1000, “alpha”: ${“alphaRating.good” } },
{ “value”: 1800, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 99999, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by average damage on current tank
“tdb”: [
{ “value”: 500, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 750, “alpha”: ${“alphaRating.bad” } },
{ “value”: 1000, “alpha”: ${“alphaRating.normal” } },
{ “value”: 1800, “alpha”: ${“alphaRating.good” } },
{ “value”: 2500, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 9999, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by average damage efficiency on current tank
“tdv”: [
{ “value”: 0.6, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 0.8, “alpha”: ${“alphaRating.bad” } },
{ “value”: 1.0, “alpha”: ${“alphaRating.normal” } },
{ “value”: 1.3, “alpha”: ${“alphaRating.good” } },
{ “value”: 2.0, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 15, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by average frags per battle on current tank
“tfb”: [
{ “value”: 0.6, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 0.8, “alpha”: ${“alphaRating.bad” } },
{ “value”: 1.0, “alpha”: ${“alphaRating.normal” } },
{ “value”: 1.3, “alpha”: ${“alphaRating.good” } },
{ “value”: 2.0, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 15, “alpha”: ${“alphaRating.unique” } }
],
// Dynamic transparency by number of spotted enemies per battle on current tank
“tsb”: [
{ “value”: 0.6, “alpha”: ${“alphaRating.very_bad” } },
{ “value”: 0.8, “alpha”: ${“alphaRating.bad” } },
{ “value”: 1.0, “alpha”: ${“alphaRating.normal” } },
{ “value”: 1.3, “alpha”: ${“alphaRating.good” } },
{ “value”: 2.0, “alpha”: ${“alphaRating.very_good”} },
{ “value”: 15, “alpha”: ${“alphaRating.unique” } }
]
}
}
Taking all that into practical use, in the example below for player’s name in OTMs (taken from markersAliveNormal.xc), we set the player’s name color according to his WN8 stat.
…
“playerName”: {
“name”: “Player name”,
“visible”: true,
“x”: 0,
“y”: -51,
“alpha”: “{{a:wn8}“, <<<< player’s name alpha is set according to his WN8 stat.
“color”: “{{c:wn8}“, <<<< player’s name color is set according to his WN8 stat.
“font”: {
“name”: “$FieldFont”,
“size”: 13,
“align”: “center”,
“bold”: false,
“italic”: false
},
“shadow”: {
“alpha”: 100,
“color”: “0x000000”,
“angle”: 45,
“distance”: 0,
“size”: 6,
“strength”: 200
},
“format”: “<font size='{{battletype?13|{{squad?13|0}}}}’>{{name}}</font>”
},
…
-
AuthorPosts
- You must be logged in to reply to this topic.