Lots of coding and VN related questions

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
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

Lots of coding and VN related questions

#1 Post by PoisionLullaby »

I have a few questions so instead of spamming the forum I thought I'd just put them in a list and see if people will respond.

1) So I was curious is it possible to make a character say a players inputted name differently? like let's say the player choose the name "sally" could you make a character say "saaaally. Just come to the party!"? If so, how?

2) How would I go about coding my player character sprites to be at the bottom left of my screen? The wiki said simply type "at left" but when I do so my sprite is still hovering above the bottom of the screen a good ways. Does my sprite have to be a certain size? I've tried to figure it out on my own but I feel like I'll get more results asking experienced people.

3) Is it possible to move the positions of the save,q.save,q.load,ect. buttons? like lets say I wanted to move them to the top right side of the textbox, how would I go about doing that? I've seen it done in other games made by Ren'py so I think it is but I don't know the first thing about programming that.

4) Is there a way to change the names of the save, q.save, buttons and can you add more? Specifically the "pref" button, I'd like to change it to "options" if possible. If so, how?

5) Kind of related, how would one go about making a interactive menu screen? Like let's say I added a menu button then on that screen I wanted to have an option to click into the different romance possibility "profiles" and see what their preferences were. How could I program that?

6) Is it possible to give the player too many decisions? How do I know when is a good time to add a choice, be it one that changes minor dialogue or seriously effects the story?

7) Speaking of decisions, for a story heavy, romance VN how many routes is enough? I have thought of five different characters so far for the game I'm working on, but I have played games that have had both less and more options. I'm curious about some opinions and advice you all might have on the subject.

If I should post this else where or post them individually please let me know. I just thought It would be better to compile all my questions into one topic instead of spamming the forum. Thank you in advance for any and all help, it means a lot to this newbie. :)
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

User avatar
Empish
Veteran
Posts: 221
Joined: Thu Jan 14, 2016 9:52 pm
Projects: Efemural Hearts, It Ends With Graduation
itch: empish
Contact:

Re: Lots of coding and VN related questions

#2 Post by Empish »

1) If you want to do it in a smart way, it'd be very complicated. You'd basically have to find where the middle or first vowel is and extend that.

2) Does your sprite have any empty space on the bottom? It aligns based on the bottom of the image

3) Yes, you can do that. You'd have to modify the quick_menu screen in screens.rpy. I'd recommend experimenting with screen language first though.

4) Same as 3

5) I have a tutorial here that can get you started with screen language.

As for 6 and 7, I'd pose them in the creator discussion, since they're not related to how Ren'py works.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Lots of coding and VN related questions

#3 Post by Remix »

1) A snippet that repeats vowels thrice and quintuples any double letters...

b = "".join( [ s[k]+s[k+1].lower()*2 if len(s) > k+1 and s[k+1] == s[k] else s[k]+s[k].lower()*2 if s[k].lower() in 'aeiou' else s[k] for k in range( len( s ) ) ] )

s = "Annie" >> Aaannnniiieee
s = "Harry" >> Haaarrrry
s = "Eileen" >> Eeeiiileeeeeen
s = "PoisionLullaby" >> PoooiiisiiiooonLuuullllaaaby
s = "Bob" >> umm, let's skip this example, cough
Frameworks & Scriptlets:

User avatar
Amie
Regular
Posts: 28
Joined: Tue Jun 06, 2017 4:48 am
Contact:

Re: Lots of coding and VN related questions

#4 Post by Amie »

Remix wrote: Wed Jan 17, 2018 12:56 pm 1) A snippet that repeats vowels thrice and quintuples any double letters...

b = "".join( [ s[k]+s[k+1].lower()*2 if len(s) > k+1 and s[k+1] == s[k] else s[k]+s[k].lower()*2 if s[k].lower() in 'aeiou' else s[k] for k in range( len( s ) ) ] )

