Unexpected output when diplaying a string : Solved

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
eezergoode
Regular
Posts: 58
Joined: Tue Aug 29, 2006 10:55 am
Contact:

Unexpected output when diplaying a string : Solved

#1 Post by eezergoode »

I'm basically new to Ren'Py and python. Havent done any type of coding or programming since the days of the Commodore 64. I'm trying to get back into things, and have been doing okay so far until now. I've had a lot of errors, but have been able to figure them out with the documentation of a simple search or tow.

I'm suddenly getting some strange output when trying to display some text ,including string variable, that just popped up suddenly. This was working fine earlier today. Unless I did something unknowingly, I didn't change anything in the code, although I did make a small change, then restored it to the previous state.

I'm basically trying to display the day, time, current location, and current amount of cash in a small frame at the top of the screen.

Code: Select all

    frame:
        xpos 0 ypos 0
        xminimum 1280
        yminimum 35
        ymaximum 35
        text "[output]             Cash $:[MCCash]" xalign 0.5
If I go into the dev console and print output, it displays correctly, but in the game, it shows like this

Image

Any ideas why the location is now showing up in brackets, with single quotes and the lowercase u in front?
Last edited by eezergoode on Mon Sep 30, 2019 11:47 pm, edited 1 time in total.
Eezergoode - AKA Rabid Penguin
Team Lead

It does not matter how slowly you go so long as you do not stop.
Confucius
Chinese philosopher & reformer (551 BC - 479 BC)

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Unexpected output when diplaying a string

#2 Post by isobellesophia »

eezergoode wrote: Mon Sep 30, 2019 10:08 pm I'm basically new to Ren'Py and python. Havent done any type of coding or programming since the days of the Commodore 64. I'm trying to get back into things, and have been doing okay so far until now. I've had a lot of errors, but have been able to figure them out with the documentation of a simple search or tow.

I'm suddenly getting some strange output when trying to display some text ,including string variable, that just popped up suddenly. This was working fine earlier today. Unless I did something unknowingly, I didn't change anything in the code, although I did make a small change, then restored it to the previous state.

I'm basically trying to display the day, time, current location, and current amount of cash in a small frame at the top of the screen.

Code: Select all

    frame:
        xpos 0 ypos 0
        xminimum 1280
        yminimum 35
        ymaximum 35
        text "[output]             Cash $:[MCCash]" xalign 0.5
If I go into the dev console and print output, it displays correctly, but in the game, it shows like this

Image

Any ideas why the location is now showing up in brackets, with single quotes and the lowercase u in front?

How about you try when you separate both like..

Code: Select all

text "[output]"xalign 0.0 xpos 300
text "Cash $:" xalign 0.5 xpos 600
text "[MCCash]" xpos 610
Sorry about the xaligns, just a example if the brakets were gone, i did this on purpose, seperating them would be better.
I am a friendly user, please respect and have a good day.


Image

Image


eezergoode
Regular
Posts: 58
Joined: Tue Aug 29, 2006 10:55 am
Contact:

Re: Unexpected output when diplaying a string

#3 Post by eezergoode »

Thank you. That didn't work, but it did help me narrow it down. Turns out I had unnecessary brackets elsewhere when I was creating the output string.
Eezergoode - AKA Rabid Penguin
Team Lead

It does not matter how slowly you go so long as you do not stop.
Confucius
Chinese philosopher & reformer (551 BC - 479 BC)

Post Reply

Who is online

Users browsing this forum: Google [Bot]