Page 1 of 1

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

Posted: Thu Oct 26, 2017 10:18 pm
by UserX
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.

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

Posted: Fri Oct 27, 2017 12:56 am
by Imperf3kt
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]

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

Posted: Fri Oct 27, 2017 7:23 pm
by UserX
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!

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

Posted: Sat Oct 28, 2017 11:40 am
by Scribbles
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/

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

Posted: Sat Oct 28, 2017 8:37 pm
by UserX
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!!!

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

Posted: Sat Oct 28, 2017 11:57 pm
by Divona
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

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

Posted: Sun Oct 29, 2017 11:18 am
by UserX
@Divona Oh my god THANK YOU SO MUCH!!! Finally my stats menu works how it should!!! :D