Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.


Visit our new games list, blog aggregator, IRC, and wiki.
Activation problem? Email [email protected]
It is currently Fri May 24, 2013 1:00 am

All times are UTC - 5 hours [ DST ]


Forum rules


Ren'Py support questions should go here. This forum is for discussing changes to Ren'Py itself.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sat Mar 17, 2012 10:18 pm 
Miko-Class Veteran
User avatar

Joined: Thu Oct 26, 2006 4:23 pm
Posts: 605
Location: Slovakia, Kosice
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
When using python code in renpy game, all modules in a package which is then places in the game directory must use package.module expression when importing, even if its local import. This is not how should importing work at all...

Moreover, only .py files will get loaded from game directory, not pyo nor pyc. So fix is to move them to renpy/ directory, but there, the importing is correct and package.module imports do not work anymore.

I think the need for package.module whenever the py files are used in game directory is a bug. And not working with pyc/pyo is bug as well.

_________________
Image
http://www.bishojo.tk is technically ONLINE!
Songs of Araiah promo: http://www.youtube.com/watch?v=CalchucuoDU


Top
 Profile Send private message  
 
PostPosted: Sun Mar 18, 2012 8:55 pm 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 10778
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
Enerccio wrote:
When using python code in renpy game, all modules in a package which is then places in the game directory must use package.module expression when importing, even if its local import. This is not how should importing work at all...


Do you have an example of how I can repeat this?

Quote:
Moreover, only .py files will get loaded from game directory, not pyo nor pyc. So fix is to move them to renpy/ directory, but there, the importing is correct and package.module imports do not work anymore.


You really shouldn't distribute game code as a pyo or pyc file. If your game is run under a newer version of Ren'Py (for example, a version that uses Python 2.7), it will stop working if it can't recompile the pyo or pyc files.

_________________
Another Old-Fashioned Bishoujo Gamer
Supporting creators since 2004; Code > Drama
(When was the last time you backed up your game?)
"It is not the critic who counts; not the man who points out how the strong man stumbles, or where the doer of deeds could have done them better. The credit belongs to the man who is actually in the arena, whose face in marred by dust and sweat and blood; who strives valiantly; who errs, who comes short again and again, because there is no effort without error and shortcoming" - Theodore Roosevelt


Top
 Profile Send private message  
 
PostPosted: Wed Mar 21, 2012 1:40 pm 
Miko-Class Veteran
User avatar

Joined: Thu Oct 26, 2006 4:23 pm
Posts: 605
Location: Slovakia, Kosice
Projects: My Teacher; Songs of Araiah; Something new; Possible Cross Bomber?
Hmm, found another bug, at least for me, if I want to load empty .py file, I get error on this line:
Code:
        source = load(filename).read().decode("utf8")
        if source[0] == u'\ufeff':
(loader.py 474)
Obviously, since empty file has no text, and having empty __init__.py is very common



PyTom wrote:
Enerccio wrote:
Quote:
Moreover, only .py files will get loaded from game directory, not pyo nor pyc. So fix is to move them to renpy/ directory, but there, the importing is correct and package.module imports do not work anymore.


You really shouldn't distribute game code as a pyo or pyc file. If your game is run under a newer version of Ren'Py (for example, a version that uses Python 2.7), it will stop working if it can't recompile the pyo or pyc files.


Why is that an issue? Obviously we are not gonna store pyc files, we are only going to use them for the release. And people should not update renpy on their games as far as I know.


Attachments:
File comment: This wont work
f.rar [41.64 KiB]
Downloaded 13 times

_________________
Image
http://www.bishojo.tk is technically ONLINE!
Songs of Araiah promo: http://www.youtube.com/watch?v=CalchucuoDU
Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group