Hello everyone!
I am definitely a newb at this stuff, so I can’t even begin to tell you if I have structured my game right here. Basically what’s happening is when I run my game that I packed to a P3D file using ppackage it gives me a NameError for my custom modules built for the game. Everything works fine when running the main.py prior to packing it all into a P3D.
Here’s what the console is spitting back at me…
:util: Reading /mf/config.prc
DirectStart: Starting the game.
:display: loading display module: libpandagl.so
:display: loading display module: libtinydisplay.so
Known pipe types:
glxGraphicsPipe
TinyXGraphicsPipe
TinyOffscreenGraphicsPipe
(all display modules loaded.)
:ShowBase: Default graphics pipe is glxGraphicsPipe (OpenGL).
:pnmtext: Loaded font Perspective Sans Regular
:display: Unable to set window properties: !undecorated
:ShowBase: Successfully opened window of type glxGraphicsWindow (OpenGL)
:audio: NullAudioManager
:audio: NullAudioManager
:ShowBase: __dev__ == 0
:text: Loading font /mf/fonts/pirulen.ttf
:pnmtext: Loaded font Pirulen Regular
Traceback (most recent call last):
File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 352, in __taskChainDispatch
File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 410, in __dispatch
File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/AppRunner.py", line 493, in __startIfReady
File "VFSImporter", line 153, in load_module
File "/host/Users/chompy/Documents/Syncup/Game/ShadowOfADream/panda3d/main.py", line 77, in <module>
shared.ground = Platform()
NameError: name 'Platform' is not defined
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/AppRunner.py", line 411, in run
File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/task/Task.py", line 496, in run
File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/task/Task.py", line 454, in step
File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 352, in __taskChainDispatch
File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 410, in __dispatch
File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/AppRunner.py", line 493, in __startIfReady
File "VFSImporter", line 153, in load_module
File "/host/Users/chompy/Documents/Syncup/Game/ShadowOfADream/panda3d/main.py", line 77, in <module>
shared.ground = Platform()
NameError: name 'Platform' is not defined
:TaskManager: TaskManager.destroy()
:display: Closing glxGraphicsWindow
Successfully joined thread: 0
Failure on startup.
Platform is the name of the first module it tries to load. I didn’t do anything special(I thought) to load it into my main script.
from platform import *
shared.ground = Platform()
That’s how I loaded it essentially. I am loading it into my ‘shared’ module so that all the modules that also import the ‘shared’ module can use it. Perhaps I am doing this totally wrong here. This is something I just started using, and am not really all that familiar with how Python pushes it’s variables around between modules, so to speak.
Let me know if more information is needed!
As for the game I am working on, it’s called “Shadow of A Dream.” I have screenshots and information on it in my blog, linked in my sig. I am going for a metroid like platformer with a Diablo like skill system. So far I am pretty pleased with my progress. I’ve really enjoyed working with the Panda3D engine and plan to use it for future projects as well.
Anyways thanks for any help you guys can offer me and forgive me if this is already addressed somewhere else, I swear I searched the forums throughly first! >_<