"add FileCurrentScreenshot()"/"FileTakeScreenshot command results in blank screen 7.1.3

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
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

"add FileCurrentScreenshot()"/"FileTakeScreenshot command results in blank screen 7.1.3

#1 Post by AERenoir »

I have been following this tutorial to use screenshots as background to give the illusion of adding effects to whatever's currently onscreen:

viewtopic.php?f=51&t=35619

I did, however, change the command so that TakeScreenshot should be activated by "enter" key, becaiuse I'm using it on the Name Input screen

The project has been fine up until 6.99.14, but stops functioning the way I need it to after upgrading to 7.1. I think the issue is that the add FileCurrentScreenshot command was messed up because it was NOT added to the screen. The screenshot BG just came up as blank (but the other parts of the screen still shows up).

This doesn't seem like something that was listed as a change in the changelog but then what's wrong here? Maybe there's now better ways to do things, but I don't know how.

ETA: After updating to 7.1.3, the same issue is still happening.
I've tried modifying my code to look like this:

Code: Select all

key "input_enter" action [Function(renpy.take_screenshot), Function(renpy.restart_interaction), Jump("done")]
Last edited by AERenoir on Thu Jan 17, 2019 12:17 pm, edited 3 times in total.

philat
Eileen-Class Veteran
Posts: 1900
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: "add FileCurrentScreenshot()" command not working in 7.1?

#2 Post by philat »

I commented in the cookbook thread as well, but add FileCurrentScreenshot() works fine in 7.1 for me.

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: "add FileCurrentScreenshot()" command not working in 7.1?

#3 Post by AERenoir »

Then i guess something else is wrong. I copy-pasted the code straight fro the tutorial, except for positioning and file names.

Whatever's happening, the screenshot that was supposed to becomw the screen's bckground is not showing, but everything else on the screen do.

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: "add FileCurrentScreenshot()" command not working in 7.1?

#4 Post by AERenoir »

Well... This is what I wrote:

Code: Select all

key "input_enter" action [FileTakeScreenshot(), Return()]

screen rolls:
    
    add FileCurrentScreenshot() 
    add "rollup2"
And unfortunately this happens:

Image

The "rollup2" bit DOES show, though, so I'm not sure where I did the thing wrong here? The code still works in 6.99.14, so I dunno if my syntax is wrong or what.
I also tried without the brackets

Code: Select all

key "input_enter" action FileTakeScreenshot(), Return()
And it comes up with the same result.

philat
Eileen-Class Veteran
Posts: 1900
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: "add FileCurrentScreenshot()" command not working in 7.1?

#5 Post by philat »

The issue isn't FileCurrentScreenshot. The issue is FileTakeScreenshot doesn't work, for whatever reason. I couldn't be assed to dig into why, but using renpy.take_screenshot directly works. *shrug* Maybe file a bug report.

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: "add FileCurrentScreenshot()" command not working in 7.1?

#6 Post by AERenoir »

Ack, darnit. How would I submit a bug report?
In the meantime, how should I use the renpy.take_screenshot command in my case?

User avatar
PyTom
Ren'Py Creator
Posts: 16088
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: "add FileCurrentScreenshot()" command not working in 7.1?

#7 Post by PyTom »

I'd be very interested in a game that showed this problem.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

philat
Eileen-Class Veteran
Posts: 1900
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: "add FileCurrentScreenshot()" command not working in 7.1?

#8 Post by philat »

Not much to it. Brand new project in 7.1, and the following script.rpy.

P.S. Upon experimenting, it appears that FileTakeScreenshot doesn't restart interaction by default. Adding renpy.restart_interaction to the textbutton makes FileTakeScreenshot work. Possibly not a bug and simply a difference in behavior, but apparently that behavior changed between 6.99 and 7.1.

Code: Select all

define e = Character("Eileen")

screen screenshot():
    vbox:
        textbutton "FileTakeScreenshot" action FileTakeScreenshot()
        textbutton "renpy.take_screenshot" action Function(renpy.take_screenshot)

    add FileCurrentScreenshot() zoom 0.5 xalign 0.5 yalign 0.5

