Jump to content
Korean Random
goodman

Динамические макросы в Python

Recommended Posts

    //true - отображение в логе попаданий без урона.
    "showHitNoDamage": true, 

Ну реально молодец - я их отключал всегда - да и функция думаю всем нужная будет

Share this post


Link to post

Short link
Share on other sites
import traceback
from xvm import utils

# файл myDamageLog.py лежит в кастомной подпапке 'py_macro/my_custom'
from my_custom import myDamageLog  
...

Файл my_custom/__init__.py есть? Он нужен, чтобы питон считал папку пакетом.

Или же импортировать отдельный файл как модуль:

import my_custom.myDamageLog as myDamageLog

Рекомендую изучить тему импорта в питоне, вот хорошая серия статей: http://asvetlov.blogspot.com/2010/05/blog-post.html

Edited by sirmax

Share this post


Link to post

Short link
Share on other sites

 

 

@Shumaherxxx, поставь

"showHitNoDamage": false, 

а по центру будет отображаться попадания без урона ???

 

Так она только для лога была раньше. Формат последнего урона не касается , как я понимаю

Share this post


Link to post

Short link
Share on other sites
а по центру будет отображаться попадания без урона ???

, нет, будет отображаться с уроном.

Edited by ktulho

Share this post


Link to post

Short link
Share on other sites

@Shumaherxxx,@H_E_K_P_O_M_A_H_T_, , добавил параметр:

    //true - отображение в логе попаданий без урона.
    "showHitNoDamage": true, 

attachicon.gifdamageLog.xc

attachicon.gifmyDamageLog.rar

Спасибо, сейчас буду пробовать

У меня такой вопрос, я правильно изменил, в файле myDamageLog.py

@registerEvent(PlayerAvatar, 'handleKey')

def handleKey(self, isDown, key, mods):

    if (key == Keys.KEY_LALT) and isDown and not data.isDownAlt:

        data.isDownAlt = False 

        as_event('ON_HIT')

    if not ((key == Keys.KEY_LALT) and isDown) and data.isDownAlt:

        data.isDownAlt = False

        as_event('ON_HIT')

выделил черным

это отключает вариант по нажатию альт?

Share this post


Link to post

Short link
Share on other sites

, лучше закомментируй всю функцию:

# @registerEvent(PlayerAvatar, 'handleKey')
# def handleKey(self, isDown, key, mods):
#     if (key == Keys.KEY_LALT) and isDown and not data.isDownAlt:
#         data.isDownAlt = False 
#         as_event('ON_HIT')
#     if not ((key == Keys.KEY_LALT) and isDown) and data.isDownAlt:
#         data.isDownAlt = False
#         as_event('ON_HIT')
  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

post-29578-0-83554700-1475776506_thumb.jpg

 

I tried to set my config like my previous with gambiter panel but i have some problem with no damage shot color and c:costshell.

 

In my screen, all shots are orange.

it will be good if the zero no damage shot (ricochet,bounce...) will have a specific color like in gambiter.

i would like to see like in the screen :

post-29578-0-68338600-1475776807_thumb.jpg

 

Seems the c:costShell macro not working, i set yellow but always grey.

 

Maybe it's a problem with my damageLog.xc If someone can get a look ?

I attach my old gambiter config too

 

Thanks

damageLog.xc

Log.cfg

Edited by panteror

Share this post


Link to post

Short link
Share on other sites

"showHitNoDamage": false,

 

а по центру будет отображаться попадания без урона ???

, нет, будет отображаться с уроном.

Я извиняюсь - но по центру не пробития и рикошеты отображаются . Эта функция у Влада только для лога была. Да и полагаю в formatLastHit нужно видеть, кто тебя не пробил . А вот в formatHistory - это на любителя . Так что всё получается работает как положено   :no1:

Edited by H_E_K_P_O_M_A_H_T_

Share this post


Link to post

Short link
Share on other sites

 

@Shumaherxxx, поставь

"showHitNoDamage": false, 

Не критично,но вот небольшая ошибочка.....не мудрено после стольких хотелок:))

},

    // теКст попадания без урона (рикошет, не пробито, без урона) (макрос {{dl.damage}})

  • Upvote 1

Share this post


Link to post

Short link
Share on other sites

Maybe it's a problem with my damageLog.xc

