[C++ & Py]-[GM] Oyun İçi (Edit-Normal) Efsun İtem Oluşturma

  • Konuyu açan Konuyu açan Kaiser
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 33
  • Gösterim Gösterim 5K
Python:
Genişlet Daralt Kopyala
def OpenItemCreator(self):
    if chr.IsGameMaster(player.GetMainCharacterIndex()):
        import aiSwitchbot
        creator = aiSwitchbot.Bot()
        creator.Show()
bu sefer hiç açılmıyor


syserr:
Genişlet Daralt Kopyala
0720 13:17:25712 :: Traceback (most recent call last):

0720 13:17:25712 ::   File "game.py", line 1483, in OnKeyDown

0720 13:17:25712 ::   File "game.py", line 481, in <lambda>

0720 13:17:25712 :: AttributeError
0720 13:17:25712 :: :
0720 13:17:25712 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:17:25712 ::

0720 13:17:25712 :: Traceback (most recent call last):

0720 13:17:25712 ::   File "game.py", line 1483, in OnKeyDown

0720 13:17:25712 ::   File "game.py", line 481, in <lambda>

0720 13:17:25712 :: AttributeError
0720 13:17:25712 :: :
0720 13:17:25712 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:17:25712 ::

0720 13:17:27526 :: Traceback (most recent call last):

0720 13:17:27526 ::   File "game.py", line 1483, in OnKeyDown

0720 13:17:27526 ::   File "game.py", line 481, in <lambda>

0720 13:17:27526 :: AttributeError
0720 13:17:27526 :: :
0720 13:17:27526 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:17:27526 ::

0720 13:17:27526 :: Traceback (most recent call last):

0720 13:17:27526 ::   File "game.py", line 1483, in OnKeyDown

0720 13:17:27526 ::   File "game.py", line 481, in <lambda>

0720 13:17:27526 :: AttributeError
0720 13:17:27526 :: :
0720 13:17:27526 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:17:27526 ::

R: [Errno 2] No such file or directory: 'UIScript/LoginWindow.py' [filename UIScript/LoginWindow.py]
0720 13:16:43219 ::
introLogin.py(line:427) __LoadScript
ui.py(line:6978) LoadScriptFile

LoginWindow.__LoadScript.LoadObject - <type 'exceptions.KeyError'>:'window'

0720 13:16:43219 :: ============================================================================================================
0720 13:16:43219 :: Abort!!!!
 
bu sefer hiç açılmıyor


syserr:
Genişlet Daralt Kopyala
0720 13:17:25712 :: Traceback (most recent call last):

0720 13:17:25712 ::   File "game.py", line 1483, in OnKeyDown

0720 13:17:25712 ::   File "game.py", line 481, in <lambda>

0720 13:17:25712 :: AttributeError
0720 13:17:25712 :: :
0720 13:17:25712 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:17:25712 ::

0720 13:17:25712 :: Traceback (most recent call last):

0720 13:17:25712 ::   File "game.py", line 1483, in OnKeyDown

0720 13:17:25712 ::   File "game.py", line 481, in <lambda>

0720 13:17:25712 :: AttributeError
0720 13:17:25712 :: :
0720 13:17:25712 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:17:25712 ::

0720 13:17:27526 :: Traceback (most recent call last):

0720 13:17:27526 ::   File "game.py", line 1483, in OnKeyDown

0720 13:17:27526 ::   File "game.py", line 481, in <lambda>

0720 13:17:27526 :: AttributeError
0720 13:17:27526 :: :
0720 13:17:27526 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:17:27526 ::

0720 13:17:27526 :: Traceback (most recent call last):

0720 13:17:27526 ::   File "game.py", line 1483, in OnKeyDown

0720 13:17:27526 ::   File "game.py", line 481, in <lambda>

0720 13:17:27526 :: AttributeError
0720 13:17:27526 :: :
0720 13:17:27526 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:17:27526 ::

R: [Errno 2] No such file or directory: 'UIScript/LoginWindow.py' [filename UIScript/LoginWindow.py]
0720 13:16:43219 ::
introLogin.py(line:427) __LoadScript
ui.py(line:6978) LoadScriptFile

LoginWindow.__LoadScript.LoadObject - <type 'exceptions.KeyError'>:'window'

0720 13:16:43219 :: ============================================================================================================
0720 13:16:43219 :: Abort!!!!
ya packin tam kapanmadan kopyalayıp yapıştırdın veya değiştirdin veya oyun açıkken packini değiştirdin

packini düzgünce kapatıp oyun kapalıyken packini güncelle
 
Verdiği düzenleme bu aldığın hataya sebep olmaz.
game.py dosyasına OpenItemCreator fonksiyonunu eklememiş veya ekleyip girintiyi yanlış ayarlamış olabilirsin.
game.py:
Genişlet Daralt Kopyala
def OpenItemCreator(self):
    if chr.IsGameMaster(player.GetMainCharacterIndex()):
        import aiSwitchbot
        creator = aiSwitchbot.Bot()
        creator.Show()

bunu ekleyip oyuna girip f5 e bastığımda gm dede normal oyuncudada açılmıyor ve bu syserri veriyor



syserr:
Genişlet Daralt Kopyala
0720 13:59:13965 :: Traceback (most recent call last):

0720 13:59:13965 ::   File "game.py", line 1483, in OnKeyDown

0720 13:59:13965 ::   File "game.py", line 481, in <lambda>

0720 13:59:13965 :: AttributeError
0720 13:59:13965 :: :
0720 13:59:13965 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:59:13965 ::

0720 13:59:13965 :: Traceback (most recent call last):

0720 13:59:13965 ::   File "game.py", line 1483, in OnKeyDown

0720 13:59:13965 ::   File "game.py", line 481, in <lambda>

0720 13:59:13965 :: AttributeError
0720 13:59:13965 :: :
0720 13:59:13965 :: 'GameWindow' object has no attribute 'OpenItemCreator'
0720 13:59:13965 ::
 
denilenleri yaptıktan sonra karakteri seçip yükleme ekranrında takılmaya başlıyor girmiyor oyuna yanlış birşey mi yapıyorum acbaa
 
Ufak bir ekleme

1771233882531.webp



Build ederken hata alıyorsanız (Genelde altyapı fileslerde) bknz: Martysama 5.8


cmd_gm.cpp:
Genişlet Daralt Kopyala
int countChars(std::string s, char c) {
    int count = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == c) count++;
    }
    return count;
}
void split(const std::string& s, char delim, std::vector<std::string>& v) {
    int i = 0;
    int pos = s.find(delim);
    while (pos != std::string::npos)
    {
        v.push_back(s.substr(i, pos-i));
        i = ++pos;
        pos = s.find(delim, pos);
        if (pos == std::string::npos) v.push_back(s.substr(i, s.length()));
    }
}


en üste eklediğiniz kodu değiştirin sorun çözülecektir.


Birde gui eklemek istemiyorsanız build aldıktan sonra sadece kodlada çalışır

örnek kod

/create_item 19 3:30000,4:30000,5:30000,6:30000

(Efsun değerleri filese göre ayarlanabilir)


@Kaiser

sistem için teşekkürler
 
Son düzenleme:
Geri
Üst