Change True/False Vaule to acquired/not acquired?

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
User avatar
lsf22
Regular
Posts: 139
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Change True/False Vaule to acquired/not acquired?

#1 Post by lsf22 »

Renpy version 7.4.11

So I have an inventory list that shows when the player acquires items but I want it to read out acquired or not acquired instead of True or False.

Code: Select all

hbox:
        grid 2 4:
            xpos 0.8
            ypos 0.85
            spacing 20
            xspacing 200
            text "Cream soda"
            text "[acquired_cs]"

            text "Ginger soda"
            text "[acquired_gb]"

            text "Cola"
            text "[acquired_cola]"

            text "Root beer"
            text "[acquired_rb]"
There's a screenshot attached for reference
Attachments
Item screen.png

edgebug
Regular
Posts: 41
Joined: Thu Jun 30, 2016 11:44 pm
Contact:

Re: Change True/False Vaule to acquired/not acquired?

#2 Post by edgebug »

why not something like

Code: Select all

if [acquired_rb] == False:
    text "Not acquired"
else:
    text "Acquired"
somewhere?

User avatar
lsf22
Regular
Posts: 139
Joined: Wed Feb 23, 2022 9:43 pm
Contact:

Re: Change True/False Vaule to acquired/not acquired?

#3 Post by lsf22 »

I've worked on it and so far it works, since I was using the old one with grids, I toyed with it and got it working with a grid.

example:

Code: Select all

grid 2 4:
        xalign 0.5
        yalign 0.75
        spacing 20
        xspacing 50

        text "Cream soda"
        if acquired_cs == True:
            text "acquired"
        else:
            text "Not Acquired"

        text "Ginger soda"
        if acquired_gb == True:
            text "acquired"
        else:
            text "Not Acquired"

        text "Cola"
        if acquired_cola == True:
            text "acquired"
        else:
            text "Not Acquired"

        text "Root beer"
        if acquired_rb == True:
            text "acquired"
        else:
            text "Not Acquired"
It seems less cleaner but It looks like it works
Attachments
Item Screen 2 (alt code)
Item Screen 2 (alt code)

Post Reply

Who is online

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