s = "Annie" >> Aaannnniiieee
s = "Harry" >> Haaarrrry
s = "Eileen" >> Eeeiiileeeeeen
s = "PoisionLullaby" >> PoooiiisiiiooonLuuullllaaaby
s = "Bob" >> umm, let's skip this example, cough
This is amazing, Is it really possible to do this in RenPy? Are there any examples of how to implement this in a game?

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2400
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Lots of coding and VN related questions

#5 Post by Ocelot »

RenPy is built on Python: a full-fledged programming language. If you are interested in trasforming of some data, it can be done easily.

And also: Remix, it is nice to see some people can still write Perl even in Python ;)
< < insert Rick Cook quote here > >

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Lots of coding and VN related questions

#6 Post by Remix »

You can use python in Ren'py quite easily:

Code: Select all

init python:
    # in an init block (create functions etc here)
    def vooweeliify( s ):
        return "".join( [ s[k]+s[k+1].lower()*2 if len(s) > k+1 and s[k+1] == s[k] else s[k]+s[k].lower()*2 if s[k].lower() in 'aeiou' else s[k] for k in range( len( s ) ) ] )

label start:

    $ s = "Samantha" # note the $ for single line python

    python:
        # in a block (usually for multi line python)
        s = vooweeliify( s )
        s = s.capitalize()

    "[s], hurry up!"
Frameworks & Scriptlets:

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Lots of coding and VN related questions

#7 Post by Remix »

Ocelot wrote: Wed Jan 17, 2018 4:00 pmAnd also: Remix, it is nice to see some people can still write Perl even in Python ;)
I did consider throwing some Regex at it, then remembered the old adage:
Back in 1997, Jamie Zawinski wrote:Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
Frameworks & Scriptlets:

User avatar
Amie
Regular
Posts: 28
Joined: Tue Jun 06, 2017 4:48 am
Contact:

Re: Lots of coding and VN related questions

#8 Post by Amie »

Remix wrote: Wed Jan 17, 2018 4:03 pm You can use python in Ren'py quite easily:

Code: Select all

init python:
    # in an init block (create functions etc here)
    def vooweeliify( s ):
        return "".join( [ s[k]+s[k+1].lower()*2 if len(s) > k+1 and s[k+1] == s[k] else s[k]+s[k].lower()*2 if s[k].lower() in 'aeiou' else s[k] for k in range( len( s ) ) ] )

label start:

    $ s = "Samantha" # note the $ for single line python

    python:
        # in a block (usually for multi line python)
        s = vooweeliify( s )
        s = s.capitalize()

    "[s], hurry up!"
This is so clever, thanks for giving an example of how to use it! I love using RenPy, but I'm far from being a coder, I'm trying to learn but it's a slow process for me, so examples like yours really help :)

User avatar
PoisionLullaby
Regular
Posts: 44
Joined: Wed Jan 10, 2018 9:11 pm
Projects: Reaching
Deviantart: PoisionLullaby
Contact:

Re: Lots of coding and VN related questions

#9 Post by PoisionLullaby »

Empish wrote: Wed Jan 17, 2018 10:24 am 1) If you want to do it in a smart way, it'd be very complicated. You'd basically have to find where the middle or first vowel is and extend that.

2) Does your sprite have any empty space on the bottom? It aligns based on the bottom of the image

3) Yes, you can do that. You'd have to modify the quick_menu screen in screens.rpy. I'd recommend experimenting with screen language first though.

4) Same as 3

5) I have a tutorial here that can get you started with screen language.

As for 6 and 7, I'd pose them in the creator discussion, since they're not related to how Ren'py works.
1) I can tell that from Remix's examples. I'm very new to ren'py and coding but I would love to become better at it to help others and be able to make my own content better.

2) That may very well be my issue. The sprite has a transparent background and it'self is pretty small but I think the actual size was larger then I thought. My bad. lol

3/4) Very well I'll look into that then.

5) Thank you very much.

6/7) Okay that makes sense. Thank you all for all the help. :)
~Everyone has bad days. Don't judge someone on that day and that day alone, judge them on their actions after it and onward.~

Post Reply

Who is online

Users browsing this forum: Bing [Bot]