yes, check your config:

    "dmg-kind": {
      "shot": "<font color = '{{dl.c:costShell}}'>{{dl.type-shell}}</font>", // don't use the macro here, this is not necessary
      "fire": "<font face = 'xvm' color = '{{dl.c:dmg-kind}}'>Q</font>", // here and below, the color is not needed, it is defined in section "c:dmg-kind"

@ktulho, в реплеях totalEfficiency отдает null, можно убрать?

 

post-24956-0-22365300-1475778412_thumb.jpg

Edited by Kapany3uk

Share this post


Link to post

Short link
Share on other sites

 

 

в реплеях totalEfficiency отдает null, можно убрать?
, должны быть нули в реплеях. В логах ошибки нет? 

 

 

Я извиняюсь - но по центру не пробития и рикошеты отображаются .
, это я затупил, хотел написать, что все попадания будут отображаться. 

Share this post


Link to post

Short link
Share on other sites

yes, check your config:

    "dmg-kind": {
      "shot": "<font color = '{{dl.c:costShell}}'>{{dl.type-shell}}</font>", // don't use the macro here, this is not necessary
      "fire": "<font face = 'xvm' color = '{{dl.c:dmg-kind}}'>Q</font>", // here and below, the color is not needed, it is defined in section "c:dmg-kind"

@ktulho, в реплеях totalEfficiency отдает null, можно убрать?

 

attachicon.gifshot_098.jpg

thanks for looking

I know, the problem is that I want a different color for shot damage and type-shell, if i remove the macro, the shot damage and type shell are in the same color : gold or grey. It's no big deal but it's working with gambiter like in my second screen.

Edited by panteror

Share this post


Link to post

Short link
Share on other sites

 

, это я затупил, хотел написать, что все попадания будут отображаться. 

 

Да всеровно молодец - сделал как положено :no1:  . Я ещё про это спрашивал

// Изменение HP игрока.

  "typesHit": {

   "damage":   "#FF0000", // уменьшение (урон)

   "nodamage": "#333333", // без изменений (без урона)

  },

Тень не плохо было этим макросом красить в formatLastHit

Share this post


Link to post

Short link
Share on other sites

 

 

, должны быть нули в реплеях. В логах ошибки нет?
ага, есть :)) 

я переименовываю экспорты: вместо xvm.* ставлю my.* а тут в .ру на автомате поменял, а в labels.хс забыл

 

Когда уже зарелизишь?!  (я так-то переименовываю потому, что пока не в составе xvm...)

Share this post


Link to post

Short link
Share on other sites
Когда уже зарелизишь?!  (я так-то переименовываю потому, что пока не в составе xvm...)

,

 

Надо обсудить конфиг в теме "Предложения по стандартному конфигу". И может поправить название макросов. И комментарии на английском добавить, а то я по английски ни в зуб ногой.

@Kapany3uk, кстати, я правильно понимаю panteror, он хочет красить число урона по макросу?

Edited by ktulho

Share this post


Link to post

Short link
Share on other sites
Файл my_custom/__init__.py есть? Он нужен, чтобы питон считал папку пакетом. Или же импортировать отдельный файл как модуль:

сделал и так и так (добавил файл init и импорт как модуль), все отлично работает, спасибо! :))

   

 

кстати, я правильно понимаю panteror, он хочет красить число урона по макросу?

не, он хочет, чтобы урон красился одним цветом (у него желтый), а рикошеты и непробития без урона - другим (серым), при этом по типу снаряда так и должно краситься в "золото" и "серебро".

 

   

@demon2597, как признанный мэтр дефолта, возьмешься? :))

Надо обсудить конфиг в теме "Предложения по стандартному конфигу". ... И комментарии на английском добавить, а то я по английски ни в зуб ногой
Edited by Kapany3uk

Share this post


Link to post

Short link
Share on other sites

Добавил макрос

{{dl.c:hit-effects}} - цвет по типу попадания (с уроном, рикошет, не пробито, без урона)

И секцию:

    // цвет по типу попадания (с уроном, рикошет, не пробито, без урона) (макрос {{dl.c:hit-effects}})
    "c:hit-effects": {
      "armor_pierced": "#FF4D3C",
      "intermediate_ricochet": "#E3E3E3",
      "final_ricochet": "#E3E3E3",
      "armor_not_pierced": "#E3E3E3",
      "armor_pierced_no_damage": "#E3E3E3"
    },  

@H_E_K_P_O_M_A_H_T_,@panteror, думаю это вам подойдет.

 

post-17624-0-16420100-1475786677.jpg

 

damageLog.xc

myDamageLog.rar

Edited by ktulho
  • Upvote 3

Share this post


Link to post

Short link
Share on other sites

Добавил макрос

{{dl.c:hit-effects}} - цвет по типу попадания (с уроном, рикошет, не пробито, без урона)

И секцию:

    // цвет по типу попадания (с уроном, рикошет, не пробито, без урона) (макрос {{dl.c:hit-effects}})
    "c:hit-effects": {
      "armor_pierced": "#FF4D3C",
      "intermediate_ricochet": "#E3E3E3",
      "final_ricochet": "#E3E3E3",
      "armor_not_pierced": "#E3E3E3",
      "armor_pierced_no_damage": "#E3E3E3"
    },  

@H_E_K_P_O_M_A_H_T_,@panteror, думаю это вам подойдет.

 

attachicon.gifdamageLog.xc

attachicon.gifmyDamageLog.rar

 

yes thank you

it's ok for shot damage, the hit-effects macro is working but I need to do more test with fire damage for example but I don't have a replay for testing.

Fire damage, ramming are not in c:hit-effects macro, so i don't know in what color will be this type of damage.

 

post-29578-0-36806800-1475786884_thumb.jpg

 

Edited by panteror

Share this post


Link to post

Short link
Share on other sites

"LastHit": {
      "shadow": { "color": "{{dl.c:hit-effects}}" },

Тень не красит - макрос наверно не понимает . 

 

такой конечный результат хотел сделать

 

Edited by H_E_K_P_O_M_A_H_T_

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