Adding Notepad++ for Ren'Py

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
User avatar
Patibulaire
Newbie
Posts: 4
Joined: Thu Jul 08, 2010 10:42 pm
Contact:

Adding Notepad++ for Ren'Py

#1 Post by Patibulaire » Fri Jul 09, 2010 12:03 am

Hi,

I am not Dev; i was looking to add Notepad++ in Ren'Py and there is a try.

Now it seem to work fine.
Download Link http://rapidshare.com/files/406149613/notepadpp.zip
Install : "Unzip here" notepadpp.zip in the Ren'Py folder. Open the Ren'Py launcher and in the menu Options select the current editor and choose Notepad++
You can modify the syntax color in notepad++, menu "Settings" > "Style configurator..." and select "Python"
Last edited by Patibulaire on Sat Jul 10, 2010 11:30 am, edited 2 times in total.

fortaat
Regular
Posts: 183
Joined: Tue May 18, 2010 1:16 pm
Contact:

Re: Adding Notepad++ for Ren'Py

#2 Post by fortaat » Fri Jul 09, 2010 8:07 am

I second the motion.
How can I change the default editor in renpy? I assume it's done outside the program, but I have no idea where to start.

User avatar
Patibulaire
Newbie
Posts: 4
Joined: Thu Jul 08, 2010 10:42 pm
Contact:

Re: Adding Notepad++ for Ren'Py

#3 Post by Patibulaire » Sat Jul 10, 2010 9:14 am

In the Ren'Py launcher, menu Options by selecting the current editor (by exemple : jEdit) you can see the list of other editors found in the Ren'Py folder.

If you want to add an other editor by your own, look at the files "xxxx.editor.py" and "xxxx"
xxxx = name of the editor
Renpy scan the folders and use these files for load the editor

fortaat
Regular
Posts: 183
Joined: Tue May 18, 2010 1:16 pm
Contact:

Re: Adding Notepad++ for Ren'Py

#4 Post by fortaat » Sat Jul 10, 2010 9:44 am

If you want to add an other editor by your own, look at the files "xxxx.editor.py" and "xxxx"
I did that, and manually edited the file. My very limited understanding got me a "Launching the editor failed" error.

Code: Select all

# Name: gEdit
# Version: 1
# Description: gEdit

import os
import os.path
import sys

editor = os.path.normpath(base + "/../gedit/bin/gedit.exe")
editor = renpy.shell_escape(editor)

if sys.platform == 'win32':
    config.editor = 'gedit.exe - jar "' + editor + '" -reuseview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
    config.editor_transient = 'gedit.exe -exe "' + editor + '" -newplainview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
else:
    config.editor = 'java - jar "' + editor + '" -reuseview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
    config.editor_transient = 'java -jar "' + editor + '" -newplainview "%(filename)s" +line:%(line)d "%(otherfiles)s"'

User avatar
Patibulaire
Newbie
Posts: 4
Joined: Thu Jul 08, 2010 10:42 pm
Contact:

Re: Adding Notepad++ for Ren'Py

#5 Post by Patibulaire » Sat Jul 10, 2010 11:01 am

I am under windows, i created a copy of the gedit folder in renpy, and added the file

gedit.editor.py

Code: Select all

# Name: gedit
# Version: 1
# Description: gedit

import os.path
import sys

editor = base + "/bin/gedit.exe"

editor = os.path.normpath(editor)
editor = renpy.shell_escape(editor)

config.editor = '"' + editor + '" "%(allfiles)s"'
and the file gedit

Code: Select all

#!/bin/sh

export LD_LIBRARY_PATH=$RENPY_GEDIT_LD_LIBRARY_PATH
export gedit_HOME="`dirname \"$0\"`"

for i in "$gedit_HOME"/bin/gedit.*-*; do
    "$i" "$@" && exit 0
done
it work but i dont understand how work the last file (without the extension) because adding or not the /bin , gedit is loaded
(im stupid its for linux this file ahahah!)

User avatar
RayRayTea
Regular
Posts: 69
Joined: Thu May 07, 2009 4:16 pm
Projects: The Stolen Diamond Ring (a mystery VN)
Contact:

Re: Adding Notepad++ for Ren'Py

#6 Post by RayRayTea » Mon Sep 06, 2010 8:12 am

Has anybody managed to set N++ to be used as the default editor under Windows? I even managed to set it up in one of the previous RenPy builds but with the new system of selecting the default editor I just don't know where to start.

