PiratesOnlineRewritten / Pirates-Online-Rewritten

Official repository for the Pirates Online Rewritten source code.
BSD 3-Clause "New" or "Revised" License
87 stars 15 forks source link

NameError: name 'simbase' is not defined #43

Open kevinkt1 opened 3 years ago

kevinkt1 commented 3 years ago
Choose your server (Default: Localhost)
#1 - Localhost
#2 - Production Server
#3 - Dev Server
#4 - Custom
Selection: 1
Token (Default: dev):

====================================

Starting Pirates Online Rewritten...
Token: dev
Gameserver: 127.0.0.1
PPython: ppython

====================================

PiratesStart: Starting the game.
WARNING: Python 2.7 will reach EOL after December 31, 2019.
To suppress this warning, upgrade to Python 3.
Creating PiratesDummyLauncher
Warning: pandac.PandaModules is deprecated, import from panda3d.core instead
Traceback (most recent call last):
  File "D:\Panda3D-1.11.0-x64\python\lib\runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "D:\Panda3D-1.11.0-x64\python\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "D:\Focus\SoftwareEngineering\Games\Pirates-Online-Rewritten\pirates\piratesbase\PiratesStart.py", line 27, in <module>
    from pirates.launcher.PiratesDummyLauncher import PiratesDummyLauncher
  File "pirates\launcher\PiratesDummyLauncher.py", line 2, in <module>
    from pirates.launcher.PiratesQuickLauncher import PiratesQuickLauncher
  File "pirates\launcher\PiratesQuickLauncher.py", line 16, in <module>
    from pirates.piratesbase import PLocalizer
  File "pirates\piratesbase\PLocalizer.py", line 8, in <module>
    language = simbase.config.GetString('language', 'english')
NameError: name 'simbase' is not defined

I'm using a Python 2 Panda3D obtained from Toontown Schoolhouse, which is a different project altogether.

Anyways, the issue appears to be that the code doesn't recognize 'simbase', which is defined as such in AIBaseGlobal: __builtins__['simbase'] = AIBase()

From my debugging, it seems like we never make it into AIBaseGlobal in the first place... Am I missing something?

thetestgame commented 3 years ago

It should not be reaching that line of code in a client application. There is an error occurring between line 5-6 here https://github.com/PiratesOnlineRewritten/Pirates-Online-Rewritten/blob/master/pirates/piratesbase/PLocalizer.py#L5 that should not be happening. Can you let me know what that error is to help further?

kevinkt1 commented 3 years ago

name 'getConfigExpress' is not defined

I can trace getConfigExpress() to PandaModules.py in my IDE though. Any particular Panda3D version I ought to be using?

Edit: I gave 1.9.4 a try. No luck :(