Coding Dialogue Statements easier!
-
- Regular
- Posts: 27
- Joined: Fri Jul 08, 2016 6:53 am
- Contact:
Coding Dialogue Statements easier!
Hi!
I am using ATOM to code the blabla statements for the lines.
Is there any easier way or have a macro to mark the line and it will be automatically added with "\"...\"" ??? (my script is finished and I have to add for each line the statements. It is really annoying and time consuming!)
"\"text bla blabla\"" >>> "\"...\"" for each line?
Sorry for this beginner question but I am still a beginner using coding text editor.
I am using ATOM to code the blabla statements for the lines.
Is there any easier way or have a macro to mark the line and it will be automatically added with "\"...\"" ??? (my script is finished and I have to add for each line the statements. It is really annoying and time consuming!)
"\"text bla blabla\"" >>> "\"...\"" for each line?
Sorry for this beginner question but I am still a beginner using coding text editor.
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Coding Dialogue Statements easier!
Is this so you can include quotation marks in your script? Any reason for it?
I guess you could use the "look for" at the bottom in atom (or by pressing ctrl+F) and type in "" so you know where you've put the extra quotations and in the second box type "\" and press "replace"
I guess you could use the "look for" at the bottom in atom (or by pressing ctrl+F) and type in "" so you know where you've put the extra quotations and in the second box type "\" and press "replace"
-
- Regular
- Posts: 27
- Joined: Fri Jul 08, 2016 6:53 am
- Contact:
Re: Coding Dialogue Statements easier!
I have about 10.000 lines to add the quotation marks but I dont wanna add it manually. Is there an easy way to do it?
- Kia
- Eileen-Class Veteran
- Posts: 1039
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: Coding Dialogue Statements easier!
you can write a macro with AutoIt for such a task, though that still requires lots of manual selection of each line and pressing a key
Re: Coding Dialogue Statements easier!
Or you can write python or even RenPy script what will load lines from file, modify lines and save lines to new file.
P.S.: Something like:
P.S.: Something like:
Code: Select all
label start:
python:
## load lines, file.txt must be in project directory
with open(config.basedir+'\\file.txt','r') as f:
lines=f.read().split('\n')
## modify lines
for n,line in enumerate(lines):
## modify line as you see fit here
line=line.replace('"',"'")
## now store it for later saving
lines[n]=line
## save result file to project directory
with open(config.basedir+'\\file_result.txt','w') as f:
f.write('\n'.join(lines))
'Done'
return
I may be available for hire, check my thread: viewtopic.php?f=66&t=51350
Re: Coding Dialogue Statements easier!
Are you specifically trying to wrap dialogue in quote-marks, or is there a different use to it? Because you can add quote marks around text by using prefix/suffix arguments in Character() statements --
Code: Select all
Character(name, what_prefix=u"“", what_suffix="”")
-
- Regular
- Posts: 27
- Joined: Fri Jul 08, 2016 6:53 am
- Contact:
Re: Coding Dialogue Statements easier!
OmG!! I think this could be the most usable way to wrap the text! I will try it out!! Thank you!!!!!Tayruu wrote: ↑Fri Sep 06, 2019 8:46 pm Are you specifically trying to wrap dialogue in quote-marks, or is there a different use to it? Because you can add quote marks around text by using prefix/suffix arguments in Character() statements --Code: Select all
Character(name, what_prefix=u"“", what_suffix="”")
-
- Regular
- Posts: 27
- Joined: Fri Jul 08, 2016 6:53 am
- Contact:
Re: Coding Dialogue Statements easier!
I tried this code:
But I get an error! What is wrong with the what_prefix and suffix?
Code: Select all
define s = Character(_("Sylvie"), color="#c8ffc8", what_prefix=""", what_suffix=""")
define m = Character(_("Me"), color="#c8c8ff", what_prefix=""", what_suffix=""")
label start:
play music "illurock.opus"
scene bg lecturehall
with fade
s It's only when I hear the sounds of shuffling feet and supplies being put away that I realize that the lecture's over.
But I get an error! What is wrong with the what_prefix and suffix?
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Coding Dialogue Statements easier!
You have three double-quotation marks """ which doesn't work. You need to change that to two.
Oh I see what you were trying to do. I don't know, could you show the error?
Oh I see what you were trying to do. I don't know, could you show the error?
- SleepKirby
- Veteran
- Posts: 255
- Joined: Mon Aug 09, 2010 10:02 pm
- Projects: Eastern Starlight Romance, Touhou Mecha
- Organization: Dai-Sukima Dan
- Location: California, USA
- Contact:
Re: Coding Dialogue Statements easier!
Code: Select all
what_prefix="""
There are a few ways to write a Python string containing a quotation mark.
1. Surround the " with single quotes, '. Python strings can be defined using either single or double quotes.
Code: Select all
what_prefix='"'
Code: Select all
what_prefix="\""
Code: Select all
what_prefix=u"“", what_suffix=u"”"
-
- Regular
- Posts: 27
- Joined: Fri Jul 08, 2016 6:53 am
- Contact:
Re: Coding Dialogue Statements easier!
I still got an error the syllables are missing. Could it be that the what_prefix is on the wrong place?
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Coding Dialogue Statements easier!
Code: Select all
define s = Character(_("Sylvie"), color="#c8ffc8", what_prefix='"', what_suffix='"')
-
- Regular
- Posts: 27
- Joined: Fri Jul 08, 2016 6:53 am
- Contact:
Re: Coding Dialogue Statements easier!
I always get this error message
Code: Select all
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.
File "game/script.rpy", line 23: is not terminated with a newline. (Check strings and parenthesis.)
(Perhaps you left out a ' at the end of the first line.)
s I've had a lot of other thoughts on my mind...thoughts that culminate in a question.
Ren'Py Version: Ren'Py 7.3.2.320
Sat Sep 14 10:08:26 2019
- namastaii
- Eileen-Class Veteran
- Posts: 1350
- Joined: Mon Feb 02, 2015 8:35 pm
- Projects: Template Maker for Ren'Py, What Life
- Github: lunalucid
- Skype: Discord: lunalucid#1991
- Soundcloud: LunaLucidMusic
- itch: lunalucid
- Location: USA
- Contact:
Re: Coding Dialogue Statements easier!
You still have to put quotations around the strings in the dialogue though. Or the script can't read them. The suffixes and such are just to add to it when it plays in-game. You can't use it to replace actual syntax
-
- Regular
- Posts: 27
- Joined: Fri Jul 08, 2016 6:53 am
- Contact:
Re: Coding Dialogue Statements easier!
oh! I just thought that we could save time putting the strings
Who is online
Users browsing this forum: No registered users