avogatro Posted March 17, 2023 Share Posted March 17, 2023 If I want to do coalition-15 mission with honor, and I got 2 ace and 1 first class already, I expect the mod to not reset, until I fail all 20 games. observation: It reset, even when I still have 12 games left. Quote Link to comment
Administrator Aslain Posted March 17, 2023 Administrator Share Posted March 17, 2023 That's second report about problems with this mod recenly, which I cannot check at all, maybe I will just remove it from the modpack. Quote Link to comment
avogatro Posted April 10, 2023 Author Share Posted April 10, 2023 (edited) Your mod is very helpful, for people doing 279e missions. I hope more people can find it. I am newbie at WOT mod programming, because of the lack of English documentation. I decompiled your code here: https://pastebin.com/hdPJXAGS original snippet: if 'state' in questKeys and quest['battlesSeries']['state'] >= 5: if len(quest['battlesSeries']['battles']) == 0 and len(quest['battlesSeriesAdv']['battles']) > 0: for battle in quest['battlesSeriesAdv']['battles']: if battle: advConditionFailed = False break should be changed to: #... #init value of advConditionFailed should be False advConditionFailed = False #... if 'state' in questKeys and quest['battlesSeries']['state'] >= 5: if len(quest['battlesSeries']['battles']) == 0 and len(quest['battlesSeriesAdv']['battles']) > 0: #only set advConditionFailed to true, before the for loop advConditionFailed = True for battle in quest['battlesSeriesAdv']['battles']: if battle: advConditionFailed = False break The reason: right after I finish the first part of the mission and before I finish the honor/advanced part, both list for battles are not empty. Then without enter the for loop, advConditionFailed keep the init value of True, and cause the reset. Also using a different event listener, save me some manuel reset, while waiting in garage until the battle finishes. from gui.ClientUpdateManager import g_clientUpdateManager _STAT_DIFF_FORMAT = STAT_DIFF_KEY + '.{0:>s}' CREDITS_DIFF_KEY = _STAT_DIFF_FORMAT.format('credits') #check when credit changes def _onCreditsUpdate(self, _): self.canReset = True self._checkQuestState() def _initListeners(self): self.itemsCache.onSyncCompleted += self._onSyncCompleted g_playerEvents.onBattleResultsReceived += self._onBattleResultsReceived #add the credit change event listener g_clientUpdateManager.addCallbacks({CREDITS_DIFF_KEY: self._onCreditsUpdate}) Thank you. 😎 Edited April 10, 2023 by avogatro Quote Link to comment
Administrator Aslain Posted April 10, 2023 Administrator Share Posted April 10, 2023 Thanks 🙂 Well, compiled with your changes, play with it for a bit, and let me know if this is working correctly, I have no way to verify it. So I need a feedback before re-adding it. mod_wb_pm_autoreset.pyc edit: well I checked it by just loading to garage, game client is crashing instantly. 2023-04-10 19:44:28.140: ERROR: [EXCEPTION] (scripts/client/game.py, 183): Traceback (most recent call last): File "scripts/client/game.py", line 150, in init File "scripts/client/gui/shared/personality.py", line 388, in init File "scripts/client/gui/mods/__init__.py", line 19, in init File "scripts/client/gui/mods/__init__.py", line 67, in _findValidMODs File "scripts/common/Lib/importlib/__init__.py", line 37, in import_module File "mod_wb_pm_autoreset.py", line 15, in <module> NameError: name 'STAT_DIFF_KEY' is not defined Here version without your changed listener thing. Too bad you didn't post whole code with applies changes, would be easier 😉 mod_wb_pm_autoreset.pyc Quote Link to comment
avogatro Posted April 10, 2023 Author Share Posted April 10, 2023 full code, no problem, I have 2 version: version 0.1 https://pastebin.com/6qKw35KS version 0.11 more clean up https://pastebin.com/yDvPxjkF STAT_DIFF_KEY = 'stats' # I forgot this... 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.