deploying game - config problems

Hi, I’m trying to deploy my game. I’m using

packp3d -o myapp.p3d -d c:/myapp

but it doesn’t import my config.prc options inside. Am I doing something wrongly? I’ve tried adding

-e prc

and

-c prc_name=config

but nothing works. Or is there another way of enabling multisampling inside my programme? Thank you!

When packed panda is a bit picky about what config options to read.

But you can do:

loadPrcFileData("", "multisamples 1")

or:

from panda3d.core import ConfigVariableInt
ConfigVariableInt('multisamples', 1)  

or you could ship your game with a config file outside of the game package, then you could do:

from panda3d.core import loadPrcFileData
from direct.showbase.AppRunnerGlobal import appRunner
if appRunner: 
    path=appRunner.p3dFilename.getDirname()+'/config.prc'    
else:  #for testing  
    path='config.prc'
try:    
    f = open(path, 'r')
    for line in f:
        if not line.startswith('#'):        
            loadPrcFileData('',line)
except IOError:
    print "No config file, using default" 
    
from panda3d.core import WindowProperties
from panda3d.core import ConfigVariableInt

cfg_win_size=ConfigVariableInt('win-size', '640 480')  
wp = WindowProperties.getDefault()         
wp.setSize(cfg_win_size.getWord(0),cfg_win_size.getWord(1))
WindowProperties.setDefault(wp)

Thanks for the reply! The first one didn’t work :frowning: I don’t know why, though I would really prefer the first one. Any idea why? Second and third ones worked great. Thanks a lot! :slight_smile:

Are you sure you used the quotation marks correctly?

What’s the error you get?

yup quite sure (im not with my computer now). there’s no error, just that nothing happens.

That code is kind of silly given that there’s also a loadPrcFile function.