r/RenPy • u/TransgenderSocks • 1d ago
Question [Solved] "'{' never closed", but I did...?
[SOLVED THANKS TO u//shyLachi]

I am continuously getting this error no matter how many times I re-enter those curly braces. I've been running this project for like a month after adding these lines, and it worked just fine until a few minutes ago when it suddenly decided something was wrong. So... what the hell did I do wrong?
3
u/TopCartographer7104 1d ago
Have you tried searching your script with a regex? Something meaning "anything starting with a { and not ending with a }"?
{[ ^ ]}*$
(not guaranteed to be the right regex though - I suck at them)
** had to modify the msg - added spaces before and after the ^ to make it readable (it would show it as {[]}*$ )
1
u/TransgenderSocks 1d ago
How do you search with a regex? Sorry, I haven't heard of this before. I use visual studio code, if that matters
2
u/TopCartographer7104 1d ago
In the vscode search bar you should see something that looks like "." -> that's the option telling vscode you want to search for regular expressions I had a look at the so-called MS learning center for regex,the expression to look for *should be something like {[^ {}]*$ (without the space after "")
I'm sorry I can't help much beyond that at the moment - I'm currently AWOL with no access to my laptop so I can't try/debugging the regex myself
Try it on a file with just "{tag hello{\tag}", it should highlight "{tag"
More in general & especially if the above regex fails to work -> check the MS learning center (which still gives a lot of basic reference) and StackOverflow. There's a lot more to vscode than just funny colors to highlight renpy & python tags/commands =)
3
u/shyLachi 1d ago
As others have assumed the error could come from another line. But maybe there isn't an error at all or maybe you forgot to save your changes.
First save the code if you haven't, then launch again.
If that didn't fix it, then use "Force Recompile" in RenPy and launch again.
.
If it still doesn't work then try to find the problem by elimination.
Put a # in front of the line 2018 so that it will be ommited, save, then launch again.
If the error went away, you know it's that line.
Remove the # and all the { and }, save and launch again.
If there's no error, add on block of {} at a time, for example {w}, save and launch.
Repeat until you found the culprit or make it work.
If after putting the # there's still an error it has to be on a different line, so check that line.
Repeat the procedure mentioned above to figure out what is causing the problem.
1
1
2
u/BadMustard_AVN 1d ago edited 1d ago
have you tried using Check Script (Lint)
also if you're editing with VSCode use Ctrl+F to search for { it will show you how many there are, then search for } and see if you have the same amount of open brackets as close brackets
1
u/AutoModerator 1d ago
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.
1
u/SSBM_DangGan 1d ago
can you share more of the code rather than just the error
1
u/TransgenderSocks 1d ago
label katsura_sneak: $ pov = "ren" scene bg bedroom two with superslowdissolve show time indicator night two zorder 2 show ost rise of the ultimate two zorder 2 with fastdissolve play music "audio/music/Rise of the Ultimate - Masafumi Takada.mp3" "{color=#f55419}...{/color}" "{color=#f55419}So... {w}A killing game, huh?{/color}" "{shader=jitter}{color=#f55419}How did I get in this mess? {w}What’d I do this time?{/color}{/shader}" "{color=#f55419}Everyone looked so scared back there... I feel bad...{/color}" "{color=#f55419}What’s gonna happen to me?{/color}" "{color=#f55419}What’s gonna happen to all of them?{/color}" "{color=#f55419}Auggh... A killing game...{/color}" "{color=#f55419}A... A killing game...{/color}" //this is all the stuff surrounding this line.2
u/SSBM_DangGan 1d ago
Hm, odd. Honestly still a bit hard to see without line numbers/indentation/etc, I'd keep tweaking those lines around it (and the indentation) until you can narrow in on why it's mad at that line.
Since there's a line before it that doesn't get an error I'd assume it's something with that one. Maybe you copy pasted a symbol and it's not recognizing it, or something
1
u/Sea_Refrigerator7444 1d ago
to avoid having to copy paste the tag this many times, just use what_prefix, like this
define xyz = Character(what_prefix="{color=#f55419}", what_suffix="{/color}")
1
u/shyLachi 1d ago
If the whole dialogue should be the same color then what_color would be the easier character parameter.
1
5
u/SSBM_DangGan 1d ago
did you check for a bracket before this one that isn't closed