Another newbie question

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.
Message
Author
User avatar
DragonKnight
Regular
Posts: 51
Joined: Sun Nov 12, 2017 10:16 am
Projects: Taboo Hearts
Contact:

Another newbie question

#1 Post by DragonKnight »

I need to make a image in my upper left hand, that when clicked I see the variables in this game, and to what it represent, and then to click that image and they all go away. Can anybody help me, or if it is somewhere can you point it out??
Currently working on Taboo Hearts :D
Currently working on Forbidden :D

ReDZiX
Regular
Posts: 32
Joined: Thu Jan 04, 2018 12:42 pm
Contact:

Re: Another newbie question

#2 Post by ReDZiX »

I don't know if I understand correctly what you mean, but maybe this:

Code: Select all

#Some variables
default power = 0
default intelligence = 0
default charisma = 0

screen mc_stats(): #The screen that will show the variables

    default show_vars = False #A screen variable to turn the viewing on/off

    imagebutton auto "button_%s.png": #The imagebutton
        action ToggleScreenVariable('show_vars') 
        #^This action toggles the screen variable                              
        #between True(on) and False(off)

    if show_vars: #If the variable is True...
        
        frame: #...this frame is shown
            xpos .1
            has vbox
            text "Power:[power]"
            text "Intelligence:[intelligence]"
            text "Charisma:[charisma]"

User avatar
DragonKnight
Regular
Posts: 51
Joined: Sun Nov 12, 2017 10:16 am
Projects: Taboo Hearts
Contact:

Re: Another newbie question

#3 Post by DragonKnight »

Thank you, I'm not sure if it right but I will try it!!
Currently working on Taboo Hearts :D
Currently working on Forbidden :D

User avatar
DragonKnight
Regular
Posts: 51
Joined: Sun Nov 12, 2017 10:16 am
Projects: Taboo Hearts
Contact:

Re: Another newbie question

#4 Post by DragonKnight »

Code: Select all

# Define varbles
    $ i_love = 20
    $ i_lust = 5
    $ i_sle =20
    $ i_slt = 5
    $ m_love = 20
    $ m_lust = 0
    $ s_love = 20
    $ s_lust = 0
    $ day_gone_by = 0
    $ i_money = 500
    $ mom_money = 500
    $ s_money = 0
It don't work, am I doing something wrong. These are my var., I need them to show up when I want to and disappear when I don't.
Currently working on Taboo Hearts :D
Currently working on Forbidden :D

User avatar
Milkymalk
Miko-Class Veteran
Posts: 753
Joined: Wed Nov 23, 2011 5:30 pm
Completed: Don't Look (AGS game)
Projects: KANPEKI! ★Perfect Play★
Organization: Crappy White Wings
Location: Germany
Contact:

Re: Another newbie question

#5 Post by Milkymalk »

Please show your code, including the code from ReDZiX you copied.
Last edited by Milkymalk on Wed Mar 07, 2018 10:16 pm, edited 1 time in total.
Crappy White Wings (currently quite inactive)
Working on: KANPEKI!
(On Hold: New Eden, Imperial Sea, Pure Light)

User avatar
DragonKnight
Regular
Posts: 51
Joined: Sun Nov 12, 2017 10:16 am
Projects: Taboo Hearts
Contact:

Re: Another newbie question

#6 Post by DragonKnight »

Code: Select all

screen mc_stats(): #The screen that will show the variables

    default show_vars = False #A screen variable to turn the viewing on/off

    imagebutton auto "button_%s.png": #The imagebutton
        action ToggleScreenVariable('show_vars') 
        #^This action toggles the screen variable                              
        #between True(on) and False(off)

    if show_vars: #If the variable is True...
        
        frame: #...this frame is shown
            xpos .1
            has vbox
            text "Power:[$ i_love]"
            text "Intelligence:[$ i_lust]"
            text "Charisma:[$ i_sle]"        

# The game starts here.

label start:
# Define varbles
    $ i_love = 20
    $ i_lust = 5
    $ i_sle =20
    $ i_slt = 5
    $ m_love = 20
    $ m_lust = 0
    $ s_love = 20
    $ s_lust = 0
    $ day_gone_by = 0
    $ i_money = 500
    $ mom_money = 500
    $ s_money = 0
The power, intell. and charisma arent right, seeing how i try it out before i perm. code it. The imagebutton didnt show up.
Currently working on Taboo Hearts :D
Currently working on Forbidden :D

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Another newbie question

#7 Post by trooper6 »

This code works:

Code: Select all

# Define varbles
default show_vars = False
default i_love = 20
default i_lust = 5
default i_sle =20
default i_slt = 5
default m_love = 20
default m_lust = 0
default s_love = 20
default s_lust = 0
default day_gone_by = 0
default i_money = 500
default mom_money = 500
default s_money = 0

screen mc_stats(): #The screen that will show the variables
    vbox:
        textbutton "Stats" action ToggleVariable("show_vars")
        if show_vars: #If the variable is True...
            frame: #...this frame is shown
                xpos .1
                has vbox
                text "Power: [i_love]"
                text "Intelligence: [i_lust]"
                text "Charisma: [i_sle]"

# The game starts here.

label start:
    show screen mc_stats()
    "The game is started."

    return
I used a textbutton rather than an imagebutton because I don't have have any temporary button images right now. If you want to use an image button, you have to make sure that you have the appropriate images for the button to use.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
DragonKnight
Regular
Posts: 51
Joined: Sun Nov 12, 2017 10:16 am
Projects: Taboo Hearts
Contact:

Re: Another newbie question

#8 Post by DragonKnight »

Thanks, it works!!!
Currently working on Taboo Hearts :D
Currently working on Forbidden :D

