Jump to content
Korean Random
Sign in to follow this  
scyorkie

Help with definitions

Recommended Posts

I generally understand how to create definitions. See: https://koreanrandom.com/forum/topic/37932-is-it-possible-to-consolidate-items-in-markers-files/

But I need help with something specific.

 

I have a PP extraField that goes like this:

"format": "<font color='#D3D3D3'><font color='{{player?{{c:wn8}}|{{wn8>899?{{c:wn8}}|{{wn8<300?{{c:wn8}}|#D3D3D3}}}}}}'>{{name%.10s~..}}</font></font>"

 

The entire blue part can go into a definition section under "WN8name", and that entire line above can be changed to:

"format": ${"def.WN8name"}

 

However, what if I only want to create a definition for the orange part?

"format": "<font color='#D3D3D3'><font color='{{player?{{c:wn8}}|{{wn8>899?{{c:wn8}}|{{wn8<300?{{c:wn8}}|#D3D3D3}}}}}}'>{{name%.10s~..}}</font></font>"

 

Is it possible? I've tried some permutations of the usual way of making definitions and they didn't work.

Share this post


Link to post

Short link
Share on other sites

However, what if I only want to create a definition for the orange part?

 

use {{.}} macro

for example:

- create a new file or section (may be use existing) with your own macros (named "my" or how you want) with this:

  "my": {
      "wn8color": "{{player?{{c:wn8}}|{{wn8>899?{{c:wn8}}|{{wn8<300?{{c:wn8}}|#D3D3D3}}}}}}"
  }

- in @xvm.xc write reference to this new file/section

- in config use written macro: 

"format": "<font color='#D3D3D3'><font color='{{.my.wn8color}}'>{{name%.10s~..}}</font></font>"

ps. read more and see example

Share this post


Link to post

Short link
Share on other sites

[ 1 ] I created a "def" section at the top of the PP file:

 

"def": {
      "wn8color": "{{player?{{c:wn8}}|{{wn8>899?{{c:wn8}}|{{wn8<300?{{c:wn8}}|#D3D3D3}}}}}}"
  }

 

What doesn't work:

 

i. <font color='{{.def.wn8color}}'> doesn't work. I don't think it can ever work, based on sirmax's explanation here.

 

ii. <font color='{{.playersPanel.def.wn8color}}'> doesn't work.

    I think this is because @xvm.xc points ".playersPanel" past the "def" section and directly to the "playersPanel" section in the middle of the file.

 

What works:

 

a. <font color='{{.playersPanel.def.wn8color}}'> will work if "def" is created in playersPanel.xc > playersPanel section.

 

b. <font color='{{.texts.def.wn8color}}'> works if "def" is created under texts.xc > texts.

 

c. Creating "def" in a new .xc file and referencing that in @xvm.xc works but I prefer not to, because I always overwrite that when I update XVM.

 

d. Creating "def" in a new .xc file and referencing that in playersPanel.xc only works if the reference is made in playersPanel.xc > playersPanel section.
    That new file is "inserted" into playersPanel.xc at the point of reference, and becomes part of it. The syntax is similar to method (a) above.

 

However, the problem with the 4 methods above is that changes made to this "def" section are not reflected by "autoReloadConfig" function. 

By comparison, if I use the general definition method ("format": ${"def.WN8name"}) for the entire "format" field, changes will be reflected by "autoReloadConfig".

Any fix for this?

 

----- ----- ----- ----- ----- ----- ----- -----

 

[ 2 ] I also looked at your example that you linked, and cannot understand this part in blue (comments translated with Google):

 

// macro to add to your game nick in his own name {{._my._i.{{name}}}}
"_i": { "Duv21": " *Илья", "Duv21_RU": " *Илья" },
// macro to insert player name {{._my._name}}
"_name": "<font color='{{clannb=VO_SP?#FFCC66|{{player?#FFB964}}}}'>{{clan?{{name%.14s~..}}|{{name}}}}{{._my._i.{{name}}}}</font>",

 

I can see that it is to add " *Илья" behind player name, if player is Duv21 (or Duv21_RU). But how do the "_i" definition and the {{._my._i.{{name}}}} macro work exactly? I've not seen a similar example in these forums before.

 

----- ----- ----- ----- ----- ----- ----- -----

 

[ 3 ] The use of <textformat> in your statisticForm relates to this other question I had here.

 

If I follow your example, using:

 

"formatLeftNick": "<textformat leading='-15'><font size='12' color='#555555'>{{clannb}}</font>\n</textformat><textformat leftMargin='39'><font size='12'>{{name}}</font></textformat>",
"formatRightNick": "<textformat leading='-15'><font size='12' color='#555555'>{{clannb}}</font>\n</textformat><textformat rightMargin='39'><font size='12'>{{name}}</font></textformat>",

 

I can achieve this: http://i.imgur.com/yvDEhNZ.jpg

 

However, how do I (without using monospace fonts) make allies' clan names alight to the right so that they are nearer to player names (like so: http://i.imgur.com/mDzsoI4.jpg), and enemy clan names similarly align to the left?

Edited by scyorkie

Share this post


Link to post

Short link
Share on other sites

2.

