High-end Feedback

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
Hentai Senshi
Regular
Posts: 105
Joined: Wed Aug 08, 2007 9:37 pm
Contact:

Re: High-end Feedback

#31 Post by Hentai Senshi »

hima wrote:Also, maybe there should be an easy way for pygame to gain access of renpy in game variables. I don't know if renpy have an object that contain all the variables though? If so I can just passed it to the pygame and then return it, right?
There is such an object, it is called renpy.store. On how to pass it to/from pygame, however, I have no idea :?.[/quote]

All the global names in your .rpys are exported as members of renpy.store unless they're defined in a python hide block. F'rinstance, you might have something like:

Code: Select all

script.rpy:
    menu:
    "Select difficulty level"
     "Easy":
          $ difficulty = 'easy'
     "Hard":
          $ difficulty = 'hard'
and then to read it in your Pygame minigame

Code: Select all

minigame.py:
if renpy.store.difficulty=='hard':
    make_level_more_annoying()
Project statii:
Yuri no Yume: Wet Night: Released!
Tentacularity: Released!
LoliFindsKitten: AlphaBetaThingy...

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: High-end Feedback

#32 Post by PyTom »

You can just import renpy.store from python/pygame code. You do have to be a bit careful, though... things like lists and dicts created in python (.py) code won't participate in rollback.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Ocelot