Hime023
Newbie
Posts: 4
Joined: Thu Mar 08, 2018 5:38 am
Tumblr: hime
Deviantart: hime1
Github: hime2
Skype: hime3
Soundcloud: hime4
itch: hime5
Contact:

Re: Another newbie question

#9 Post by Hime023 »

hello guys.. i need help.. my question is how to code a start button and quit. i have a drawing but i don't know how to put codes. someone help thanks a lot im just new here.

User avatar
DragonKnight
Regular
Posts: 51
Joined: Sun Nov 12, 2017 10:16 am
Projects: Taboo Hearts
Contact:

Re: Another newbie question

#10 Post by DragonKnight »

Code: Select all

[# Define varbles
default show_vars = False
default i_love = 20
default i_lust = 5
default i_sle =20
default i_slt = 5
default m_love = 20
default m_lust = 0
default s_love = 20
default s_lust = 0
default day_gone_by = 0
default i_money = 500
default mom_money = 500
default s_money = 0

screen mc_stats(): #The screen that will show the variables
    vbox:
        textbutton "Stats" action ToggleVariable("show_vars")
        if show_vars: #If the variable is True...
            frame: #...this frame is shown
                xpos .1
                has vbox
                text "Mom Love: [i_love]"
                text "Mom Lust: [i_lust]"
                text "Sis Love: [i_sle]"
                text "Sis Lust: [i_slt]"
screen mom_stats(): #The screen that will show the variables
    vbox:
        textbutton "Stats" action ToggleVariable("show_vars")
        if show_vars: #If the variable is True...
            frame: #...this frame is shown
                xpos .6
                has vbox
                text "Mom Love: [m_love]"
                text "Mom Lust: [m_lust]"
                text "Mom $: [mom_money]"
                

# The game starts here.

label start:
    show screen mc_stats()
    show screen mom_stats()
/code]
[attachment=0]problem.png[/attachment]
I have a problem.  I need to have a space between my stats and my mom, I just can't do it.  I try xpos in different posit. and i reached 8 and it put it back to where my origal (mc) stats were
Attachments
problem.png
Currently working on Taboo Hearts :D
Currently working on Forbidden :D

Hime023
Newbie
Posts: 4
Joined: Thu Mar 08, 2018 5:38 am
Tumblr: hime
Deviantart: hime1
Github: hime2
Skype: hime3
Soundcloud: hime4
itch: hime5
Contact:

Re: Another newbie question

#11 Post by Hime023 »

thank you...

User avatar
DragonKnight
Regular
Posts: 51
Joined: Sun Nov 12, 2017 10:16 am
Projects: Taboo Hearts
Contact:

Re: Another newbie question

#12 Post by DragonKnight »

Who you thanking??
Currently working on Taboo Hearts :D
Currently working on Forbidden :D

ReDZiX
Regular
Posts: 32
Joined: Thu Jan 04, 2018 12:42 pm
Contact:

Re: Another newbie question

#13 Post by ReDZiX »

DragonKnight wrote: Thu Mar 08, 2018 6:29 am I have a problem. I need to have a space between my stats and my mom, I just can't do it. I try xpos in different posit. and i reached 8 and it put it back to where my origal (mc) stats were
As you have it right now the vboxes in both screens are overlapping (on top of each other). Try giving the vboxes the xpos instead (remove the xpos in the Frames):

Code: Select all

screen mc_stats(): #The screen that will show the variables
    vbox:
        xpos .1
        textbutton "Stats" action ToggleVariable("show_vars")
        if show_vars: #If the variable is True...
            frame: #...this frame is shown         
                has vbox
                text "Mom Love: [i_love]"
                text "Mom Lust: [i_lust]"
                text "Sis Love: [i_sle]"
                text "Sis Lust: [i_slt]"
screen mom_stats(): #The screen that will show the variables
    vbox:
        xpos .6
        textbutton "Stats" action ToggleVariable("show_vars")
        if show_vars: #If the variable is True...
            frame: #...this frame is shown   
                has vbox
                text "Mom Love: [m_love]"
                text "Mom Lust: [m_lust]"
                text "Mom $: [mom_money]"

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Another newbie question

#14 Post by trooper6 »

xpos is left/right position, ypos is the up/down position. Perhaps you want the up/down spacing.
But you can just add and empty space if you want a larger gap between the "Stats" label and your stats.

Code: Select all

# Define varbles
default show_vars = False
default i_love = 20
default i_lust = 5
default i_sle =20
default i_slt = 5
default m_love = 20
default m_lust = 0
default s_love = 20
default s_lust = 0
default day_gone_by = 0
default i_money = 500
default mom_money = 500
default s_money = 0

screen mc_stats(): #The screen that will show the variables
    # imagebutton auto "button_%s.png": #The imagebutton
    #     action ToggleScreenVariable('show_vars')
    #     #^This action toggles the screen variable
    #     #between True(on) and False(off)

    vbox:
        textbutton "Stats" action ToggleVariable("show_vars")
        text "  "
        if show_vars: #If the variable is True...
            frame: #...this frame is shown
                xpos .1
                has vbox
                text "Power: [i_love]"
                text "Intelligence: [i_lust]"
                text "Charisma: [i_sle]"

# The game starts here.

label start:
    show screen mc_stats()
    "The game is started."

    return

A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
DragonKnight
Regular
Posts: 51
Joined: Sun Nov 12, 2017 10:16 am
Projects: Taboo Hearts
Contact:

Re: Another newbie question

#15 Post by DragonKnight »

Excellent!!!!!!!! It works, thank you!!!
Currently working on Taboo Hearts :D
Currently working on Forbidden :D

Post Reply

Who is online

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