Jump to content
Korean Random
cezarica

Change garage

Recommended Posts

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 by cezarica

Share this post


Link to post

Short link
Share on other sites

Why isn't he file loaded like any other mod? What I'm doing wrong? :|

rewrite original file with new item of var. Edited by ShadowHunterRUS

Share this post


Link to post

Short link
Share on other sites

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 by cezarica

Share this post


Link to post

Short link
Share on other sites

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 by cezarica

Share this post


Link to post

Short link
Share on other sites

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 by ShadowHunterRUS

Share this post


Link to post

Short link
Share on other sites

I've tried that and it crashes the game: / Я попытался это, и это разбивает игру:

 


INFO: LoadMod: garage
INFO: =========

Share this post


Link to post

Short link
Share on other sites
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 by goofy67

Share this post


Link to post

Short link
Share on other sites

Anything else we could try?

премиум: hangar_premium_v2, базовый: hangar_v2, день освобождения Кореии: hangar_premium_15aug, день рождения WoT: h01_bday_2015 

Share this post


Link to post

Short link
Share on other sites

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 by cezarica

Share this post


Link to post

Short link
Share on other sites

 

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

Share this post


Link to post

Short link
Share on other sites

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.

Share this post


Link to post

Short link
Share on other sites

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

Share this post


Link to post

Short link
Share on other sites

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

Share this post


Link to post

Short link
Share on other sites

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

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