Page 1 of 1

Diary Entry Mode [It works!]

Posted: Thu Jan 03, 2008 12:14 am
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.

Re: Feasability Inquiry - Diary Entry Mode

Posted: Thu Jan 03, 2008 5:31 am
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.

Re: Feasability Inquiry - Diary Entry Mode

Posted: Thu Jan 03, 2008 9:26 pm
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...)

Re: Feasability Inquiry - Diary Entry Mode

Posted: Fri Jan 04, 2008 3:13 pm
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.