Page 1 of 2

Touting

Posted: Thu Sep 02, 2010 1:34 am
by PyTom
For the next release of Ren'Py, I'd like to include an API for easily popping up a message, showing it for a couple of seconds, and then hiding it again. The idea would be to provide an easy way of giving feedback if the user, say, hits the quicksave button - instead of blocking the game, it will just show that to him or her for a few seconds.

My current idea is to call these little messages "touts". My current idea is that there will be a function that displays them:

Code: Select all

    $ renpy.tout("Right-click to save or change preferences.")
There will also be a Tout action:

Code: Select all

    textbutton "Quick Save" action [ FileSave("1", page="quick", newest=False, confirm=False), Tout("Quick save complete.") ]
My general idea is that both the action and the function will be thin wrappers around showing the "tout" screen, which will be defined as:

Code: Select all

transform tout_transform:
    on show:
        alpha 0.0
        linear .25 alpha 1.0
    on hide:
        linear .5 alpha 0.0

screen tout:
   zorder 500

   text message at tout_transform
   timer 2.25 action Hide('tout')
So, I have two questions for the huddled masses:

(1) Would this to be useful to you? If so, is there any improvements that would make it more useful?

(2) How about the name? Does 'tout' have bad connotations in British English? Android uses the term 'toast' for this sort of notification - is that better? Can you think up an even better name?

Re: Touting

Posted: Thu Sep 02, 2010 1:39 am
by Samu-kun
I think toast is a much better word for it than tout. Tout just sounds like the French word "all," which in this case doesn't make sense, or the English word meaning "well publicized," which also doesn't really make much fit the function that well.

Honestly though, "notification" or even "note" would be a better word than tout or toast, since that's pretty much what it's doing.

Re: Touting

Posted: Thu Sep 02, 2010 1:44 am
by LordShiranai
I think this would be a worthwhile addition.

Re: Touting

Posted: Thu Sep 02, 2010 2:07 am
by LVUER
How about "Pop-out message"?

Re: Touting

Posted: Thu Sep 02, 2010 2:43 am
by Aleema
... This would so awesome. No. Really. Awesome. I've been trying to code something like this in ALL of my games with no success. Well, ATL helped. But it's still jumping through hoops. Please, please, please do this. <3 Tout is a weird word, but it might work in it's favor in that it's unique and won't overlap other code that might have used more practical names.

Re: Touting

Posted: Thu Sep 02, 2010 2:44 am
by backansi
OMG, I've just made QuickSave action to make a message and it became a work in vain. TT
Of course it's useful. Because notifying users what they did is really important(especially in game play) and 'tout' makes this possible.
It'll be good if using 'tout' possible after loading a saved file.

And the name... What about 'pop-up'? I guess 'tout' is unfamiliar word to non-english speaking people(or maybe just to me? Anyway I've seen this word first in my whole life;).

Re: Touting

Posted: Thu Sep 02, 2010 2:45 am
by jack_norton
Can be useful especially if there's a quick save/load key in the game (haven't tried coding it but would like to do it).
Could also be useful in tutorials if you can also decide the position/size of the window :)

Re: Touting

Posted: Thu Sep 02, 2010 3:14 am
by Samu-kun
As an additional question, would it be possible to use tout to show continuous conditions as well? Basically, right now the system is useful for quick save/load by having the text "Quick Save completed" appear at the top corner of the screen. Could the system also be used to display something like "Skip mode active" or "Auto mode active" that remain on the screen as long as those respective modes are turned on by the player instead of disappearing after a few seconds?

Re: Touting

Posted: Thu Sep 02, 2010 3:39 am
by jack_norton
For those things there's overlay though :)

Re: Touting

Posted: Thu Sep 02, 2010 6:22 am
by DaFool
No, what if the hiding function is tied to a mouse click, instead of a timer.

Then you already have the basics for Floating Frame Director.

ADV, NVL, Side-image, all those were made by studying JVNs. FFD is where you can declare a dialogue bubble anywhere on the screen.

The current implementation forces you one dialogue paragraph at a time. With touting you can have assymmetrical dialogues which make FFD totally possible.

Re: Touting

Posted: Thu Sep 02, 2010 7:10 am
by Aleema
DaFool wrote:No, what if the hiding function is tied to a mouse click, instead of a timer.
NOOOO. NO. Do not want. Self-hiding! Self-hiding!!

Re: Touting

Posted: Thu Sep 02, 2010 7:51 am
by DaFool
Hiding can be a slider function like text cps, ya know. And like text cps, a mouseclick automatically advances the system (in this case, click to hide and show next tout bubble).

Re: Touting

Posted: Thu Sep 02, 2010 7:56 am
by Jake
PyTom wrote: (1) Would this to be useful to you? If so, is there any improvements that would make it more useful?
Yes. For an obvious example, action notifications in the battle engine, e.g. "Bandit 3 attacks with knife". Presently I'm using a dialogue box with an automatic forward, but that's mostly 'cause it's not been an important enough problem to spend any time on... if there were an easy way to pop up a fire-and-forget styleable message which will show while the rest of my code carries on doing stuff and disappear on its own after a while, I'd definitely use it.

I would suggest that for this kind of use, it would also be useful to be able to programmatically hide any currently-shown messages, perhaps via an optional Id param?
It would also be useful to be able to pass style parameters into the renpy.tout method in the same way one can to the ui functions, for example to get it to show up in different locations on the screen as appropriate.

(If you've played Jeanne d'Arc, I'm also thinking of the random contextual speech bubbles you get from party members sometimes... ;-)
PyTom wrote: (2) How about the name? Does 'tout' have bad connotations in British English? Android uses the term 'toast' for this sort of notification - is that better? Can you think up an even better name?
In [British] English, a 'tout' (noun) is either a spy or (most commonly) a ticket scalper... while the verb obviously means something along the lines of "to advertise", that's not how the word is more-commonly used, in my experience.

(Even in the sense of advertising, it's generally got negative connotations; when I saw a thread-title of 'Touting' my first thought was to wonder whether it was some concern about people advertising stuff they shouldn't be on the forum...)

'Toast' is cute, but the name doesn't really have an obvious tie to the utility, so I don't personally think it's that great a name either. How about something simple and obvious like 'announce'? Samu-kun's 'note' would probably be good to, although I'd suggest 'announce' is already getting a bit long for a function name, 'notification' would be far too long!
Samu-kun wrote: the English word meaning "well publicized,"
If it means that in particular, it's an American thing... I'm curious, could you give an example sentence?
Aleema wrote: NOOOO. NO. Do not want. Self-hiding! Self-hiding!!
I'd tend to agree that self-hiding is best for a default, but possibly it could be an option specified by parameter?

Although, with the improvements available through ATL and screens, it seems like a non-hiding version wouldn't be impossible to program outside of the Ren'Py API anyway...

Re: Touting

Posted: Thu Sep 02, 2010 11:14 am
by PyTom
There's kind of a balance that needs to be struck between using short words (since this is something that will come up a lot in different actions), and using words that are too common. My problem with using renpy.note and especially Note is that they may be a little too common, as they might imply the sort of notes one could take in, say, a detective game.

I'm also not sure that note implies the transience of the message.

Hm... how about Flash/renpy.flash? I've seen that name used in web frameworks for a similar feature.

My current thinking is that you can have at most one flash/note/tout/whatever on the screen at a time. If a second one is shown, it will replace the text of the first - the idea is that this is for notification of state changes (like quicksaves and screenshots) that might not otherwise be indicated to the user.

Re: Touting

Posted: Thu Sep 02, 2010 11:47 am
by backansi
I think flash reminds people of adobe flash.
How about 'mention'?