clickable hyperlink footnotes within the text

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.
Message
Author
Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

clickable hyperlink footnotes within the text

#1 Post by Watercolorheart » Fri May 19, 2006 5:00 pm

Within the dialogue window, I would like to create a little widget or small text like (1) at the end of a sentence that the player can click for a footnote but I don't know how to go about it.

I looked within the sample script for something that wasn't like an actual menu choice, but still able to make a small clickable piece of text with other descriptions around it. Then once you clicked the (1) it would bring you to footnote 1, display the text, and then go back to the original prose when you clicked again.

Is that feasible?

User avatar
monele
Lemma-Class Veteran
Posts: 4101
Joined: Sat Oct 08, 2005 7:57 am
Location: France
Contact:

#2 Post by monele » Fri May 19, 2006 5:06 pm

Could also display the additional note by pressing a key. Just adding this because it sounds like an interesting feature ^.^

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#3 Post by PyTom » Fri May 19, 2006 5:19 pm

Hm... The quick answer is, "not easily." It can probably be done by instantiating a button displayable and adding it as part of the string being shown, but that is well into the realm of hard.

Why do you want to do this? It seems to me that footnotes would tend to take one out of the game.

There is an extra (one I haven't touched in a while) that does commentary, perhaps that can be adapted to do what you want. A preference could turn cultural notes (or whatever) on or off at the user's whim.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
Haeleth
Newbie
Posts: 23
Joined: Wed Feb 22, 2006 10:43 am
Location: England
Contact:

#4 Post by Haeleth » Mon May 22, 2006 6:46 pm

There are various reasons why it might be desirable. For example, the forthcoming commercial Japanese game Scarlett (from which my current avatar comes) features an in-game encyclopedia system that explains technical stuff in the text (details of various types of gun, commentary on the American military presence in Okinawa, etc). The way that works is that the text window has an "encyclopedia" button built into it: whenever a new word is added to the encylopedia system, the button flashes, and a little icon in the text indicates the word that can now be looked up. Clicking the button opens a separate interface window. It is a bit intrusive, but not horribly so.

I think KID have implemented similar systems in some of their Infinity series.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#5 Post by PyTom » Mon May 22, 2006 9:37 pm

Having a separate encyclopedia button (and highlighting the new word) is doable. The problem here is that Ren'Py buttons are currently rectangular areas of the screen, rather than fragments of text that can be laid out using the normal text layout algorithms. (Think the difference between an HTML button and a html link.)

Actually, if I broke a single button up into a number of small buttons, one per word, that might work. Hm... need to think about it.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#6 Post by mikey » Tue May 23, 2006 5:33 pm

PyTom wrote:It seems to me that footnotes would tend to take one out of the game.
I think so, too.

On the other hand, I found it very nice that one of the Alltogether games had this very nicely implemented - it was the one thing I wanted to have explained, and what do you know - there was a hyperlinkish thing and it explained the thing.

Anyway, it doesn't change my thoughts on this, and that is that making a game that will (to a greater extent) rely on footnotes to bring out the best in itself, isn't a good approach. I'd consider supplementary material such as diaries or an optional boring tech-historical intro before making a decision to make the game work with footnotes. But maybe it also depends on the player audience - players used to RPGs will not be all too distracted by footnotes or clickable items, while people like me who like to have their experience as simple as possible will find that a bit obtrusive.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#7 Post by PyTom » Tue May 23, 2006 5:51 pm

Right now, the big problem is how to implement hypertext in Ren'Py. The current focus algorithm assumes that each button corresponds to a single rectangular region on the screen. Among other things, keyboard/joystick navigation makes use of this assumption, so eliminating it may not be trivial.

I may just require that hypertext not span a line-wrap, so that hypertext is laid out as a single unit. That would prevent the focus issue from happening. For the use case at hand, definitions of obscure terms, this should suffice, but it would prevent longer hyperlinks.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

#8 Post by Watercolorheart » Tue May 23, 2006 10:57 pm

Well, a simple button on the screen would work too. Really, I guess my original idea wasn't the greatest- but what would be the best system for amusing commentary/footnotes/whatever?

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#9 Post by mikey » Wed May 24, 2006 3:31 am

BCS wrote:... what would be the best system for amusing commentary/footnotes/whatever?
A heavenly voice (all complete with a ray of light) that always interrupts the main characters, in the most inconvenient of situations, for instance :D
(and maybe you can have the option of shutting her up, somehow ^_^)

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

#10 Post by Watercolorheart » Wed May 24, 2006 9:06 am

mikey wrote:
BCS wrote:... what would be the best system for amusing commentary/footnotes/whatever?
A heavenly voice (all complete with a ray of light) that always interrupts the main characters, in the most inconvenient of situations, for instance :D
(and maybe you can have the option of shutting her up, somehow ^_^)
LOL!!

Yeah, but I like the "push a button" option too ... maybe a "push a button for additional comments" would work instead :), after announcing it onscreen (Push "C" for additional information.)

