Jump to content
Korean Random
Sign in to follow this  
CrazyST

xvm.log забит ошибками SyntaxError: invalid syntax arg='math.div(,1000)'

Recommended Posts

Собственно из-за такой вот строки в carouselNormal.xc

 

{ "enabled": true, "x": 80, "y": 52, "align": "center", "format": "<font face='$FieldFont' size='14' color='{{v.c_type}}'>{{v.xpToEliteLeft>0?{{v.xpToEliteLeft>999?{{py:math.div({{v.xpToEliteLeft}},1000)%d}}k|{{v.xpToEliteLeft}}}}<img src='img://gui/maps/icons/library/XPIcon-1.png' width='16' height='16' align='center' vspace='-3'>({{v.xp%d}})|}}</font>", "shadow": ${ "def.textFieldShadow" } }

куча ошибок в логе
 

2018-12-25 00:29:42: [ERROR] Traceback (most recent call last):
  File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 156, in process_python_macro
    (func, deterministic) = get_function(arg)
  File "res_mods/mods/xfw_packages\xvm_main\python\python_macro.py", line 144, in get_function
    args = ast.literal_eval(args_string)
  File "scripts/common/Lib/ast.py", line 49, in literal_eval
  File "scripts/common/Lib/ast.py", line 37, in parse
  File "<unknown>", line 1
    (,1000)
     ^
SyntaxError: invalid syntax
arg='math.div(,1000)'

можно с этим что-то сделать?

xvm.log

carouselNormal.xc

Share this post


Link to post

Short link
Share on other sites

{{v.xpToEliteLeft}} возвращает пусто для элитного танка. В конструкции {{py:math.div({{v.xpToEliteLeft}},1000)%d}} пусто делится на 1000.

Share this post


Link to post

Short link
Share on other sites
1 час назад, HEKPOMAHT сказал:

{{v.xpToEliteLeft}} возвращает пусто для элитного танка. В конструкции {{py:math.div({{v.xpToEliteLeft}},1000)%d}} пусто делится на 1000.

это понятно и так ))

вопрос в том, что можно с этим сделать? ))

Share this post


Link to post

Short link
Share on other sites
7 часов назад, ktulho сказал:

@CrazyST попробуйте вместо


{{v.xpToEliteLeft>0?

Написать:


{{v.xpToEliteLeft?

 

к сожалению это ничего не даёт. похоже что расчеты всё равно идут по всему выражению, а условие используется только для определения что из него отображать.

Edited by CrazyST

Share this post


Link to post

Short link
Share on other sites
{ "enabled": true, "x": 80, "y": 52, "align": "center", "format": "<font face='$FieldFont' size='14' color='{{v.c_type}}'>{{v.xpToEliteLeft?{{v.xpToEliteLeft%'d}}<img src='img://gui/maps/icons/library/XPIcon-1.png' width='16' height='16' vspace='-3'>({{v.xp%d}})}}</font>", "shadow": ${ "def.textFieldShadow" } }

 

Share this post


Link to post

Short link
Share on other sites
{{py:math.div({{v.xpToEliteLeft?{{v.xpToEliteLeft}}|0}},1000)%d}}

 

Edited by ktulho
  • Upvote 2

Share this post


Link to post

Short link
Share on other sites
32 минуты назад, ktulho сказал:

{{py:math.div({{v.xpToEliteLeft?{{v.xpToEliteLeft}}|0}},1000)%d}}

 

Сработало. Спасибо.

Share this post


Link to post

Short link
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...