cezarica 2 Posted July 17, 2015 (edited) I want to change the default garage with something else and so I've tried with: import gui.ClientHangarSpace ClientHangarSpace._DEFAULT_HANGAR_SPACE_PATH_BASIC = 'spaces/hangar_premium_4july_hd' Compiled and put this garage.pyc in scripts/client/mods/ but I don't see the file being loaded in pythong.log file, and still loads the default one: NOTICE: [NOTE] (scripts/client/game.py, 425): [sPACE] Loading space: spaces/hangar_v2 Why isn't he file loaded like any other mod? What I'm doing wrong? :| Edited July 17, 2015 by cezarica Quote Share this post Link to post Short link Share on other sites
SkepticalFox 1,445 #282685 Posted July 17, 2015 (edited) Why isn't he file loaded like any other mod? What I'm doing wrong? :|rewrite original file with new item of var. Edited July 17, 2015 by ShadowHunterRUS Quote Share this post Link to post Short link Share on other sites
cezarica 2 #282714 Posted July 17, 2015 (edited) The original file is clienthangarspace.py found in scripts/client/gui but I want to change only a line, not entire file. _DEFAULT_HANGAR_SPACE_PATH_BASIC = 'spaces/hangar_v2' Edited July 17, 2015 by cezarica Quote Share this post Link to post Short link Share on other sites
ahwa 26 #282827 Posted July 17, 2015 (edited) from gui.ClientHangarSpace import ClientHangarSpace It decompile py know https://github.com/Omegaice/WOTDecompiled/blob/master/res/scripts/client/gui/clienthangarspace.py Edited July 17, 2015 by ahwa Quote Share this post Link to post Short link Share on other sites
cezarica 2 #283060 Posted July 18, 2015 (edited) Tried with what you suggested: from gui.ClientHangarSpace import ClientHangarSpace ClientHangarSpace._DEFAULT_HANGAR_SPACE_PATH_BASIC = 'spaces/hangar_premium_4july_hd' and I see the mod is loaded: INFO: LoadMod: garage but still nothing changes: NOTICE: [NOTE] (scripts/client/game.py, 425): [SPACE] Loading space: spaces/hangar_v2 I could make the change dirrectly in clienthangarspace.py but want this to work even with future updates. Edited July 18, 2015 by cezarica Quote Share this post Link to post Short link Share on other sites
SkepticalFox 1,445 #283069 Posted July 18, 2015 (edited) Tried with what you suggested: from gui.ClientHangarSpace import ClientHangarSpace ClientHangarSpace._DEFAULT_HANGAR_SPACE_PATH_BASIC = 'spaces/hangar_premium_4july_hd' Вы в классе ClientHangarSpace добавили переменную _DEFAULT_HANGAR_SPACE_PATH_BASIC, хотя она находится в зоне global для этого файла.Try it: import gui.ClientHangarSpace as chs print('=========') chs.g_clientHangarSpaceOverride.setPath('spaces/hangar_premium_4july_hd') print('=========') Edited July 18, 2015 by ShadowHunterRUS Quote Share this post Link to post Short link Share on other sites
cezarica 2 #283307 Posted July 19, 2015 I've tried that and it crashes the game: / Я попытался это, и это разбивает игру: INFO: LoadMod: garageINFO: ========= Quote Share this post Link to post Short link Share on other sites
goofy67 55 #283334 Posted July 19, 2015 (edited) import gui.ClientHangarSpace as chs from gui.ClientHangarSpace import ClientHangarSpace from Account import PlayerAccount chs._DEFAULT_HANGAR_SPACE_PATH_BASIC = "spaces/hangar_premium_15aug" old_onBecomePlayer = PlayerAccount.onBecomePlayer def new_onBecomePlayer(self): old_onBecomePlayer(self) ClientHangarSpace() PlayerAccount.onBecomePlayer = new_onBecomePlayer Does not work with activated Event-Hangar. Edited July 19, 2015 by goofy67 Quote Share this post Link to post Short link Share on other sites
cezarica 2 #283777 Posted July 21, 2015 Anything else we could try? Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #283781 Posted July 21, 2015 Anything else we could try? премиум: hangar_premium_v2, базовый: hangar_v2, день освобождения Кореии: hangar_premium_15aug, день рождения WoT: h01_bday_2015 Quote Share this post Link to post Short link Share on other sites
cezarica 2 #283832 Posted July 21, 2015 What you mean by that? Quote Share this post Link to post Short link Share on other sites
goofy67 55 #284051 Posted July 22, 2015 Anything else we could try? What's wrong with my code? Quote Share this post Link to post Short link Share on other sites
cezarica 2 #284114 Posted July 23, 2015 (edited) Is it working? I was under impression it doesn't. Will give it a try then. Edit: Well, it works, but can't set a different garage other than hangar_premium_15aug, for instance hangar_premium_11nov or hangar_premium_28nov. It just sets the basic one: ERROR: Traceback (most recent call last): ERROR: File "", line 603, in new_onBecomePlayer ERROR: File "garage.py", line 11, in new_onBecomePlayer ERROR: File "scripts/client/gui/ClientHangarSpace.py", line 172, in __init__ ERROR: TypeError: 'NoneType' object has no attribute '__getitem__' NOTICE: [NOTE] (scripts/client/game.py, 425): [SPACE] Loading space: spaces/hangar_v2 INFO: PostProcessing.Phases.fini() Edited July 23, 2015 by cezarica Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #284204 Posted July 23, 2015 Is it working? I was under impression it doesn't. Will give it a try then. Edit: Well, it works, but can't set a different garage other than hangar_premium_15aug, for instance hangar_premium_11nov or hangar_premium_28nov. It just sets the basic one: ERROR: Traceback (most recent call last): ERROR: File "", line 603, in new_onBecomePlayer ERROR: File "garage.py", line 11, in new_onBecomePlayer ERROR: File "scripts/client/gui/ClientHangarSpace.py", line 172, in __init__ ERROR: TypeError: 'NoneType' object has no attribute '__getitem__' NOTICE: [NOTE] (scripts/client/game.py, 425): [SPACE] Loading space: spaces/hangar_v2 INFO: PostProcessing.Phases.fini() if there is no such error of the hangar Quote Share this post Link to post Short link Share on other sites
cezarica 2 #284206 Posted July 23, 2015 Quote starting with line 172 in "scripts/client/gui/ClientHangarSpace.py" if ResMgr.openSection(spacePath) is None: LOG_ERROR('Failed to load hangar from path: %s; default hangar will be loaded instead' % spacePath) so if that if fails it switches to regular spaces/hangar_v2 and don't know why. Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #284208 Posted July 23, 2015 Quote starting with line 172 in "scripts/client/gui/ClientHangarSpace.py" if ResMgr.openSection(spacePath) is None: LOG_ERROR('Failed to load hangar from path: %s; default hangar will be loaded instead' % spacePath) so if that if fails it switches to regular spaces/hangar_v2 and don't know why. import BigWorld from Account import PlayerAccount import gui.ClientHangarSpace as HangarPath from gui.ClientHangarSpace import ClientHangarSpace HANGAR_SPACE = 'spaces/hangar_premium_15aug' HangarPath._DEFAULT_HANGAR_SPACE_PATH_BASIC = HANGAR_SPACE HangarPath._DEFAULT_HANGAR_SPACE_PATH_PREM = HANGAR_SPACE def new_onBecomePlayer(self): old_onBecomePlayer(self) ClientHangarSpace() old_onBecomePlayer = PlayerAccount.onBecomePlayer PlayerAccount.onBecomePlayer = new_onBecomePlayer Quote Share this post Link to post Short link Share on other sites
cezarica 2 #284214 Posted July 23, 2015 The hangar_premium_15aug one is working just fine with goofy67's code, other ones I see in res\packages didn't. Even if got the same game version on two computers one of them has more files with hangars than the other and on this one I'm typing has only: h01_bday_2015, hangar_premium_15aug, hangar_premium_v2, hangar_premium_v2_hd, hangar_v2 and hangar_v2_hd. I haven't deleted any files so don't know what's up with that difference of files. I can safely assume that the code failed cos i lacked that hangar on this computer, but I still got that error even if it had that file. Anyway, will swith to the hangar_premium_15aug one cos is better than crappy stanrdard. :) Quote Share this post Link to post Short link Share on other sites
Ekspoint 2,122 #284215 Posted July 23, 2015 The hangar_premium_15aug one is working just fine with goofy67's code, other ones I see in res\packages didn't. Even if got the same game version on two computers one of them has more files with hangars than the other and on this one I'm typing has only: h01_bday_2015, hangar_premium_15aug, hangar_premium_v2, hangar_premium_v2_hd, hangar_v2 and hangar_v2_hd. I haven't deleted any files so don't know what's up with that difference of files. I can safely assume that the code failed cos i lacked that hangar on this computer, but I still got that error even if it had that file. Anyway, will swith to the hangar_premium_15aug one cos is better than crappy stanrdard. :) Anara found in file paths Quote Share this post Link to post Short link Share on other sites