Game completely broken: TypeError: __init__() takes exactly 5 arguments (4 given)
Posted: Wed Mar 25, 2020 6:30 pm
Hi, I am pretty much a complete newbie to programming still, usually working alongside more experienced programmers for the past few years. I'm not sure how to explain my problem well, as I'm at a loss. I have been developing my game for awhile, and it suddenly has been crashing when I went to add a new script file. The odd thing is, that it was working completely fine prior and still works if I only use files that haven't been modified before the break I took (I took about a month break). Even just saving over an old working file without adding anything causes the game to suddenly break. I have tried just about everything in isolating the problem, and researched everywhere, and all I can tell is that the simple act of saving over a normal story script file causes the error.
The only changes I can think of is that I had taken a break off of it in order to work on a different Ren'py game with a similar codebase (like, I can see the saves from the other game, but can't load them) and during that time, the programmer I was working with had asked me to update Ren'py. However, the game still doesn't seem to work even if I use an old version. I even downloaded the game onto another computer and Ren'py, and it's giving me the same error. I've gotten it to say one other error, which I don't have, but it lists something in the ren'py common folder and "Action". I normally get the below error, though.
This is the section/line 749 it's talking about:
I did not change anything in my custom code at all and it was working fine for the past year. Thanks for any guidance you can give me.
The only changes I can think of is that I had taken a break off of it in order to work on a different Ren'py game with a similar codebase (like, I can see the saves from the other game, but can't load them) and during that time, the programmer I was working with had asked me to update Ren'py. However, the game still doesn't seem to work even if I use an old version. I even downloaded the game onto another computer and Ren'py, and it's giving me the same error. I've gotten it to say one other error, which I don't have, but it lists something in the ren'py common folder and "Action". I normally get the below error, though.
Code: Select all
I'm sorry, but an uncaught exception occurred.
While parsing /Users/xelestial/Downloads/MDE Demo/game/script/9_story/Chapter 01/mde_chapter_01.rpy.
File "game/script/0_general/customStatements.rpy", line 749, in parse_user_statement
rv = renpy.ast.UserStatement(loc, l.text, l.subblock)
TypeError: __init__() takes exactly 5 arguments (4 given)
-- Full Traceback ------------------------------------------------------------
Full traceback:
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/bootstrap.py", line 316, in bootstrap
renpy.main.main()
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/main.py", line 422, in main
renpy.game.script.load_script() # sets renpy.game.script.
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/script.py", line 275, in load_script
self.load_appropriate_file(".rpyc", ".rpy", dir, fn, initcode)
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/script.py", line 751, in load_appropriate_file
data, stmts = self.load_file(dir, fn + source)
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/script.py", line 572, in load_file
stmts = renpy.parser.parse(fullfn)
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/parser.py", line 2872, in parse
rv = parse_block(l)
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/parser.py", line 2834, in parse_block
stmt = parse_statement(l)
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/parser.py", line 2818, in parse_statement
return pf(l, loc)
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/parser.py", line 2325, in label_statement
block = parse_block(l.subblock_lexer(init))
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/parser.py", line 2834, in parse_block
stmt = parse_statement(l)
File "/Users/xelestial/Downloads/renpy-7.3.5-sdk/renpy/parser.py", line 2818, in parse_statement
return pf(l, loc)
File "game/script/0_general/customStatements.rpy", line 749, in parse_user_statement
rv = renpy.ast.UserStatement(loc, l.text, l.subblock)
TypeError: __init__() takes exactly 5 arguments (4 given)
Darwin-17.7.0-x86_64-i386-64bit
Ren'Py 7.3.5.606
Wed Mar 25 18:10:02 2020
Code: Select all
# The function that is called to create an ast.UserStatement.
def parse_user_statement(l, loc):
renpy.exports.push_error_handler(l.error)
try:
rv = renpy.ast.UserStatement(loc, l.text, l.subblock)
rv.translatable = translatable
l.advance()
finally:
renpy.exports.pop_error_handler()
if init and not l.init:
rv = renpy.ast.Init(loc, [ rv ], 0)
return rv
renpy.parser.statements.add(name, parse_user_statement)
# The function that is called to get our parse data.
def parse_data(l):
return (name, renpy.statements.registry[name]["parse"](l))
renpy.statements.parsers.add(name, parse_data)
####################################################################