A new packpanda issue!

I complete my game and it’s running fine!

I runned packpanda with the following parameters because I want my egg and py code to be compiled.

packpanda --dir SilenceX1.0 --name "Silence X" --bam --rmext egg --pyc --rmext py 

Here is the error that I get when I run it from the command prompt (When I run it from windows, it will only open a window and close it a after a second).

File ".\main.py", line 16, in <module>
File ".\main2.py", line 5, in <module>
File ".\lib\Intro.py", line 25, in __init__
File ".\lib\Intro.py", line 199, in loadAllModels
AttributeError: 'NoneType' object has no attribute 'reparentTo'

I guess it’s related to the fact that I don’t have “py” files, but I have .pyc instead, so what’s wrong?

And right after this issue will be corrected, I will write a thread about all
this big project and give you a link to the website! Thanks panda 3d community!

Jaff

What happens if you packpanda but you don’t use --bam or --rmext py?

Hi Josh,

It’s working perfectly when I use this:

packpanda --dir SilenceX1.0 --name "Silence X" 

But not with the command I gave you

Jaff

I suspect the problem is in the egg/bam stuff, not the py/pyc stuff. Try it with just the --pyc --rmext -py and see what happens.

Thanks Josh,

I will try that very soon. Another detail that maybe is not clear:

The packpanda WORKS, but the problem is when I currently RUN the game, not during the work of packpanda. I just want to be sure that everyone understand my problem.

I will try what you suggest tonight I think!

Jaff

Hi Josh,

Everything is ok now with what you told me to do. I remove everything related to the egg/bam and only compiled the py file and the game is running fine. Since I don’t really care that people use my egg file, this issue in close for me!

Thanks

Jaff

No, you should care. Eggs are much slower than bams. Your users will not be happy if you force them to use eggs. Let’s fix this.

I have a theory: maybe you explicitly said loadModel(“foo.egg”) in your code, instead of loadModel(“foo”)? If you did that, then it won’t find the bam file.

I got the same error as the thread starter with this last issue you mentioned.

If i load a model without an extension and there is no egg-file in the desired directory but a bam, it says unable to find ‘foo.egg’. After testing a bit with an egg-file that loads very slow (so i can easily ‘see’ if it loads the egg or the bam) it loads the egg file if both an egg and bam file are in the same directory if i dont give an extension. So i changed all these lines in my code to bam-extensions. And made a script who bakes and packs together all the bam files from the eggs (and some other files) to a multifile. I didnt know that this isnt pandas default behavior. Im not sure how the model caching mechanism should work either, but for me it seems that its not working or maybe i do something wrong.

Akta

If you don’t specify an extension, it will add the default extension. Normally, the default extension is “egg.”

However, the packpanda command with the --bam option changes the default extension to “bam.” So if you use no extension in your code, then when you packpanda --bam, it will all work out.

Hi Josh!

As always you were right! I removed all the .egg in my filename and now the game is running after compilation!

Thanks again!

Jaff

Thanks for the info Josh!

Akta