Choice screen and custom object

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
abysswatcher
Regular
Posts: 42
Joined: Sun Apr 12, 2020 11:50 pm
Projects: To-Live:The Struggle
Organization: Youyu de Shijie(憂鬱的世界)
Github: LuYifeng112
itch: https://luyifeng.itc
Location: New Zealand
Contact:

Choice screen and custom object

#1 Post by abysswatcher »

I wrote up this code for a "status message" system below:

Code: Select all

init python:
    import renpy.store as store
    
    class status(store.object):
        def __init__(self, name, image):
            self.name = name
            self.image = image

define status_warning = status("Light Warning", "images/notify_icons/icon.5_02.png")


screen status_show(status=None):
    tag status_mode

    add status.image xalign 0.84 yalign 0.25 size(80,80)
    text status.name xalign 0.99 yalign 0.25 size 35

    timer 5.0 action Return()
While this screen worked I don't know how I can use this in the choice screen so that I can show a different status message when an option is hovered. Does anyone have a good idea how to go about this?
The goal of the revolution is to achieve the people's rights, but during the course of the revolution, we must stress military power - and the two are mutually contradictory.
-Sun Yat-sen
"Become a Visual Novel writer they said, it will be fun" (little did they know they were right)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Imperf3kt