As the title says, I need to handle python and text lists in a screen. Not to have python called when the screen is called, but to have python called during the course of working the screen. Why? Many reasons. Right now, I'm attempting to make a journal system in which each entry is on its own page, but I don't want to write a custom screen for each entry, as that's a pain and far more complicated than it should be. A few days ago, it was to do "style.rebuild()" from within a menu, so when you changed an option, it rebuilt the style, allowing you to change the image of the textbox.
This is a critical, vital thing to be able to do for any level of advanced manipulation of the game, and it seems to be missing. I've checked the wiki and searched the forums, and I can't find any way to do it. What I'd REALLY like is to be able to do inline python with the screen's "action" statement. That is to say...
Code: Select all
textbutton _("Previous") action $ current_journal_page -= 1
Logically, when you press the "Previous" button, it would decrement the counter variable "current_journal_page", allowing this code to draw the previous string in the list:
Code: Select all
label (journal_entries[current_journal_page])
Now, when I try that (assuming everything is properly defined, which it is), it gives me errors:
Code: Select all
File "game/screens.rpy", line 673: expected 'simple_expression' not found.
textbutton _("Previous") action $ current_journal_page -= 1
Has anyone found a work-around to either of these problems? It's all pretty standard stuff to want to do, I'd think, but that may well be because I have a rather advanced background in programming.
Oh, and the reason I'm not putting up all my code is because I don't particularly feel like having someone dissect it and give me something functional. I want answers to my question, not a solution to my problem in the form of an alternate way of doing a journal screen. That will come later if I still can't figure it out.
EDIT: The text list bit was a SNAFU on my part (using parentheses instead of square bracket quotes).
EDIT2:
Go here (it's one of the subsequent posts in this thread) for the code to make the journal work.
"Be not afraid of greatness: some men are born great, some achieve greatness, and some have greatness thrust upon them."
William Shakespeare, "Twelfth Night"