Diary Entry Mode [It works!]

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.
Post Reply
Message
Author
Fawkes - Feathered Melody
Regular
Posts: 93
Joined: Wed Sep 13, 2006 11:29 am
Contact:

Diary Entry Mode [It works!]

#1 Post by Fawkes - Feathered Melody »

Hello everyone.

I'd like to inquire about the best way to implement something that I'd like to work into Project 3 which will begin development soon. I'm not very familiar with more high level stuff in Ren'py so I would really appreciate any guidance.

What I would like to do is implement a diary system. The story involves a group of people on a journey from A to B and along the way, flags would trigger that represent characters writing down what they think of the day's events in a diary that the player can read at their pleasure. The mechanic I have in mind would work like this:

Currently, what we have is:
1. Game progression
2. Interrupt with hitting the ESC key brings up the save menu.
3. Return to game.

What I'd like to do is to call up a submenu between the story progression and the save menu The best example I can give is something like what Clannad does if people are familiar with that. The submenu would give the player the option of going to the save menu and the related preferences or the diary screen. Another thing would be to call up a map of where in the land that the people are at the moment.

Image

I haven't figured out the mechanics of the diary screen. It might act as a modification of the CG Gallery code in the Cookbook.

So how would one go about implementing something like this? I'm not even sure where to begin.

The diary entries themselves would be maybe a paragraph of text along with a sketch image.

Thanks in advance.
Last edited by Fawkes - Feathered Melody on Fri Jan 04, 2008 3:14 pm, edited 1 time in total.
Image
Writer / Programmer
Crows Project: Released 12/15/07
Noctua: In Development. Demo 3 released.
Project Silk Road: Planning/Story Construction
"Live while awake. Live while dreaming."
We have a [new] website again!

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: Feasability Inquiry - Diary Entry Mode

#2 Post by PyTom »

It's feasible.

Basically, what you're going to want to do is to set the _game_menu_screen variable to a label that gives your diary screen. From that screen, you can either jump to something like _save_screen, _load_screen, or _prefs_screen, or jump to _noisy_return to go back to the game.

Something like:

Code: Select all

init:
    $ _game_menu_screen = 'diary'

label diary:
    # Code to show the diary pages here:
    $ ui.textbutton("Save", ui.jumps('_save_screen')
    $ ui.textbutton("Return", ui.jumps('_noisy_return')
    $ ui.interact()
should do the trick.
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

Ivlivs
Veteran
Posts: 267
Joined: Sun Feb 25, 2007 1:00 pm
Contact:

Re: Feasability Inquiry - Diary Entry Mode

#3 Post by Ivlivs »

PyTom wrote:It's feasible.

Basically, what you're going to want to do is to set the _game_menu_screen variable to a label that gives your diary screen. From that screen, you can either jump to something like _save_screen, _load_screen, or _prefs_screen, or jump to _noisy_return to go back to the game.

Something like:

Code: Select all

init:
    $ _game_menu_screen = 'diary'

label diary:
    # Code to show the diary pages here:
    $ ui.textbutton("Save", ui.jumps('_save_screen')
    $ ui.textbutton("Return", ui.jumps('_noisy_return')
    $ ui.interact()
should do the trick.
Only one problem: PyTom, you forgot to close the parentheses on the second and third lines of "label diary". Otherwise it should work (I haven't tested it...)
Jitteh Dawn --- A VN by Ivlivs

Fawkes - Feathered Melody
Regular
Posts: 93
Joined: Wed Sep 13, 2006 11:29 am
Contact:

Re: Feasability Inquiry - Diary Entry Mode

#4 Post by Fawkes - Feathered Melody »

I got it to work!

Thanks for the help. It was very useful.

I created a submenu using this lineof code that PyTom gave us up top:

Code: Select all

    $ _game_menu_screen = 'submenu1'
Which calls:

Code: Select all

label submenu1:
    scene bg diary3 with dissolve
    $ ui.vbox(spacing=15, xalign=0.5, yalign=0.5)
    $ ui.textbutton("Save", ui.jumps('_save_screen'))
    $ ui.textbutton("Load", ui.jumps('_load_screen'))
    $ ui.textbutton("Preferences", ui.jumps('_prefs_screen'))
    $ ui.textbutton("Diary Mode", ui.jumps('diarylevel1'))
    $ ui.textbutton("Map",ui.jumps('mapmode'))
    $ ui.textbutton("Return", ui.jumps('_noisy_return'))
    $ ui.close()
    $ ui.interact()
Submenu looks like this:
Image

Clicking on Diary Mode calls the diary mode stuff:

Code: Select all

label diarylevel1:
    scene bg diary1 with dissolve

    $ ui.vbox(spacing=3, xalign=0.5, yalign=0.4)
    $ ui.textbutton("February 2nd - New York", ui.jumps("location1"))
    $ ui.textbutton("May 5th - Lake Chaubunagungamaug", ui.jumps("location2"))
    $ ui.textbutton("Exit", ui.jumps('_noisy_return'))
    $ ui.close() 
    $ ui.interact() 
Which looks like this:
Image

Clicking on one of those brings you to the entries for each date/location.

Code: Select all

label location1:
    scene bg diary2 with dissolve
    
    $ ui.vbox(spacing=3, xalign=0.5, yalign=0.4)
    #Individual links over to entries
    $ ui.textbutton("Reimu: My day today.", ui.jumps("entry1A"))
    $ ui.textbutton("Marisa: Pictures of me touring the city", ui.jumps("entry1B"))
    $ ui.textbutton("Alice: Random emo poetry. Plus quizzes.", ui.jumps("entry1C"))
    $ ui.textbutton("Back", ui.jumps("diarylevel1"))
    $ ui.close() 
    $ ui.interact() 
It looks like this (No, I'm not writing a Touhou Visual novel.):
ImageImage

These link over to another set of labels that is composed of standard text displayed in NVL mode.
Image

Now a few things...
1. If you press ESC inside the submenu, it sends you back to the submenu. When you hit the return button, it doesn't send you to the game itself, but back to the submenu that you just "left."
2. Working on a way to unlock entries as the game progresses now.
Image
Writer / Programmer
Crows Project: Released 12/15/07
Noctua: In Development. Demo 3 released.
Project Silk Road: Planning/Story Construction
"Live while awake. Live while dreaming."
We have a [new] website again!

Post Reply

Who is online

Users browsing this forum: Google [Bot]