Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Unfortunately, I report that I had a crash.

ValueError: non-integer arg 1 for randrange()

File "game/glitch_ren.py", line 55, in <genexpr>

    theights = sorted(randomobj.randrange(cheight+1) for k in range(nslices)) # y coordinates demarcating all the strips

Seems like cheight is a float and not an int.

If you need more info, I can give more info in private (PM, for example)

Hi. Yes I am aware of this glitch, however I thought it had disappeared in the final build. Unfortunately, as far as I am aware I cannot solve it myself either the skills I have, as it is caused by the Ren’py Glitch Script (this one: https://github.com/Gouvernathor/renpy-ChromaGlitch) If you ignore the error the game generally goes on fine, however I if you could contact me to try and help me fix the bug, I would be forever grateful.

(1 edit)

I see. In that case, it's a bug with the Glitch Script and nothing to do with your code/VN.

Thank you for the link, I'll send them a pull request to fix this issue.

As for the solution, look for this code:

theights = sorted(randomobj.randrange(cheight+1) for k in range(nslices)) # y coordinates demarcating all the strips

Then replace it with this:

theights = sorted(randomobj.randrange(int(cheight+1)) for k in range(nslices)) # y coordinates demarcating all the strips

The lib is fixed now

That’s great! Hopefully this should help anyone trying to use the script in the future.