In-game menu problem

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
bambino358
Regular
Posts: 26
Joined: Sat Apr 27, 2019 7:17 am
Contact:

In-game menu problem

#1 Post by bambino358 »

Hi,
I have a problem with in-game menu.
Code for menu:

Code: Select all

menu menupokoj:
            "-Ask Her How She's Doing- (10 gold) (ne)" if quest3 == True and quest3postup == 0 and zlataky < 10:
                "nejde"
        
            "-Ask Her How She's Doing- (10 gold)" if quest3 == True and quest3postup == 0 and zlataky >= 10:
                call quest3_0
If zlataky >= 10 you can click menu choice "-Ask Her How She's Doing"

You can change the variable (zlataky) in the screen:

Code: Select all

screen statistikyhrac:
    zorder 4
    modal True
    imagemap:
        ground "gui/stats/statistikyhrac.png"
        idle "gui/stats/statistikyhrac-idle.png"
        hover "gui/stats/statistikyhrac-hover.png"
	if zlataky>=5:
            hotspot (702, 288, 100, 50) action [SetVariable("hvyjednavani", hvyjednavani+1), SetVariable("zlataky", zlataky-5) ]
Problem is when I call a screen and change variable (when I already see the menu choices).

I change variable so zlataky < 10 but the menu choice is still active. (picture 2)

I have to close mene and open it again and then the choice is not active any more. (picture 1)

Is there a way how to change menu choices imediately when I close screen?

Thank you
Attachments
4.JPG
3.JPG
2.JPG
1.JPG

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: In-game menu problem

#2 Post by Per K Grok »

bambino358 wrote: Sun Feb 02, 2020 8:38 am Hi,
I have a problem with in-game menu.
--------
--------

Is there a way how to change menu choices imediately when I close screen?

Thank you

If you in the screen action also include a jump to the start of the menu, that should update the content of the menu.

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

Re: In-game menu problem

#3 Post by Imperf3kt »

Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

bambino358
Regular
Posts: 26
Joined: Sat Apr 27, 2019 7:17 am
Contact:

Re: In-game menu problem

#4 Post by bambino358 »

Imperf3kt wrote: Sun Feb 02, 2020 7:05 pm You need to update the screen, use https://www.renpy.org/doc/html/other.ht ... nteraction
Not sure how to do it. I tried this:

Code: Select all

if hvyjednavaniaktivni == True:
            hotspot (702, 288, 100, 50) action [SetVariable("hvyjednavani", hvyjednavani+1), SetVariable("zlataky", zlataky-5), Function(renpy.restart_interaction) ]
But I don't see any difference...

Post Reply

Who is online

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