Show results after selection?

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
Swein
Newbie
Posts: 20
Joined: Mon May 02, 2022 9:39 am
Contact:

Show results after selection?

#1 Post by Swein » Wed Oct 19, 2022 8:50 am

Hello, is there a ready-made design to show the results after the selection? For example, I want to get a result like you" fell and got injured" when the character selects the option to "go to the tavern", but I don't have a sample design that I can edit.



SAMPLE GAME: https://bit.ly/3glQWGD

User avatar
_ticlock_
Veteran
Posts: 391
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Show results after selection?

#2 Post by _ticlock_ » Wed Oct 19, 2022 1:12 pm

Swein wrote:
Wed Oct 19, 2022 8:50 am
Hello, is there a ready-made design to show the results after the selection? For example, I want to get a result like you" fell and got injured" when the character selects the option to "go to the tavern", but I don't have a sample design that I can edit.



SAMPLE GAME: https://bit.ly/3glQWGD
It is not clear what you are looking for. Based on the "sample game", I believe you are trying to make a simple screen (window) with some visuals (and visual effects) that accept a text message that is displayed as a result. Is it what you are looking for?

User avatar
Swein
Newbie
Posts: 20
Joined: Mon May 02, 2022 9:39 am
Contact:

Re: Show results after selection?

#3 Post by Swein » Wed Oct 19, 2022 6:28 pm

_ticlock_ wrote:
Wed Oct 19, 2022 1:12 pm
Swein wrote:
Wed Oct 19, 2022 8:50 am
Hello, is there a ready-made design to show the results after the selection? For example, I want to get a result like you" fell and got injured" when the character selects the option to "go to the tavern", but I don't have a sample design that I can edit.



SAMPLE GAME: https://bit.ly/3glQWGD
It is not clear what you are looking for. Based on the "sample game", I believe you are trying to make a simple screen (window) with some visuals (and visual effects) that accept a text message that is displayed as a result. Is it what you are looking for?
Yes, I'm looking for a code or design that shows what happens after menu selection, I hope something like this has been done before.

User avatar
_ticlock_
Veteran
Posts: 391
Joined: Mon Oct 26, 2020 5:41 pm
Contact:

Re: Show results after selection?

#4 Post by _ticlock_ » Thu Oct 20, 2022 11:47 am

Swein wrote:
Wed Oct 19, 2022 6:28 pm
Yes, I'm looking for a code or design that shows what happens after menu selection, I hope something like this has been done before.
1) What do you expect to happen after menu selection? A fixed result, a random result from a list with weights, or other logic?

Here is a simple example with a screen that shows a message with an on-show and on-hide curtains effect.

Code: Select all

screen show_message(message):
    frame:
        background "#055"
        xsize 800 ysize 200
        xalign 0.5 yalign 0.5
        at curtains_show_hide
        label _(message):
            xalign 0.5 yalign 0.5
    textbutton "":
        xfill True yfill True
        action Return()

transform curtains_show_hide(t=0.5):
    on show:
        crop(0.5,0.0,0.0,1.0)
        easein t crop(0.0,0.0,1.0,1.0)
    on hide:
        crop(0.0,0.0,1.0,1.0)
        easein t crop(0.5,0.0,0.0,1.0)
Note: Use your image for the frame background instead of a solid color for a better appearance:

Code: Select all

screen show_message(message):
    frame:
        background "some_image.png"

If you use menu selection. Here is a simple example with random result from a list:

Code: Select all

label start:
    menu:
        "The car doen't start"
        "Find solution":
            $ solution = renpy.random.choice([
                _("You decided to call roadside assistance"),
                _("You decided to call your boss and tell him you are sick"),
                _("You decided to take a bus")
                ])
            call screen show_message(solution)

Post Reply

Who is online

Users browsing this forum: No registered users