JEdit Improvement

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.
Message
Author
Megaman Z
Miko-Class Veteran
Posts: 829
Joined: Sun Feb 20, 2005 8:45 pm
Projects: NaNoRenO 2016, Ren'Py tutorial series
Location: USA
Contact:

Re: JEdit Improvement

#16 Post by Megaman Z »

vlint wrote:Another issue I have with JEdit is that links to it from within visual novels (such as the Ren'Py demo) don't open it. I suspect it is because my Java installation isn't in my path, however, since I use Linux and I installed Java the legal way (that way you have to do the path manually, and I haven't figured out how to do that on Linux, yet). So, it would be nice if there were a way to make it recognize this.
You might have to go poke around the launcher .rpy files (like editor.rpy) and be ready to get your hands really dirty.

copy-pasta what I have:

Code: Select all

# This file contains logic for detecting an editor, and for selecting
# the default editor.

init:
    python hide:
        import os
        import os.path
        import sys

        if not config.editor:

            editor = os.path.normpath(config.renpy_base + "/jedit/jedit.jar")
            editor = renpy.shell_escape(editor)

            if sys.platform == 'win32':
                config.editor = 'javaw.exe -jar "' + editor + '" -reuseview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
                config.editor_transient = 'javaw.exe -jar "' + 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"'
            
        if config.editor:
            os.environ['RENPY_EDITOR'] = config.editor
        if config.editor_transient:
            os.environ['RENPY_EDITOR_TRANSIENT'] = config.editor_transient
based off of that script, you'd need to find some way to get it to know where your java wrapper would be (by default, on windows systems, the javaw.exe file goes into system32, which allows it to be called from ANYWHERE on the computer (even C:\program files) without the executible file being there. I'd assume there's some similar setup for *nix and mac systems, but I don't have experience with either of those two types of OS's)

now, if you've rigged up your VN project to where your launcher file launches your VN directly (skipping the launcher itself), that might be the problem. dunno how to go about that, but I know that's possible via some file renaming (IIRC).
~Kitsune Zeta

User avatar
EwanG
Miko-Class Veteran
Posts: 711
Joined: Thu Oct 26, 2006 5:37 pm
Location: San Antonio, TX
Contact:

Re: JEdit Improvement

#17 Post by EwanG »

