Slava7572 1,685 #391202 Posted May 19, 2017 try: # with open('res_mods/configs/expected_tank_values.json') as values_file: # self.user['expValues'] = json.load(data_file) # except Exception as e: # LOG_WARN('Cannot load expected tank values (%s)' % (e,)) Does this mean that you need to set the expected values file on the specified path? Quote Share this post Link to post Short link Share on other sites
refaol 223 #391205 Posted May 19, 2017 (edited) Does this mean that you need to set the expected values file on the specified path? Там же комментарий вставлен (в том смысле, что строки закомментированы) Edited May 19, 2017 by refaol Quote Share this post Link to post Short link Share on other sites
Slava7572 1,685 #391217 Posted May 19, 2017 Там же комментарий вставлен (в том смысле, что строки закомментированы) Я знаю,что заммичены,может раскомитить и считать по нормальному файлу ожидаемых значений.Если я все верно понял,сейчас он берет данные из ХВМ,а там до сих пор самая дебильная версия expected_tank_values.json в истории всего ВН8. Quote Share this post Link to post Short link Share on other sites
Tey 34 #391219 Posted May 19, 2017 Does this mean that you need to set the expected values file on the specified path? No, this is old code that I wrote before I realize that XVM already provides the WN8 expected values to Python scripts. It's still there (but commented) just in case I need something similar for the config. Quote Share this post Link to post Short link Share on other sites
refaol 223 #391221 Posted May 19, 2017 Если я все верно понял,сейчас он берет данные из ХВМ,а там до сих пор самая дебильная версия expected_tank_values.json в истории всего ВН8. А ее ты тоже поменял как то, ту что в хвм? Где и как подскажи plz, если да. Quote Share this post Link to post Short link Share on other sites
Slava7572 1,685 #391228 Posted May 19, 2017 А ее ты тоже поменял как то, ту что в хвм? Где и как подскажи plz, если да. Не,я не менял,просто хвм одно показывает,как у всех думаю.а все остальные статистики другое,нормальное.Я не спец в питоне и вообще в хвм,но вроде он значения берет с сервера. (response, duration, errStr) = loadUrl(__WN8_EXPECTED_DATA_URL) No, this is old code that I wrote before I realize that XVM already provides the WN8 expected values to Python scripts. It's still there (but commented) just in case I need something similar for the config. I realized, although I personally would prefer this option :)Thanks for your code. Quote Share this post Link to post Short link Share on other sites
mikas 10 #394210 Posted June 7, 2017 Здесь временное решение отображения шанса)) Что то ни как не пойму что и как делать)) Quote Share this post Link to post Short link Share on other sites
SEREGA_SF 611 #394216 Posted June 7, 2017 (edited) Интересно отображает) -5% ) Edited June 7, 2017 by SEREGA_SF Quote Share this post Link to post Short link Share on other sites
xenus 62 #394220 Posted June 7, 2017 (edited) Интересно отображает) -5% ) shot_038.jpg Тут скорее отображаеться перевес команд в пользу одной или другой команды по WN8 нежели конкретно сам шанс на победу. Edited June 7, 2017 by xenus Quote Share this post Link to post Short link Share on other sites
Slava7572 1,685 #394221 Posted June 7, 2017 Интересно отображает) -5% ) shot_038.jpg Здесь на проценты особого внимания не смысла обращать,это просто разница по общему ВН8 тимы,лучше циферки включи,там понятней будет.Тем более,что это не шанс на победу,а просто общий скилл без учета уровней и пр. Quote Share this post Link to post Short link Share on other sites
SEREGA_SF 611 #394226 Posted June 7, 2017 (edited) Да мне интересно просто было, как оно будет показывать)) Я уже привык по раскаткам ориентироваться, да по спискам)) Просто если выводит процентное соотношение - не должно с минусами быть, по идее нулем должно ограничиваться)) Edited June 7, 2017 by SEREGA_SF Quote Share this post Link to post Short link Share on other sites
Slava7572 1,685 #394235 Posted June 7, 2017 Да мне интересно просто было, как оно будет показывать)) Я уже привык по раскаткам ориентироваться, да по спискам)) Просто если выводит процентное соотношение - не должно с минусами быть, по идее нулем должно ограничиваться)) В смысле,как не должно,у твоей тимы меньше суммарный ВН8 на столько то процентов.Этот скрипт просто показывает общий скилл,опять же без учета уровня и прочего,это не шанс)))Если бы показывал шанс,то в данном случае было бы 45/55%,если я не ошибаюсь. 1 1 Quote Share this post Link to post Short link Share on other sites
SEREGA_SF 611 #394253 Posted June 8, 2017 (edited) Да ты Славк не понял, я и не про шанс говорю. Смотри, к примеру у моей тимы суммарный WN8 выше чем у противника на 5% - соответственно цифирька рисуется зеленым цветом. Наоборот, у нас меньше на 5% - рисуется красным. Минуса нафига не нужны выходит)) А нуль - это вообще в редких случаях можно сделать, когда одна тима сплошь из красных, другая наоборот бирюза/фиолет (но это совсем редкость) Edited June 8, 2017 by SEREGA_SF 1 Quote Share this post Link to post Short link Share on other sites
Slava7572 1,685 #394311 Posted June 8, 2017 Минуса нафига не нужны выходит)) А,ты про это,так скрипт же открытый,убери символ)) Quote Share this post Link to post Short link Share on other sites
SEREGA_SF 611 #394318 Posted June 8, 2017 Ахах Славк, умел бы я еще в скриптах ковыряться)) Quote Share this post Link to post Short link Share on other sites
Slava7572 1,685 #394349 Posted June 8, 2017 Ахах Славк, умел бы я еще в скриптах ковыряться)) Вроде тут,но я тоже нуващенекодер))) строка 101 def alliesAliveRatingRatio(): if enemies_wn8 != 0 and allies_wn8 != 0: if enemies_wn8 > allies_wn8: return int(-(1.0 - allies_wn8 / enemies_wn8) * 100) по идее(но это не точно),должно быть аналогично следующему ифу(элсу) в плане скобок,вот так: def alliesAliveRatingRatio(): if enemies_wn8 != 0 and allies_wn8 != 0: if enemies_wn8 > allies_wn8: return int((1.0 - allies_wn8 / enemies_wn8) * 100) else: return int((1.0 - enemies_wn8 / allies_wn8) * 100) Для верочки спроси у гуру,ktulho,Kotyarko_O,night_dragon_on,они в этом шарят. 2 2 Quote Share this post Link to post Short link Share on other sites
SEREGA_SF 611 #394352 Posted June 8, 2017 Хых, попробую Славк, в лоб то все равно не получу, да и игру не убью, а пробовать учиться никогда не поздно)) Quote Share this post Link to post Short link Share on other sites
NiseriuS 0 #395395 Posted June 15, 2017 (edited) hi, i did a few modifications, maybe someone will find useful: (WinChance is from 1% to 99% regarding on own team, colored in green if >50% or red if <50% / no negative chances "-") EDIT: mod_wn8_chance.py (at line 101) def alliesAliveRatingRatio(): if enemies_wn8 != 0 and allies_wn8 != 0: if enemies_wn8 > allies_wn8: return int(50 - (1.0 - allies_wn8 / enemies_wn8) * 50) else: return int(50 + (1.0 - enemies_wn8 / allies_wn8) * 50) return mod_wn8_chance.py.rar EDIT: battleLabelsTemplates.xc "def": { "teamRating": { "enabled": true, "updateEvent": "PY(ON_UPDATE_TEAM_RATING)", "x": 230, "y": 2, "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 }, "textFormat": { "size": 14 }, "format": "Team WN8: <font color='{{py:alliesAliveRatingRatio>=50?#00EE00|#EE0000}}'>{{py:alliesAliveRating}} {{py:alliesAliveRatingRatio=50?=|{{py:alliesAliveRatingRatio>50?>|<}}}} {{py:enemiesAliveRating}}</font>" }, "teamRating_WinChance": { "enabled": true, "updateEvent": "PY(ON_UPDATE_TEAM_RATING)", "x": 230, "y": 25, "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 }, "textFormat": { "size": 14 }, "format": "WinChance: <font color='{{py:alliesAliveRatingRatio>=50?#00EE00|#EE0000}}'>{{py:alliesAliveRatingRatio}}%</font>" }, EDIT: battleLabels.xc "formats": [ ${ "battleLabelsTemplates.xc":"def.teamRating" }, ${ "battleLabelsTemplates.xc":"def.teamRating_WinChance" } ] }} Edited June 15, 2017 by NiseriuS Quote Share this post Link to post Short link Share on other sites
refaol 223 #395440 Posted June 15, 2017 (edited) А если в "teamRating_WinChance" заменить фрагмент <font color='{{py:alliesAliveRatingRatio>=50?#00EE00|#EE0000}}'>{{py:alliesAliveRatingRatio}}%</font>" на <font color='{{py:alliesAliveRatingRatio>=90?#D042F3|{{py:alliesAliveRatingRatio>=75?#02C9B3|{{py:alliesAliveRatingRatio>=60?#60FF00|{{py:alliesAliveRatingRatio>=40?#F8F400|{{py:alliesAliveRatingRatio>=25?#FE7903|#FE0E00}}}}}}}}}}'>{{py:alliesAliveRatingRatio}}%</font>" то "шанс" будет окрашиваться в заданные цвета по шкале Edited June 15, 2017 by refaol 4 Quote Share this post Link to post Short link Share on other sites
Prostoi 9 #399016 Posted July 26, 2017 hi, i did a few modifications, maybe someone will find useful: (WinChance is from 1% to 99% regarding on own team, colored in green if >50% or red if <50% / no negative chances "-") EDIT: mod_wn8_chance.py (at line 101) def alliesAliveRatingRatio(): if enemies_wn8 != 0 and allies_wn8 != 0: if enemies_wn8 > allies_wn8: return int(50 - (1.0 - allies_wn8 / enemies_wn8) * 50) else: return int(50 + (1.0 - enemies_wn8 / allies_wn8) * 50) return mod_wn8_chance.py.rar EDIT: battleLabelsTemplates.xc "def": { "teamRating": { "enabled": true, "updateEvent": "PY(ON_UPDATE_TEAM_RATING)", "x": 230, "y": 2, "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 }, "textFormat": { "size": 14 }, "format": "Team WN8: <font color='{{py:alliesAliveRatingRatio>=50?#00EE00|#EE0000}}'>{{py:alliesAliveRating}} {{py:alliesAliveRatingRatio=50?=|{{py:alliesAliveRatingRatio>50?>|<}}}} {{py:enemiesAliveRating}}</font>" }, "teamRating_WinChance": { "enabled": true, "updateEvent": "PY(ON_UPDATE_TEAM_RATING)", "x": 230, "y": 25, "shadow": { "distance": 1, "angle": 90, "alpha": 80, "blur": 5, "strength": 1.5 }, "textFormat": { "size": 14 }, "format": "WinChance: <font color='{{py:alliesAliveRatingRatio>=50?#00EE00|#EE0000}}'>{{py:alliesAliveRatingRatio}}%</font>" }, EDIT: battleLabels.xc "formats": [ ${ "battleLabelsTemplates.xc":"def.teamRating" }, ${ "battleLabelsTemplates.xc":"def.teamRating_WinChance" } ] } } Так и не понял как это сделать( Quote Share this post Link to post Short link Share on other sites