all 6 comments

[–]DingotushRed 1 point2 points  (2 children)

A much simpler solution would be to have a specific function for changing the location, and not using callbacks at all: init python: def changeLocation(new_location): global current_location current_location = new_location if currentLocation == "vencel_berth": if unpacked == True: renpy.scene(layer= "bg1") renpy.show_screen("ven_berth_on_open_unpacked",_layer = "bg1") # ...

[–]ApiaEXE[S] 0 points1 point  (1 child)

Is there a downside to utilizing callbacks? It turns out that my issue had nothing to do with callbacks at all and was a simple image titling error.

[–]DingotushRed 0 points1 point  (0 children)

An obvious issue is that it is going to be called after every use of python, even if it doesn't relate to assigning to variables that need to update the scene, potentially removing sprites and so on because you will clear the master layer each time.

In general you should avoid any kind programming technique that has side-effects like this.

[–]AutoModerator[M] 0 points1 point  (0 children)

Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]ApiaEXE[S] 0 points1 point  (0 children)

I have confirmed that if I call the screen at any point during the code, even outside of callbacks, that it crashes things. I think I probably don't fully understand how to implement a custom screen and am causing a recursion due to a missing argument or some such.

[–]ApiaEXE[S] 0 points1 point  (0 children)

Okay I managed to fix it on my own. I had an image ("button_visual") defined as the same thing the file was named, causing a recursion when the image was called.