Code: Select all
"X" [part1] [part2] [part3],
Code: Select all
"X [part1] [part2] [part3]",
Code: Select all
"X" [part1] [part2] [part3],
Code: Select all
"X [part1] [part2] [part3]",
Code: Select all
#############################################################################
## Variables and Functions
##
## This block of code contains all of the variables and functions required to
## get the screens to work.
init -2 python:
date_ref = ""
time_ref = ""
loc_ref = ""
current_journal_page = 3 # The curent page of the journal
unlocked_journal_pages = 5 # of pages unlocked
#### The contents of the journal pages
## This is a list of the contents of the journal pages. The first
## item in the list, in this case "X", is in position 0, so your
## current journal page, which is set to zero, points to this location.
## For the sake of easy programming, define all of your journal pages
## before-hand. Otherwise, you have to deal with inserting them and
## nonesense like that, which is sort of painful until you get the
## hang of doing it.
journal_entries = list([
"X",
"Test - In 1891, London detective Sherlock Holmes (Robert Downey, Jr.) and his partner and flatmate Dr. John Watson (Jude Law) race to prevent the ritual murder of a woman by Lord Blackwood (Mark Strong), who has killed five other young women similarly. They stop the murder before Inspector Lestrade (Eddie Marsan) and the police arrive to arrest Blackwood. Three months later, Holmes' eccentric behavior again annoys Watson. (Long snippet from Wiki summary)",
"Y",
"Z", # What is the code to add bird image to this list?
"A",
"B",
"C",
])
#### The increment function
## This is what you put after your "action" keyword
class incrementJournal():
## This defines what happens when the class is called
## (as in, when you click the button)
def __call__(self):
## Gotta use the "global" keyword to use any variable
## outside your function, as it's a quirk of Python
global current_journal_page
## Increment the counter variable which keeps track of
## which journal page is currently active
current_journal_page += 1
## Restart the interaction to refresh your screen
renpy.restart_interaction()
#### The decrement function
## Exactly the same as above, only you decrement the
## counter variable, instead of incrementing it.
class decrementJournal():
def __call__(self):
global current_journal_page
current_journal_page -= 1
renpy.restart_interaction()
#### The void function
## A void function that I like to use to block out buttons
def void():
## Do something that won't affect the rest of the game
DummyVariable = 0
##############################################################################
# Journal
#
# Displays the log of notes.
screen journal_screen:
tag menu
imagemap:
ground "j_idle.png"
idle "j_idle.png"
hover "j_hover.png"
if current_journal_page < (unlocked_journal_pages - 1):
hotspot (588, 23, 94, 50) action incrementJournal()
else:
hotspot (588, 23, 94, 50) action void()
if current_journal_page >= 1:
hotspot (463, 23, 94, 50) action decrementJournal()
else:
hotspot (463, 23, 94, 50) action void()
side "c b r":
area (100, 100, 300, 300)
viewport id "vp":
draggable True
text (journal_entries[current_journal_page])
bar value XScrollValue("vp")
vbar value YScrollValue("vp")
init -2 python:
style.pref_frame.xfill = True
style.pref_frame.xmargin = 5
style.pref_frame.top_margin = 5
style.pref_vbox.xfill = True
style.pref_button.size_group = "pref"
style.pref_button.xalign = 1.0
style.pref_slider.xmaximum = 192
style.pref_slider.xalign = 1.0
style.soundtest_button.xalign = 1.0
Code: Select all
side "c b r":
area (100, 100, 300, 300)
viewport id "vp":
draggable True
text (journal_entries[current_journal_page])
bar value XScrollValue("vp")
vbar value YScrollValue("vp")
I haven't tested this but I would try an image tag:Also whenever I try to do the "add" image statement in the list it doesn't work. I'm guessing it's some other format?
Code: Select all
"{image=imagename.png}"
Code: Select all
$ current_journal_page = 3
$ unlocked_journal_pages = 4
show screen notes_screen
You should! I wasn't able to find an example from that game, but it sounds like the gist of what you want is probably:Also, if I want the journal entries to remain present when unlocked on the side of the screen in a vertical column over a text box, can I do that? Sort of like the checklist in the nancy drew pc games...
Code: Select all
screen vertical_notes:
vbox:
for page in range(0, unlocked_journal_pages):
hbox:
text journal_entries[page]
Users browsing this forum: Ahrefs [Bot], Google [Bot]