Ren'Py Trying to edit a renpy script

MyLewdForm

Member
Apr 3, 2020
465
1,272
So idk how this works, i wanted to edit a renpy game story and replace a name with something else and when replace that word from rpy files and try to open the game it give me the error:


"Before loading the script.
error: Error -5 while decompressing data: incomplete or truncated stream

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "renpy/bootstrap.py", line 326, in bootstrap
renpy.main.main()
File "renpy/main.py", line 382, in main
renpy.loader.index_archives()
File "renpy/loader.py", line 244, in index_archives
index = handler.read_index(f)
File "renpy/loader.py", line 129, in read_index
index = loads(zlib.decompress(infile.read()))
error: Error -5 while decompressing data: incomplete or truncated stream

Windows-10-10.0.22000
Ren'Py 7.4.8.1895 "

And even when i rename back to original name it give me same error, on another copy of the game i replaced the name with the same name and i get same error, so i have no idea what is the issue, if even when i make it how it was before its still giving me error, im noob with this things so yeah i dont really know what happens and why not working, i did this with notepad ++ and also tried Atom too , its weird coz only the fact that i edit the file even if i dont change any word in the script i get error
 

Ifartedtoolong

Well-Known Member
Feb 27, 2022
1,747
1,460
Is it a player name your trying to change? If yes there should be a script file with their name in it like character.rpy or script.rpy.

You have to find their defined name in one of those and change it there. If you try to change a character name that is at the start of a dialogue that the person is speaking it will cause errors and you can't change the names in triggers and jumps as those can cause errors as well.
 

MyLewdForm

Member
Apr 3, 2020
465
1,272
not only the name i tried,i tried some random things too, i get that error when i try to start the game after i edit anything to the script, its whatever change i do to that it stops working, even if i dont do any change at all, only the fact that i open the file and save it even without any changes in it, game wont start anymore
 

Meaning Less

Engaged Member
Sep 13, 2016
3,539
7,178
even if i dont do any change at all, only the fact that i open the file and save it even without any changes in it, game wont start anymore
Maybe your file editor is messing up with the renpy file when saving?

Try isolating the issue, edit the file with the default notepad and see if this problem still occurs. For python and renpy indentation matters, so try not breaking it.
 

Meaning Less

Engaged Member
Sep 13, 2016
3,539
7,178
I've also seen people mentioning this errors occurs if your antivirus is too sensitive, maybe it notices one of the game files was altered and blocks it.

So you could try adding the game folder as an exception to your antivirus.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,971
16,229
"Before loading the script.
error: Error -5 while decompressing data: incomplete or truncated stream
This come from the "rpyc" files processing. Some times Ren'Py is capricious, but generally it's because you messed something in your update.

What would have been interesting is to see one of the line you edited, it would probably permit to see where the error lie.