The macro {{._my._i.{{name}}}} returns the value that corresponds to the key/parameter(or whatever you call it) in the section _my->_i, that is equal to the value returned by the {{name}} macro.

Share this post


Link to post

Short link
Share on other sites

del

Edited by Kapany3uk

Share this post


Link to post

Short link
Share on other sites

2.

The macro {{._my._i.{{name}}}} returns the value that corresponds to the key/parameter(or whatever you call it) in the section _my->_i, that is equal to the value returned by the {{name}} macro.

 

This is very interesting and actually helps with a question I've been thinking of asking for a long time.

 

The default way of assigning icons to players is by using the res\clanicons\[server]\nick folder.

 

With the {{.}} macro, there are more options:

 

Option 1:

- Set a definition in PP to display an image, with the "format" field as follows: "format": "{{.texts.nameicons.{{name}}}}"

- Then texts.xc > nameicons, set "playername": "<img src='xvm://res/icons/friend.png'>"

- With a single definition, you can set different icons for different players (limited to 1 icon per player)

 

Option 2:

- Set a definition in PP to display an image, with the "alpha" field as follows: "alpha": "{{.texts.icons.friends.{{name}}|0}}"

- Then texts.xc > icons > friends, set "playername": "100"

- Using this method, you can set multiple icons per player, but you also require multiple definitions in PP and multiple sections in texts.xc

 

Are there other methods that I don't know about? Is there one way to just poll names from a list without having to also pair a value (whether alpha, or path to image) to a player name? This would make for easier maintenance.

Edited by scyorkie

Share this post


Link to post

Short link
Share on other sites

Is there one way to just poll names from a list without having to also pair a value (whether alpha, or path to image) to a player name? This would make for easier maintenance.

Hm, I'm not sure what you mean. Could you give some example?

Share this post


Link to post

Short link
Share on other sites

Hm, I'm not sure what you mean. Could you give some example?

 

Let's say I use Option 2, my texts.xc > icons > friends section would look something like this:

 

"friends": {

  "friend1":      "100",

  "friend2":      "100",

  "friend3":      "100",

  ...

}

 

Is there some way I can make it look like this:

 

"friends": {

  "friend1",

  "friend2",

  "friend3",

  ...

}

 

i.e. remove "100" value for alpha, thus making the list simpler.

Share this post


Link to post

Short link
Share on other sites

Ah, I thought about it once as well. I guess it's not possible though. There always has to be a key and the corresponding value. Maybe something can be done using Python macros.

Share this post


Link to post

Short link
Share on other sites

Do let me know if you come up with something! In the meantime, the new options make it easier to change the icons all at once without having to rename multiple files.

Share this post


Link to post

Short link
Share on other sites

@scyorkie, use the "white" list. Right in the hangar in XVM-comments add the link to the icon or label ("friend", for example) and in battle in the pp/markers will display the nick of the player + defined icon/label. It is still in your version I'll have to remember all the nicknames and edit the config, it's easier to do it right in the hangar. And then you can remove a player from your contacts - icon will still be visible.

Share this post


Link to post

Short link
Share on other sites

Mm OK I'll try it after WGNA fixes the bugged contact list.

I've not been able to use my contact list for weeks.

Share this post


Link to post

Short link
Share on other sites

 

 

I'll try it after WGNA fixes the bugged contact list
it was not about WG notes the contact's name, and XVM comments

Share this post


Link to post

Short link
Share on other sites

@scyorkie, I don't know what problem you have, in the EU client everything is fine 

post-24956-0-61524400-1497009790_thumb.jpg

Share this post


Link to post

Short link
Share on other sites

Yeah it's a NA problem. They say they were doing maintenance for the contact list, and many people were negatively affected. Not fixed for weeks.

Share this post


Link to post

Short link
Share on other sites

With the {{.}} macro, there are more options:

...

Option 2:

- Set a definition in PP to display an image, with the "alpha" field as follows: "alpha": "{{.texts.icons.friends.{{name}}|0}}"

- Then texts.xc > icons > friends, set "playername": "100"

- Using this method, you can set multiple icons per player, but you also require multiple definitions in PP and multiple sections in texts.xc

 

Are there other methods that I don't know about? Is there one way to just poll names from a list without having to also pair a value (whether alpha, or path to image) to a player name? This would make for easier maintenance.

 

Just to return to this for a bit -- if I use Option 2 and set my "alpha" as follows: "alpha": "{{.texts.icons.friends.{{name}}?100|0}}"

That part in bold becomes the "master control" for alpha.

So it doesn't matter if in texts.xc > icons > friends, you set "playername": "" (ie no value) but you still need the : "" to be there.

Share this post


Link to post

Short link
Share on other sites

Yeah it's a NA problem. They say they were doing maintenance for the contact list, and many people were negatively affected. Not fixed for weeks.

All is ok on NA, as I can see. Can you attach log files after opening contacts list?

Share this post


Link to post

Short link
Share on other sites

Logs attached.

FYI the contact list issue persists even in vanilla client. 

 

Here is a post on the NA forums which includes ticket responses from WG that confirm that it's a problem on WG's end:

http://forum.worldoftanks.com/index.php?/topic/545615-cannot-connect-to-chat-server-no-friends-lists/page__pid__11041553#entry11041553

python.log

xvm.log

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...