EwanG wrote:I know I have a rather long script for Camp Handiba (and it's getting longer by the day), but how worried should I be that as I do my editing I quite often get "Array Out of Bounds" errors. I haven't noticed any file corruption (yet), and I always make sure to do a save as soon as I see one. But am I setting myself up for trouble? Is this a gentle way of telling me it's time to get comfortable with using multiple script files?
FWIW, while I still get this warning/error several times a day on the CH script (have not yet gotten it a single time for CR II, but then it isn't going to be as long as CH) I have yet to see any signs of corruption or dropped characters. So I'm going to presume it's a memory management issue, and continue to work with my fingers crossed. Of course if anyone has specific knowledge of what might be causing this...
Working on something... might even be something good :D

Preludian
Regular
Posts: 81
Joined: Wed Nov 05, 2008 9:10 am
Contact:

Re: JEdit Improvement

#18 Post by Preludian »

ok, I must admit, that now that I am actually really using JEdit for my project, I don't like it anymore ;(

Reasons:

1. Everytime I have an error, it opens up another instance of JEdit with all the tabs.
2. It happened to me several times that the only way to continue editing the script in any tab, is to shut down JEdit completely and then reopen it. Some errors seem to crash JEdit.

I have now tried notepad++ and edited the python specs to understand the renpy syntax and I think I'm going to stick with it and see how it works out.

@PyTom, maybe you could provide me (us) with a little HowTo for adding other editors instead of the default one.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: JEdit Improvement

#19 Post by Jake »

Preludian wrote: 1. Everytime I have an error, it opens up another instance of JEdit with all the tabs.
I'd noticed the same thing - there surely has to be a way to open a new document in an existing instance of JEdit?

That said, I know I sometimes used to close the whole of SciTE sometimes when I'd read and understood the traceback and then sat there staring blankly at my monitor for a couple of seconds wondering where my script went... ;-)
Server error: user 'Jake' not found

Preludian
Regular
Posts: 81
Joined: Wed Nov 05, 2008 9:10 am
Contact:

Re: JEdit Improvement

#20 Post by Preludian »

Well I tried -reuseview instead of -newplainview in the editor.rpy but it changed nothing.

Dunno...

Edit: Hmmm, don't know what is different, but I edited the editor.rpy in notepad++ adding -reuseview and now it works, NOT opening another instance of JEdit. Now let's see, good thing is, I can have n++ and JEdit open as both of them notices any changes in the scripts.

Here's the edited editor.rpy:

Code: Select all

# This file contains logic for detecting an editor, and for selecting
# the default editor.

init:
    python hide:
        import os
        import os.path
        import sys

        if not config.editor:

            editor = os.path.normpath(config.renpy_base + "/jedit/jedit.jar")
            editor = renpy.shell_escape(editor)

            if sys.platform == 'win32':
                config.editor = 'javaw.exe -jar "' + editor + '" -reuseview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
                config.editor_transient = 'javaw.exe -jar "' + editor + '" -reuseview "%(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 + '" -reuseview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
            
        if config.editor:
            os.environ['RENPY_EDITOR'] = config.editor
        if config.editor_transient:
            os.environ['RENPY_EDITOR_TRANSIENT'] = config.editor_transient
                

Counter Arts
Miko-Class Veteran
Posts: 649
Joined: Fri Dec 16, 2005 5:21 pm
Completed: Fading Hearts, Infinite Game Works
Projects: Don't Save the World
Organization: Sakura River
Location: Canada
Contact:

Re: JEdit Improvement

#21 Post by Counter Arts »

Hmm... I think another issue with me is that whenever I do stuff that sends Jedit to virtual memory space (youtube, image editing for UI or other things), it takes like about 5 seconds for it to swap back in to actually do stuff. I'm not sure if this is because of Java or something but that's the major annoying point for me.

Well I can always change the editor myself but I would like to know why Jedit feels more memory hungry.
Fading Hearts is RELEASED
http://www.sakurariver.ca

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: JEdit Improvement

#22 Post by PyTom »

A good project for a Java programmer might be to write a jEdit plugin that can interface with Ren'Py. Ideally, this would interface with the existing SideKick plugin to give both navigation and autocompletion.

This is something I'd consider doing myself, but I won't have time for a long time. So I'll throw it out there to see if anyone else is interested.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Preludian
Regular
Posts: 81
Joined: Wed Nov 05, 2008 9:10 am
Contact:

Re: JEdit Improvement

#23 Post by Preludian »

While learning PHP I just found this site with lots of free php tutorials, which of course isn't very interesting for most of you, but it also has a free Video about the JEdit configuration which is very nice.

He uses a great plugin called SuperAbbrevs that allows you to to have some templates assigned to abbreviations. For example you type 'class' and press TAB and then it fills out all the class structure with all you want.

I thought this could be great for Renpy too, as Autocomplete lite system...


Oh, here's the link

BTW, I never thought of it before, but my JEdit doesn't look at all lke the one he's showing, I have no Iconrow like he does, I cannot dock my filemanager. I even installed a new JEdit separately but nada, still uses the main config file. Any ideas how to solve this?

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

Re: JEdit Improvement

#24 Post by Watercolorheart »

I noticed that the native JEdit that comes with 6.90 doesn't seem to have help and tips files installed natively, but generates error messages. Particularly annoying is that if you didn't install Java or know any better, when you hit Launch, nothing happens. :evil:
I'm not even the same person anymore

User avatar
Samu-kun
King of Moé
Posts: 2262
Joined: Mon Sep 03, 2007 3:49 pm
Organization: Love in Space Inc
Location: United States
Contact:

Re: JEdit Improvement

#25 Post by Samu-kun »

So... Why exactly doesn't JEdit let me backspace when I'm holding down the shift button? It's kind of irritating when I'm typing quotations and capitals and I need to backspace quickly and I can't.

Preludian
Regular
Posts: 81
Joined: Wed Nov 05, 2008 9:10 am
Contact:

Re: JEdit Improvement

#26 Post by Preludian »

Edit>Text>Delete to Start Of Line (shortcut: Shift-Backspace) deletes all text from
the caret to the start of the current line
Should work, but doesn't. But Strg+BS is nice too, try it with

Code: Select all

"Hello, my friend", he said.

Watercolorheart
Eileen-Class Veteran
Posts: 1314
Joined: Mon Sep 19, 2005 2:15 am
Completed: Controlled Chaos / Sum of the Parts / "that" Midna game with ZONEsama
Projects: Sparse Series/Oddments Shop original cartoon in Pevrea; Cybernetic Duels (fighting game); Good Vibin'
Organization: Watercolorheart Studios
IRC Nick: BCS
Tumblr: adminwatercolor
Deviantart: itsmywatercolorheart
Github: Watercolordevdev
Skype: heartnotes
Soundcloud: Watercollider
itch: watercolorheart
Location: Florida
Contact:

Re: JEdit Improvement

#27 Post by Watercolorheart »

How do I comment/uncomment using JEdit? I download the two files, but I have no idea what to do with them now ...
I'm not even the same person anymore

Post Reply

Who is online

Users browsing this forum: No registered users