Customize the new GUI (Text, credits option, meter)

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
UserX
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 5:29 pm
Contact:

Customize the new GUI (Text, credits option, meter)

#1 Post by UserX » Thu Oct 26, 2017 10:18 pm

All tutorials I've found are for the old GUI! Actually I need 3 very important things:
1) Change only the Text color of the main menu (start, load, save etc.) but leave the pink selecting color I got now.
2) Add a credits option in the main menu like (textbutton _("Credits") action ShowMenu("credits") but where I get to an own menu and not to an error window!
3) I need an imagemap during the game like a meter for relation points. For example if I add "$ relationship_character1 += 1" I want to see the values of these character one on the screen next to an image symbol.

The new GUI is really a step backwards. Don't know why they did it so complicated!

I'm new on renpy so an easy tutorial would be very nice.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3408
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Customize the new GUI (Text, credits option, meter)

#2 Post by Imperf3kt » Fri Oct 27, 2017 12:56 am

The new GUI is actually a little easier, in my opinion.
At first, its a big difference, but after learning it, its somewhat easier.

Everything you've listed can be done with minimal effort.
1: open gui.rpy and find the lines relating to color - everything is commented and well organised.
Use the Ren'Py inspection tool while running your game if you need help working out what style is in use (shift+i while mousing over what you wish to inspect)

2: take the first ( away and make sure you create that screen. Remember that Ren'Py is case sensitive.

Code: Select all

textbutton _("Credits") action ShowMenu ("credits")

screen credits():
    tag menu
    use game_menu(title)
3:

Code: Select all

default relationship_character1 = 0

#some screen
text [relationship_character1]
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py
Latest Blackjack updates

UserX
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 5:29 pm
Contact:

Re: Customize the new GUI (Text, credits option, meter)

#3 Post by UserX » Fri Oct 27, 2017 7:23 pm

The first two I managed to do but I still don't know how to add an "stats" symbol to the game screen which interacts with the relationship variables.
For example there is a little symbol or text below. If you click on it you'll see some images (faces) and all the relation points for them. Also the day/daytime.
Example: the game begins at "Day 1 - Sunday Noon" and the relation to John is 0 at the beginning.
So, if I add in my script a relationship point for example $ john += 1, then it should automatically appear in the "stats menu" during the game next to his face symbol.
I also don't know how to do this with the days. For example you see in the stats menus also "Day 1 - Sunday Noon" at the beginning. Later in the game I want to change it to "Day 1 - Evening". Then when the next day begins I want to change it to "Day 2 - Morning" and so on.
Please. Can someone give me an easy, quick tutorial. Even better the exact script codes for these two variables!

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: Customize the new GUI (Text, credits option, meter)

#4 Post by Scribbles » Sat Oct 28, 2017 11:40 am

I'm afraid there is no easy and quick tutorial for what you're wanting to do. You need to learn functions and screen language and get comfortable enough with code to create the framework for what you're wanting. You can check the cookbook on the forums for code that'll do what you want. Otherwise start combing through the documentation. -- https://www.renpy.org/doc/html/
Image - Image -Image

UserX
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 5:29 pm
Contact:

Re: Customize the new GUI (Text, credits option, meter)

#5 Post by UserX » Sat Oct 28, 2017 8:37 pm

I just need this little thing! I have no time to learn the whole renpy script system for 3 weeks cause over 90% I don't even need at all!

I've tried it this way:

default day = 0
default hours_number = 0

label start:

$ daynames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
$ hour = ["Morning", "Noon", "Afternoon", "Evening"]
$ hours = hour[(hours_number%4)]
$ todays = daynames[(day%7)]

$ hours_number += 2
$ day += 4

But it switches only the day number but shows me still Sunday Morning the whole time! So, the first to names of the brackets.
What I'm doing wrong?

Is it possible that someone gives me a correct script for that? It prevents me since 3 days from working further!!!

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Customize the new GUI (Text, credits option, meter)

#6 Post by Divona » Sat Oct 28, 2017 11:57 pm

Variable won't update itself. You have to assign/update those variables everytime you change "day" and "hours_number".

Code: Select all

define hour = ["Morning", "Noon", "Afternoon", "Evening"]
define daynames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]

default day = 0
default hours_number = 0

init python:
    def set_datetime():
        global hours, todays
        hours = hour[(hours_number%4)]
        todays = daynames[(day%7)]


label start:
    "Current date and time: [todays] [hours]."

    $ hours_number += 2
    $ day += 4
    $ set_datetime()             # Here we update the variable "hours" and "todays".

    "Current date and time: [todays] [hours]."

    return
Completed:
Image

UserX
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 5:29 pm
Contact:

Re: Customize the new GUI (Text, credits option, meter)

#7 Post by UserX » Sun Oct 29, 2017 11:18 am

@Divona Oh my god THANK YOU SO MUCH!!! Finally my stats menu works how it should!!! :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Ende, Google [Bot], Jackkel Dragon