# The game starts here.
label start:
    show screen screenshot()
    e "You've created a new Ren'Py game."
    e "Once you add a story, pictures, and music, you can release it to the world!"

    return

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: "add FileCurrentScreenshot()"/"FileTakeScreenshot command not working in 7.1.3

#9 Post by AERenoir »

Problem is still happening. Is it because you simply can't do FileTakeScreenshot by the press of keyboard?

What I'm seeing:

Image

What I SHOULD be seeing (screenshot from project launched with Renpy 6.99.10):

Image

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: "FileTakeScreenshot/"add FileCurrentScreenshot()" command not working in 7.1.3

#10 Post by AERenoir »

Um, I think that because there's a "gap" between the "FileTakeScreenshot" and "add FileCurrentScreenshot()" commands that it's not working?

This is my screens.rpy code (this was originally built in 6.16):

Code: Select all

init python:
   
   def entername(input_text):
        global firstname
        firstname = input_text
init:
    $ style.input.caret = "brush"
    default firstname = "Eileen"
    
    
screen inputname:
    add "name2.jpg"
    input default firstname changed entername  xpos 574 ypos 433 size 120 length 9 color "#000" font 
    key "input_enter" action [FileTakeScreenshot(), Jump("done"),  ]
    
screen rolls:
    
    add FileCurrentScreenshot() 
    add "rollup2"
And this is what it looks like in script.rpy:

Code: Select all

label start:
    
    scene sign
    show unroll
    $renpy.pause(1)
    
    call screen inputname

label done:
    python:
        
        if not firstname:
            firstname = "Eileen"

    hide sign        
    show screen rolls
    $renpy.pause(1.5)
    scene scroll
    show bg castle 
    show unroll2 
    hide screen rolls
This sequence gives me the blank space where the screenshot should have been.
Because there's a "Jump" command first, and only after it goes to the next label that it calls the screen containing the screenshot, the screenshot isn't showing.

Now if I replace

Code: Select all

key "input_enter" action [FileTakeScreenshot(), Jump("done"), ]
with

Code: Select all

key "input_enter" action [FileTakeScreenshot(), Show("rolls"), ]
The screenshot DOES work. It shows onscreen properly. The problem is that now I'm stuck on the "rolls" screen and I'm unable to proceed to the next label.
I have already tried placing the "Jump" command after the Show like this:

Code: Select all

key "input_enter" action [FileTakeScreenshot(), Show("rolls"), Jump("done") ]
But it results in the same blank screen that I was having problems with in the first place.

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: "add FileCurrentScreenshot()"/"FileTakeScreenshot command results in blank screen 7.1.3

#11 Post by Remix »

Though it doesn't resolve the underlying issue (which is maybe due to key "input_enter" not behaving as desired) the following renpy.screenshot workaround seems to be ok

Code: Select all

default firstname = "Eileen"
    
default screenshot_filename = os.path.join( renpy.config.gamedir, "images", "screen_shot.png" )
    
screen inputname:
    # add "name2.jpg"
    input default firstname changed entername  xpos 574 ypos 433 size 120 length 9 color "#000" 
    key "input_enter" action [ 
        Function( renpy.screenshot, screenshot_filename ),
        Jump("done") ]
    
screen rolls:

    add Transform( screenshot_filename, zoom=0.5 ) # shrunk to show it is screenshot
Frameworks & Scriptlets:

User avatar
AERenoir
Veteran
Posts: 320
Joined: Fri May 27, 2011 8:23 pm
Contact:

Re: "add FileCurrentScreenshot()"/"FileTakeScreenshot command results in blank screen 7.1.3

#12 Post by AERenoir »

Quick question. If I remove out the zoom will it matter (other than the screenshot being huge)?

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: "add FileCurrentScreenshot()"/"FileTakeScreenshot command results in blank screen 7.1.3

#13 Post by Remix »

That's fine. I just added it to the sample script to show it was a screenshot rather than just the old screen still showing.
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Majestic-12 [Bot]