AttributeError: 'NoneType' object has no attribute 'append', but it's the tip of the iceberg {RESOLVED?}

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
halibabica
Newbie
Posts: 1
Joined: Sun Jul 31, 2022 7:51 am
Contact:

AttributeError: 'NoneType' object has no attribute 'append', but it's the tip of the iceberg {RESOLVED?}

#1 Post by halibabica »

I'll try my best to explain this clearly since it needs a lot of context, but I'm not that tech savvy, so I apologize if I misuse any jargon. I'm making a mod of Doki Doki Literature Club that's incorporating a new gameplay style, and something has selectively gone awry. I've been adapting the ADYA Overworld Engine by Moleworks 2015/Mekire as needed for the project. What makes this weird is that the mod runs fine on some machines and throws up an error on others.

What happens when the game runs normally is as follows: The world map has touch encounters that call a label when the player bumps into them. These are used for wandering enemies to initiate combat, but I also use stationary invisible ones to trigger story events. When the player touches one, a few variables turn on to paralyze the map and a python block calls the renpy label in new context. When the renpy label concludes with a return, it resumes inside the python block and the map becomes active/in control again, and all is well.

However, on certain machines, an error occurs after the return from the renpy label: AttributeError: 'NoneType' object has no attribute 'append'. I have an older PC I use for development and a newer laptop for recording games. The PC runs this script fine while the laptop gets this error.

This happens on a line in the map handler python block where a boolean is being defined based on 'ui.interact'. It takes a string and two numbers for a label and the map coordinates, then uses these to teleport the player to a different map. I suspect this means the laptop is detecting a ui interaction that the PC is not, for whatever reason, and causing the script to go astray.

My first instinct to fix this was to define the variable in a try/except case instead, which does prevent the laptop's error, but it creates new problems on both machines. It causes the script to carry on past the variable definition and enact things that should be reserved for later, while also preventing access to the main menu and stopping the game from being closed without using the task manager to end the process.

The closest I came to solving it was to have the except case trigger a variable that prevents the map from teleporting if there's an exception, and then check some additional variables to see if the player was going for the menu or closing the program. The trouble there is I can't reliably set up variables to turn on for either of those events, especially the closing one since that can be initiated by clicking the x in the window's corner. There are choice messages that pop up in both cases, warning about unsaved data for the menu and asking if you want to quit for closing, but it seems these are part of renpy's source code and can't be found in the game's scripts otherwise.

Ideally, this rogue script line would just terminate on its own instead of needing to go somewhere, letting the map resume normal functioning. Help?

-----

EDIT: I'm leaving this up as a curiosity if anyone has a guess about what the heck was going on, but the error I received while playing the mod on my laptop only occurs when I launch it with DDLC's standard executable. If I use Ren'Py itself to launch the mod, it works exactly like it should. -_-

Post Reply

Who is online

Users browsing this forum: Google [Bot]