Hi everyone, I hope you can help me solve a problem with my script.rpy file.
I have a project I am working on in Ren’py (version 7.4.11.2266). It has worked fine up until today. But today I hit a problem when I added new material to the script.rpy file.
I wrote the new material in MS Word (my normal approach). I copied my existing game file and renamed the copy with a new release number. Then I pasted the text from MS Word into the new game file and added in the quotation marks, indents etc.
Initially the script.rpy file seemed fine, but when I reopened it a while later the entire script.rpy file has become “inert”, just dead text rather than showing all the different colours that one expects when working in Atom. Meanwhile all the other files (gui.rpy etc) are still fine!
I have repeated this process a couple of times and always get the same result. Any ideas as to what is causing this problem? I do have a large amount of text in my script.rpy file now; is there a limit on the amount of text that file can cope with? Should I be setting up my new game file in a different way (i.e. not copying and renaming the old file)?
Grateful for any advice or suggestions you can give me.
Script.rpy file going “dead” after new material added
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.
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.
-
- Veteran
- Posts: 293
- Joined: Fri Sep 17, 2021 2:09 am
- Organization: enaielei
- Tumblr: enaielei
- Deviantart: enaielei
- Github: enaielei
- Skype: enaielei
- Soundcloud: enaielei
- itch: enaielei
- Discord: enaielei#7487
- Contact:
Re: Script.rpy file going “dead” after new material added
My best guess is you messed up the syntax somehow when you copied over from ms word.
You probably missed some proper quotation marks (both ending and starting).
In vscode (using the renpy extension) the syntax highlight will work up to the point of the script where the codes are correct. My strategy is to look starting from this point until the point where syntax highlight didn't work for syntax errors (especially improper quotes).
Regardless of the editor, you should do that, check the script from top to bottom for syntax errors.
Another way is to just simply run the game and when you are at the point where the game throws an error about syntax errors, you should take note of the line of code then fix and save it right after. Using auto-reload, in this case, would make the debugging process faster.
You probably missed some proper quotation marks (both ending and starting).
In vscode (using the renpy extension) the syntax highlight will work up to the point of the script where the codes are correct. My strategy is to look starting from this point until the point where syntax highlight didn't work for syntax errors (especially improper quotes).
Regardless of the editor, you should do that, check the script from top to bottom for syntax errors.
Another way is to just simply run the game and when you are at the point where the game throws an error about syntax errors, you should take note of the line of code then fix and save it right after. Using auto-reload, in this case, would make the debugging process faster.
- Ocelot
- Lemma-Class Veteran
- Posts: 2438
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Script.rpy file going “dead” after new material added
In my experience, trying to edit code with Word is a perilous affair. Main danger is Word silently replacing some characters with other: dashes with em-dashes, space with some other kind of space. quotation marks with different quotation marks.
I suggest to follw enaielei's advice and if you find a line where problem apparently is, but it is not obvious, try to rewrite whole line manually in non-Word editor. If you notice some character being replaced, you can force Word to stop replacing that character.
I suggest to follw enaielei's advice and if you find a line where problem apparently is, but it is not obvious, try to rewrite whole line manually in non-Word editor. If you notice some character being replaced, you can force Word to stop replacing that character.
< < insert Rick Cook quote here > >
Re: Script.rpy file going “dead” after new material added
Many thanks for the ideas. Unfortunately it is not a case of the script going bad from the point where the new text starts. The entire script.rpy file is going dead, from line 1.
I have used this approach successfully in the past: work in Word, paste into script.rpy, then add all the “ “, indents etc. Usually I can see the interface between corrected text and un-corrected text as I work my way through the new addition, but this time adding new text kills the entire script file, old (previously-working) text as well as new.
Very frustrating!
I have used this approach successfully in the past: work in Word, paste into script.rpy, then add all the “ “, indents etc. Usually I can see the interface between corrected text and un-corrected text as I work my way through the new addition, but this time adding new text kills the entire script file, old (previously-working) text as well as new.
Very frustrating!
Re: Script.rpy file going “dead” after new material added
Why would anyone use Word for programming? It's just not designed for that. It's purpose is documents for printing, formatting on a page etc.
For programming, you can use
Geany - relatively simple and lightweight (26 Mb for Windows) editor:
https://www.geany.org/
It can automatically replace TABs with spaces, show "hidden" characters etc. You can even set it to re-run Ren'Py with a single hotkey, making it a kind of a "development environment".
VSCodium - more sophisticated and "heavy", but still pretty fast editor:
https://vscodium.com/
Among other things, it has a plugin to highlight all Ren'Py syntax. It's the new standard instead of Atom.
Perhaps using these editors could help you figure out what was wrong with your text from Word. Export Word text as TXT, then use some editor to show any unusual symbols, delete them and... profit!
For programming, you can use
Geany - relatively simple and lightweight (26 Mb for Windows) editor:
https://www.geany.org/
It can automatically replace TABs with spaces, show "hidden" characters etc. You can even set it to re-run Ren'Py with a single hotkey, making it a kind of a "development environment".
VSCodium - more sophisticated and "heavy", but still pretty fast editor:
https://vscodium.com/
Among other things, it has a plugin to highlight all Ren'Py syntax. It's the new standard instead of Atom.
Perhaps using these editors could help you figure out what was wrong with your text from Word. Export Word text as TXT, then use some editor to show any unusual symbols, delete them and... profit!
If the problem is solved, please edit the original post and add [SOLVED] to the title.
Re: Script.rpy file going “dead” after new material added
A belated update to this matter.
I ended up downloading another editing software package – MS Visual Studio Code. Unlike Atom, it accepts my new work and does not crash the script.rpy file. I can still do my drafts in Word (which are perfectly fine) then drop it into VSC and do the final formatting.
I am now using VSC for working on the script.rpy file. Atom still allows me to work on my other .rpy files and remains unresponsive on the script.rpy file that works perfectly in VSC.
It’s weird but I can live with it!
I ended up downloading another editing software package – MS Visual Studio Code. Unlike Atom, it accepts my new work and does not crash the script.rpy file. I can still do my drafts in Word (which are perfectly fine) then drop it into VSC and do the final formatting.
I am now using VSC for working on the script.rpy file. Atom still allows me to work on my other .rpy files and remains unresponsive on the script.rpy file that works perfectly in VSC.
It’s weird but I can live with it!
Who is online
Users browsing this forum: Google [Bot]