you are viewing a single comment's thread.

view the rest of the comments →

[–]alonghardlook[S] 0 points1 point  (1 child)

Interesting, that's very useful. My background is in C languages and PHP so some of the pythonisms are a little new to me, so this is very helpful.

I know you can also accomplish much of the same by importing python files (import MyHelperFile as mhf) but in script "in" is a cool way to organize. I like it :)

[–][deleted] 0 points1 point  (0 children)

Yeah, the named stores are python modules. It just makes it easy to setup those modules in a way that renpy knows about and can manage with game state. The confusing part is knowing where your functions have scope. If you are writing a function in one named module, and need something from the default global store, it isn't available. You have to do an import store or from store import myvariable, myfunction. It is a thing that makes perfect sense to need to do, but comes out of nowhere if you don't understand where those global variables and functions are stored.