(SOLVED!) Wondering how to make a simple discussion mechanic.

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
PrxnceKxsses
Newbie
Posts: 13
Joined: Mon Nov 19, 2018 5:04 pm
Completed: None yet!
Projects: Painkiller
Contact:

(SOLVED!) Wondering how to make a simple discussion mechanic.

#1 Post by PrxnceKxsses »

Hi all, I'm kinda learning as I go with Renpy and in my game, I would really like to have a discussion mechanic sort of like the one in Your Turn To Die.https://www.youtube.com/watch?v=2b7QN3B26Tg&t=1030s

I would want to be able to click on a characters face and choose them to say something like in the example I included.
I figure I can pull something like this off with an imagemap or imagebutton. I can probably figure out how to implement this on my own, but this is a feature I'd like to use a lot throughout the game for different discussions the characters have. The only way I can think to make this work is to make a new screen every time I want the character you click on to say something different if that makes sense at all. (Like, when the player has clicked on all the right people and has spoken to them, there is a jump to the next part of the discussion and clicking on the same characters face will have them say something new.)
I'm wondering if there's a simpler way of doing this. I'm learning as I go with renpy and would love a push in the right direction.
Thank you!
Last edited by PrxnceKxsses on Wed Dec 20, 2023 1:12 am, edited 1 time in total.
New to coding, learning as I go :D

User avatar
m_from_space
Miko-Class Veteran
Posts: 975
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Wondering how to make a simple discussion mechanic.

#2 Post by m_from_space »

As far as the video is concerned it doesn't look like much more than jumping to a specific label after clicking on one of those avatars. And then you include dialogue into the label. So what's the big deal exactly?

User avatar
PrxnceKxsses
Newbie
Posts: 13
Joined: Mon Nov 19, 2018 5:04 pm
Completed: None yet!
Projects: Painkiller
Contact:

Re: Wondering how to make a simple discussion mechanic.

#3 Post by PrxnceKxsses »

m_from_space wrote: Tue Oct 17, 2023 2:54 am As far as the video is concerned it doesn't look like much more than jumping to a specific label after clicking on one of those avatars. And then you include dialogue into the label. So what's the big deal exactly?
I mention in my post that I am asking if I'll have to make a new screen every time I want the avatar to jump to a different label, or if there's a simpler way of doing so that I don't know about.
New to coding, learning as I go :D

User avatar
henne
Newbie
Posts: 18
Joined: Tue May 25, 2021 6:10 am
Contact:

Re: Wondering how to make a simple discussion mechanic.

#4 Post by henne »

Depending on how you try to make it, I think, renpy.jump(yourlabel) would be useful.

Code: Select all

default yourlabel = "topic"
In your screen somewhere:

Code: Select all

renpy.jump(yourlabel)

Code: Select all

label topic:
         "bla bla bla"

User avatar
PrxnceKxsses
Newbie
Posts: 13
Joined: Mon Nov 19, 2018 5:04 pm
Completed: None yet!
Projects: Painkiller
Contact:

Re: Wondering how to make a simple discussion mechanic.

#5 Post by PrxnceKxsses »

henne wrote: Wed Oct 18, 2023 3:45 am Depending on how you try to make it, I think, renpy.jump(yourlabel) would be useful.

Code: Select all

default yourlabel = "topic"
In your screen somewhere:

Code: Select all

renpy.jump(yourlabel)

Code: Select all

label topic:
         "bla bla bla"

I plan on making a very simple imagemap with a couple of clickable icons for different characters. My game is inspired by the Danganronpa killing game format, so there's going to be characters that die and when a character dies, everyone else has a discussion to figure out the killer.

Sorry if this is a stupid question, but would the way you're suggesting make it so that I don't have to make a new screen every time I have the discussion progress?
Such as

Code: Select all

label topic1:
   e "This is the first discussion"
label topic2:
   e "This is the second discussion"
I would like to have both of these from clicking on the same icon, just at a different point in the script
New to coding, learning as I go :D

User avatar
PrxnceKxsses
Newbie
Posts: 13
Joined: Mon Nov 19, 2018 5:04 pm
Completed: None yet!
Projects: Painkiller
Contact:

Re: Wondering how to make a simple discussion mechanic.

#6 Post by PrxnceKxsses »

henne wrote: Wed Oct 18, 2023 3:45 am Depending on how you try to make it, I think, renpy.jump(yourlabel) would be useful.

Code: Select all

default yourlabel = "topic"
In your screen somewhere:

Code: Select all

renpy.jump(yourlabel)

Code: Select all

label topic:
         "bla bla bla"
Lol, as an update, I thought about this for a long while and it FINALLY clicked with me what it meant! This was so extremely helpful once I realized what you were trying to say, and now I have it completely working. For anyone in the future who needs help with a feature like this, this is what I've done:

Code: Select all

## Before game starts
default kottopic = "meetkotone"
## This part is for if I even want this character to say anything during the discussion... If I want the icon greyed out I just set kottalk to False, if I want him to be able to say something I set it to True, you get it
default kottalk = True

## The screen itself
screen discussion:
    imagebutton:
        xpos 259
        ypos 112
        if kottalk == False:
            idle "kot_grey"
            hover "kot_grey"
        else:
            idle "kot_idle"
            hover "kot_hover"
        if kottalk == False:
            action NullAction()
        else:
            action Jump(kottopic)
            
 ## During the game
   
 label meetkotone:
   hide screen discussion
   k "Like I said, I'm Kotone Suda. He/him, they is also cool if I like ya."
And if I want to change which label it jumps to, I just do

Code: Select all

$ kottopic = "newtopic"
or whatever I name the new label.
And for those curious here's what the screen looks like. The imagebutton in this example is the icon on the top far left!

Image

I hope this is helpful for anyone in the future looking to make a Danganronpa/YTTD style game!
New to coding, learning as I go :D

User avatar
henne
Newbie
Posts: 18
Joined: Tue May 25, 2021 6:10 am
Contact:

Re: Wondering how to make a simple discussion mechanic.

#7 Post by henne »

PrxnceKxsses wrote: Wed Dec 20, 2023 1:11 am Lol, as an update, I thought about this for a long while and it FINALLY clicked with me what it meant! This was so extremely helpful once I realized what you were trying to say, and now I have it completely working. For anyone in the future who needs help with a feature like this, this is what I've done:
Glad it helped, sorry if it was too confusing at first.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Milkymalk