Setting the Notepad++ to send the data from the currently open file to RenPy is easy (just adding a "D:\Program Files\renpy-6.9.2\renpy.exe" + "--game" "$(CURRENT_DIRECTORY)") and works perfectly but as soon as I get any error reports RenPy calls jEdit (which I'm trying to avoid).

Edit: ok I finally managed to download the link from the first post (Rapidshare was blocking me before for some reason) and it also contains the whole N++ installation directory. So now it works, but the problem is, I already had N++ installed on my computer (and launching it from RenPy directory doesn't load all the settings etc that I already have predefined) so I tried changing the

Code: Select all

editor = base + "/notepadpp.exe"
to

Code: Select all

editor = "C:\Program Files\Notepad++\notepad++.exe"
but it doesn't really work...
nekomura games
Princess Battles, a card-based stat raising sim

User avatar
SusanTheCat
Miko-Class Veteran
Posts: 952
Joined: Mon Dec 13, 2010 9:30 am
Location: New Brunswick, Canada
Contact:

Re: Adding Notepad++ for Ren'Py

#7 Post by SusanTheCat » Mon Dec 20, 2010 9:42 pm

I did it!!!! I got Ren'Py, NotePad++, and FunctionList working together!

Please note this is very specific to my system, you'll have to make allowances as necessary.

1. Install Notepad++
2. Download and install FunctionList Remember to put FunctionList in AppData in Vista
3. Run Notepad++
4. Add userdefined language "Renpy"
View->UserDefined Dialogue...
New Button
5. Set Menu to not be compact
This was the part that threw me. It is not logical, but it works.
Settings->Preferences->Language Menu
UNCHECK Make language menu compact
While you are here you will want to disable the languages you don't use
6. Exit Notepad++
7. create file notepad.editor.py in launcher directory

Code: Select all

# Name: Notepad++
# Version: 1
# Description: Requires Notepad++ be installed on your computer.

editor = ("C:\\Program Files\\Notepad++\\notepad++.exe")
editor = renpy.shell_escape(editor)

config.editor = editor + ' -n%(line)d "%(filename)s" "%(otherfiles)s"'
config.editor_transient = editor + ' -n%(line)d "%(filename)s" "%(otherfiles)s"'
8. Edit userDefineLang.xml I found it in %APPDATA%/Notepad++
Add the following

Code: Select all

    <UserLang name="Renpy" ext="rpy">
        <Settings>
            <Global caseIgnored="no" escapeChar="\" />
            <TreatAsSymbol comment="no" commentLine="yes" />
            <Prefix words1="yes" words2="no" words3="no" words4="no" />
        </Settings>
        <KeywordLists>
            <Keywords name="Delimiters">"&apos;0"&apos;0</Keywords>
            <Keywords name="Folder+"></Keywords>
            <Keywords name="Folder-"></Keywords>
            <Keywords name="Operators"></Keywords>
            <Keywords name="Comment"> 1 2 0#</Keywords>
            <Keywords name="Words1">$ add and animation as as assert at bar behind block break button call choice circles class clockwise contains continue counterclockwise def define del elif else event except exec expression finally fixed for frame from function global grid has hbox hide hotbar hotspot if if image imagebutton imagemap import in in init input is jump key knot label lambda menu not null nvl on onlayer or parallel pass pause play print python queue raise repeat return return scene screen set show side stop text textbutton time timer transform transform try use vbar vbox viewport while while window with with yield zorder</Keywords>
            <Keywords name="Words2"></Keywords>
            <Keywords name="Words3"></Keywords>
            <Keywords name="Words4"></Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD1" styleID="5" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD2" styleID="6" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD3" styleID="7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="KEYWORD4" styleID="8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="COMMENT" styleID="1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="COMMENT LINE" styleID="2" fgColor="004000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="OPERATOR" styleID="10" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER1" styleID="14" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER2" styleID="15" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
        </Styles>
    </UserLang>
9.Edit FunctionListRules.xml I found mine in %APPDATA%/Notepad++/plugins/config

Code: Select all

    <Language name="Renpy" imagelistpath="C:\Program Files\Notepad++\plugins\Config\C++.flb">
        <CommList param1="#" param2="" />
        <Group name="LABEL" subgroup="" icon="9" child="17" autoexp="0" matchcase="1" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^label\s*" regexfunc="[\w_]+" regexend=":$" bodybegin="" bodyend="" sep="" />
        </Group>
        <Group name="INIT" subgroup="" icon="15" child="11" autoexp="0" matchcase="1" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^init\s*" regexfunc="[\w_ ]*" regexend=":$" bodybegin="" bodyend="" sep="" />
        </Group>
        <Group name="DEFINE" subgroup="" icon="13" child="13" autoexp="0" matchcase="1" fendtobbeg="" bbegtobend="" keywords="">
            <Rules regexbeg="^define\s*" regexfunc="[\w_ ]+" regexend="=" bodybegin="" bodyend="" sep="" />
        </Group>
    </Language>
10.Done!

%APPDATA% is different on different computers. On my Vista machine it was in C:\Users\Susan\AppData

Susan
" It's not at all important to get it right the first time. It's vitally important to get it right the last time. "
— Andrew Hunt and David Thomas

Post Reply

Who is online

Users browsing this forum: Alex, Majestic-12 [Bot]