Jump to content
Korean Random
zekias87

Help with adding penetration calculator

Recommended Posts

I would like to know if there is someone out there who could help me implement a penetration calculator.

I did some searching and come up with the russian forums

Since I cant speak russian I Google translated it and found a Probability of penetration file "chancePenetration.py" which I also have attached in this post.

But my problem is that I dont know how to use it. I have placed it in "py_macro" folder but that does nothing, so I guess I need to somehow implement it by creating another file somewhere?

 

What I am hoping is that someone out there alreay have done this or knows how to do it and are willing to help.

 

chancePenetration.py

Share this post


Link to post

Short link
Share on other sites

Well, the .py files only contain the macros definitions and all that stuff. To actually use a macro, you need to use it in your config.

 

Share this post


Link to post

Short link
Share on other sites

You need to update your configuration.  

To you battlelabels.xc you need to add something like:

${ "battleLabelSight.xc":"def.piercingChance"},

 

Then in battlelabeltemplates.xc add

    "piercingChance": {
      "enabled": true,
      "flags": [ "alive" ],
      "updateEvent": "PY(ON_CALC_ARMOR), PY(ON_CAMERA_MODE)",
      "x": 0,
      "y": "{{py:sight.cameraMode=arc?-49|{{py:sight.cameraMode=sn?39|44}}}}",
      "width": 100,
      "height": 26,
      // "borderColor": "0xFF0000", //!!!
      "screenHAlign": "center",
      "screenVAlign": "center",
      "alpha" : 100,
      "shadow": { "distance": 1, "angle": 90, "alpha": 90, "blur": 5, "strength": 3 },
      "textFormat": { "align": "center", "valign": "center" },
      "format": "<font color='{{py:sight.c_piercingChance}}' size='16'>{{py:sight.piercingActual}} {{py:sight.piercingActual?/|}} {{py:sight.armorActual}}</font>"
    },    

Share this post


Link to post

Short link
Share on other sites
10 hours ago, SRQFlyer said:

You need to update your configuration.  

To you battlelabels.xc you need to add something like:

${ "battleLabelSight.xc":"def.piercingChance"},

 

Then in battlelabeltemplates.xc add

    "piercingChance": {
      "enabled": true,
      "flags": [ "alive" ],
      "updateEvent": "PY(ON_CALC_ARMOR), PY(ON_CAMERA_MODE)",
      "x": 0,
      "y": "{{py:sight.cameraMode=arc?-49|{{py:sight.cameraMode=sn?39|44}}}}",
      "width": 100,
      "height": 26,
      // "borderColor": "0xFF0000", //!!!
      "screenHAlign": "center",
      "screenVAlign": "center",
      "alpha" : 100,
      "shadow": { "distance": 1, "angle": 90, "alpha": 90, "blur": 5, "strength": 3 },
      "textFormat": { "align": "center", "valign": "center" },
      "format": "<font color='{{py:sight.c_piercingChance}}' size='16'>{{py:sight.piercingActual}} {{py:sight.piercingActual?/|}} {{py:sight.armorActual}}</font>"
    },    

 

Thanks man, exactly what I was hoping foir! I will try that out!

 

Edit* It works exactly like I was looking for! Thanks again, you are the king!

        I would never have figured that out on my own. Helpful people like you makes the world go around. Rep+

Edited by zekias87
New info
  • Upvote 1

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.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...