Hints System (Help Anyone)

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
User avatar
mugenjohncel
Hentai Poofter
Posts: 2117
Joined: Sat Feb 04, 2006 11:13 pm
Organization: Studio Mugenjohncel
Location: Philippines
Contact:

Hints System (Help Anyone)

#1 Post by mugenjohncel » Sat Jan 09, 2010 6:08 am

Let's say you were selling lizards. And while selling them, you will meet different people giving hints as to where the best place to sell lizards. Now I don't know the correct term but let's have this example.

Madonna: You know where I could sell lizards here?
Guy: You could try selling lizards at the factory around lunchtime.

The the line the guy said will be sort of remembered by renpy.

Then there will be this persistent image button always showed in the screen named hints. Where once you pressed the button... you know a hints button, a window will appear...

But I wanted the hints to be showed in the order you first encountered. Say you encountered Hint 001 then Hint 003. Once you pressed the hint button Hint 001 will be showed then Hint 003.

so it's like... put them into a list, and then show the list.

I make a mock-up (see-image)


"POOF" (Puppy Eyes seeking help while currently down on my knees...)

User avatar
Koveras
Regular
Posts: 165
Joined: Sat Dec 13, 2008 1:15 pm
Projects: The King's Dragon (TBA)
Location: Karlsruhe, Germany
Contact:

Re: Hints System (Help Anyone)

#2 Post by Koveras » Sat Jan 09, 2010 8:00 am

I have no idea how the object model in Renpy works but I'd try making a persistent singleton collection of "said line" objects and .add() hints to it as they come... Then output them in some modal GUI element, which I also have very little knowledge of... Admittedly, that's not much help. :?
"Yo, Buddy, you still alive?"

User avatar
F.I.A
Miko-Class Veteran
Posts: 546
Joined: Wed Sep 21, 2005 10:49 pm
Projects: Winter Shard, EVE, Hyperion
Contact:

Re: Hints System (Help Anyone)

#3 Post by F.I.A » Sat Jan 09, 2010 8:33 am

I might have tried to help if I understood what you want.

Do you mean something like this?
- When a line is read, it is put into a list.
- You can access this link by clicking on a button on the right upper corner.
- To access hint03, you need to know about hint01.
「通りすがりのメーカだ。覚えとけ。」

----------
Winter shard
Image
WIP: Hyperion(Trace unknown), ?????(Progressing)

User avatar
mugenjohncel
Hentai Poofter
Posts: 2117
Joined: Sat Feb 04, 2006 11:13 pm
Organization: Studio Mugenjohncel
Location: Philippines
Contact:

Re: Hints System (Help Anyone)

#4 Post by mugenjohncel » Sat Jan 09, 2010 9:12 am

F.I.A wrote: - When a line is read, it is put into a list.
- You can access this link by clicking on a button on the right upper corner.
- To access hint03, you need to know about hint01.
Err... not quite... it's more like...

- When a line is read, it is put into a list.

- Hints will be listed in order by who you encounter first.
Example: First encountered hint03, then hint04, then hint01

list will be displayed in this order
hint03
hint04
hint01

- You can access this link by clicking on a button on the right upper corner.

"POOF" {Disappears}

Counter Arts
Miko-Class Veteran
Posts: 645
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

Re: Hints System (Help Anyone)

#5 Post by Counter Arts » Sat Jan 09, 2010 10:28 am

I'm not sure how to do it in the newer versions of Ren'py. Here's how I would do it in the older versions.

Code: Select all


init python:
    showHint = False
    def toggleHint():
         showHint = not showHint
         return

    def showHints():
         global hintList
         if showHint:
              ui.window(<window stuff here>)
              for i in hintList:
                  ui.text(i)
              ui.close()
        ui.imagebutton(<imageidle>,<imageHover>,clicked=toggleHint, <button formatting here>)
        return
        

    def addHint(list,hint):
        if hint not in list:
           list.append(hint)
        return

    config.overlay_functions.append(date_overlay)


start:
    $ hintList = []

    "Here is hint 2"
    $addHint(hintList,"Here is hint 2")
    "Here is hint 1"
    $addHint(hintList,"Here is hint 1")
Fading Hearts is RELEASED
http://www.sakurariver.ca

User avatar
mugenjohncel
Hentai Poofter
Posts: 2117
Joined: Sat Feb 04, 2006 11:13 pm
Organization: Studio Mugenjohncel
Location: Philippines
Contact:

Re: Hints System (Help Anyone)

#6 Post by mugenjohncel » Sat Jan 09, 2010 1:14 pm

Copied!... Thanks everyone!

"POOF" (I am SOOOOOO not gonna sleep tonight!) :twisted:

Post Reply

Who is online

Users browsing this forum: No registered users