I have no clue about how to program a status screen, with a hint and inventory and progress option. Maybe I can draft Pytom for help D: ...

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#11 Post by PyTom » Wed May 24, 2006 10:04 am

mikey >> I'm almost certain that's a reference to one of the commercial games, but I'm not sure I remember which one. What's more, I'm not sure that if I did remember which one, I would admit to playing it.

BCS >> When you get a working game, I can help you with a status screen.

Although you should really consider if a status screen is actually necessary... While it might be for a stats-based DS, it generally isn't for a visual novel.

I don't know, for example, what good an inventory screen is when the player can't use or acquire items at arbitrary times. Either you have the item when it's needed or you don't, and no time spent looking at an inventory screen will change that.

Remember, Ren'Py is a visual novel engine. It's not an RPG engine, a text adventure engine, or a graphical adventure game engine (like Scummvm). Those are all great genres of games, which is why they deserve and have tools that are more suitable to them then Ren'Py is.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
mikey
Lemma-Class Veteran
Posts: 3249
Joined: Sat Jan 10, 2004 6:03 am
itch: atpprojects
Contact:

#12 Post by mikey » Wed May 24, 2006 10:21 am

PyTom wrote:mikey >> I'm almost certain that's a reference to one of the commercial games, but I'm not sure I remember which one. What's more, I'm not sure that if I did remember which one, I would admit to playing it.
Well, I never play such games, so... I just got it from a friend who played it and he told me... he plays all the hentai games, not me... and he also plays those sim dates in Flash... and he told me they are full of swearwords and hentai... I'd never touch that... you know...
BCS wrote:Yeah, but I like the "push a button" option too ... maybe a "push a button for additional comments" would work instead , after announcing it onscreen (Push "C" for additional information.)
Depending on your setting, why not make the comments an optional menu? If in fantasy, your hero could choose to summon some "Charm of Ultimate Knowledge" YES/NO - and depending on that, he'd get some answers, of course whether he'd choose to use it would have no effect on the outcome of the game - like an optional path that gets you back to where you were without changing anything.

If you're in the sci-fi setting, you could "switch on" your female holographic projection... (well, I was going to write "turn on", but...) - and in a more contemporary setting, dialing a toll-free number for information could also be an option. I think if you'd wrap this up into the gameplay, you wouldn't need to worry about footnotes and have relevant information right there in the game - spice it up with funny bits and I'm sure almost everyone will opt for the explanations/information once given the choice.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#13 Post by PyTom » Sun May 28, 2006 10:38 am

Documentation on the new hyperlink feature of Ren'Py can be found at:

http://www.bishoujo.us/trac/wiki/NewFeatures

This will be in 5.5.1, which I plan to release this week. (And which will be the only release for almost a month, as I will be away from my desktop computers for that long.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
chronoluminaire
Eileen-Class Veteran
Posts: 1153
Joined: Mon Jul 07, 2003 4:57 pm
Completed: Elven Relations, Cloud Fairy, When I Rule The World
Tumblr: alextfish
Skype: alextfish
Location: Cambridge, UK
Contact:

#14 Post by chronoluminaire » Sun Jul 23, 2006 7:27 pm

Hmm. Is it possible to use these hyperlinks to open an actual website in the user's system browser? I looked around the doc for config.hyperlink_callback , but couldn't see any way to do it. I'm guessing there'd have to be some Python system call that would open the browser pointing at the desired URL?

In this case, I'd be using it in the omake of WhenIRuleTheWorld to point to a discussion page.

User avatar
PyTom
Ren'Py Creator
Posts: 15893
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:

#15 Post by PyTom » Sun Jul 23, 2006 8:23 pm

chronoluminaire wrote:Hmm. Is it possible to use these hyperlinks to open an actual website in the user's system browser? I looked around the doc for config.hyperlink_callback , but couldn't see any way to do it. I'm guessing there'd have to be some Python system call that would open the browser pointing at the desired URL?

In this case, I'd be using it in the omake of WhenIRuleTheWorld to point to a discussion page.
For windows, you can use os.start to start the url, which should open a web browser. AFAIK, there isn't an overly portable version that works for Linux and Mac.

Welcome back, BTW...
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot]