KS Java Editor (+ source code)

  • 52 Replies
  • 15304 Views
*

Offline AA

  • 510
  • 23
  • Was ITA84
    • View Profile
    • Insight on Videogames
KS Java Editor (+ source code)
« on: May 11, 2009, 03:30:20 »
A Knytt Stories Editor entirely made in Java; it looks much like the original one, but has a couple additions like some skinning possibilities (unpack Skin.zip in the same folder) and undo/redo.

Thanks to xoft for his Level Composer, whose code has helped me a great deal.

-----------

Release 0.1 (Beta) + Source
requires Java 1.5 or greater
Uses JOrbis (LGPL) and EasyOgg (??) for sound

Release 0.2 + Source
+ Undo/Redo commands
+ Skinning feature (sample Skin included, put 'Skin' directory where the editor .jar is)
inverted mouse wheel increments

Release 0.3 + Source
+ Test button for Windows users should work

Release 0.4 + Source
+ Added support for Test button through Wine (make sure 'wine' is in 'PATH')
+ Changed some mouse event handling methods to (hopefully) make graphics tablet input work
+ More checks on I/O operations; this should avoid data-loss bugs
- minor fixes here and there

Release 0.5 + Source
+ Compress should now work correctly

Release 0.6 + Source
- small tweaks and optimizations
- code reorganized

Release 0.7 + Source
+ Missing keyboard shortcuts (WASD and the like)
+ Level list ordering (I'm really ashamed it's been missing for so long)
- added some swirling dots just for show, the next version should be like the original

Release 0.8 + Source
- removed the swirling dots in the end, they don't add much to the editor anyway

Release 0.9 + Source
- small fixes and code cleanup

Release 1.0 + Source
- fix for high CPU usage bug
- probably won't work on this anymore, save for bugfix requests

-----------

Download the editor's zip file in the attachments, or the jar file from this link: KSEditor-1.0 (DataFileHost)

Regards
« Last Edit: May 11, 2014, 18:42:03 by AA »
Videogames are for everyone, by everyone

*

Offline Looki

  • 166
  • 7
    • View Profile
Re: KS Java Editor (+ source code)
« Reply #1 on: May 11, 2009, 06:42:00 »
Wow, that's impressive. :) Just like the original editor.
One thing though, I'm using a graphics tablet (Wacom Intuos 3), and I can't use any of the buttons/values like bank number, currently selected layer, etc. - I can double-click them to increase them by one, though.
I'm not sure if it's your fault or java not being able to handle tablets correctly, which I personally would find weird.

*

Offline AA

  • 510
  • 23
  • Was ITA84
    • View Profile
    • Insight on Videogames
Re: KS Java Editor (+ source code)
« Reply #2 on: May 11, 2009, 15:53:50 »
Looking around a bit, I've read that some people have problems with Java Swing applications on Tablet PCs, although not always the same problem as yours, so it's posible that it's a Java bug.

If you have the newest JDK installed, you might want to try and recompile the editor, it could have been fixed in later releases (the editor was compiled with the Sun JDK 1.6.0_7 with 1.5 as target platform).

EDIT: does it work correctly while in mouse mode? (or whatever it's called when the pointer appears on screen)
« Last Edit: May 11, 2009, 15:55:37 by AA »
Videogames are for everyone, by everyone

*

Offline oebchen

  • 45
  • 0
    • View Profile
Re: KS Java Editor (+ source code)
« Reply #3 on: May 12, 2009, 03:03:19 »
This sounds very nice, especially since I'm on a Mac and wouldn't have to use the Windows emulator just to work on a level - if only I could get it to start! X-P Usually there has been a .jar file in all Java programmes I've used so far, but here I can only find .java and .class files, which are opened with my text editor and not at all, respectively. Am I doing something wrong? Do I maybe have to open one of the files from the terminal? In this case, what would I have to type in order for it to work? Please excuse my hopeless noobness... :oops:

*

Offline AA

  • 510
  • 23
  • Was ITA84
    • View Profile
    • Insight on Videogames
Re: KS Java Editor (+ source code)
« Reply #4 on: May 12, 2009, 05:43:19 »
I don't know how it works on a Mac, but a .jar file containing a Java application and an entry point (which is the case here) can be executed directly: on Windows with a Java runtime it's usually sufficient to double-click the .jar file, and if it doesn't work, using the command line is an alternative.

In your case, you can just place the .jar file in your Knytt Stories directory, open a terminal there and enter the command
Code: [Select]
java -jar KSEditor.jarMy guess is that all the other Java programs you used had some script file that executed a command like this in your place.
Videogames are for everyone, by everyone

*

Offline oebchen

  • 45
  • 0
    • View Profile
Re: KS Java Editor (+ source code)
« Reply #5 on: May 12, 2009, 06:21:25 »
Thanks! The point is that there doesn't seem to be any .jar file in the folder, even the search doesn't come up with one - should there be one? If so, maybe it's the fault of my decompression software for not unpacking it from the .zip file you've uploaded, although it's usually quite reliable and shouldn't just skip files when unpacking (or perhaps it is in fact TOO good and unpacked the .jar file into all those .class and .java files - would that be a logical possibility?). Sorry, I haven't been myself lately (more stress than I can probably handle) so I might have overlooked something blatantly obvious... Maybe I have to compile the folder somehow rather than just run a programme? I must admit that I don't know how to do that, I'm only just getting to know Linux very slowly... But I have a friend who studies informatics, so if this is really the case, I can ask her to help me with that, and you don't have to take the time to explain it to me via internet :)

(And yes, that's also the way .jar files usually work on Macs as well, so this shouldn't be any problem at all - once there IS a .jar file to open X-P)

*

Offline TechnoGeek

  • 238
  • 0
  • My new project, Notroid
    • View Profile
Re: KS Java Editor (+ source code)
« Reply #6 on: May 12, 2009, 11:10:13 »
@oebchen: try running the .class files from the terminal, that should work
Spoiler: Technogeek's Signature (click to show/hide)

*

Offline AA

  • 510
  • 23
  • Was ITA84
    • View Profile
    • Insight on Videogames
Re: KS Java Editor (+ source code)
« Reply #7 on: May 12, 2009, 17:21:46 »
(or perhaps it is in fact TOO good and unpacked the .jar file into all those .class and .java files - would that be a logical possibility?)

That's probably it. Sorry for the misunderstanding, but I suppose that's what happened: since I couldn't attach the .jar file directly to the post (this Forum doesn't allow it), I had to wrap it in a .zip file, and probably your overzealous decompression tool unpacked both in a single pass.

Now, you could either try to figure out how to extract the .jar file only, or you can use the .jar file I uploaded on Media Fire:

Media Fire link

Alternatively, you can also execute the uncompressed editor by opening the terminal on the directory you've unpacked it and entering
Code: [Select]
java KSJavaEditor.KSEditorwhich is the main class of the editor. This is just in case you were curious about it.

I hope this solves it. Please let me know if/how it works, I don't think anyone has tried it on a Mac yet.
Videogames are for everyone, by everyone

*

Offline Looki

  • 166
  • 7
    • View Profile
Re: KS Java Editor (+ source code)
« Reply #8 on: May 12, 2009, 22:00:38 »
AA, I don't have any java compilers. Sorry.

Yes, it works fine with the tablet's mouse and my separate mouse (connected via cable).

By the way, it's no tablet PC - I just use a tablet as input device: http://a.img-dpreview.com/news/0409/wacmint3-02.jpg

*

Offline oebchen

  • 45
  • 0
    • View Profile
Re: KS Java Editor (+ source code)
« Reply #9 on: May 13, 2009, 01:33:38 »
Great, the .jar file works! Thank you very much! :) Looks very nice, too! Then this really must have been what happened, although the original .jar file should still have been in the recycle bin (which it wasn't) because that's where the programme automatically puts already-decompressed archives. Or at least it still should have been SOMEwhere on my computer... Strange...

When trying to open it via the command line you've given me, it says the following:

Spoiler: pretty long code (click to show/hide)

If you can make anything out of this at all... By the way, I don't know why it replaces the full stop with a slash in the first line so that it reads "ksjavaeditor/kseditor" instead of "ksjavaeditor.kseditor", that's not a typo on my part - but maybe this is where the problem lies? Maybe the terminal, for some reason, can't read a full stop properly and therefore replaces it with a slash, making the command useless or inexecutable? I've also tried out the code in all the other subdirectories of the folder, but the result was always the following:

Code: [Select]
Exception in thread "main" java.lang.NoClassDefFoundError: KSJavaEditor/KSEditor
I don't think we have that many Mac users on the forum, so please tell me if there is anything else to test for Mac-friendliness! ;) (eg other possible ways of getting the editor to work) I'll be glad to help!

*

Offline AA

  • 510
  • 23
  • Was ITA84
    • View Profile
    • Insight on Videogames
Re: KS Java Editor (+ source code)
« Reply #10 on: May 13, 2009, 01:39:53 »
AA, I don't have any java compilers. Sorry.

Yes, it works fine with the tablet's mouse and my separate mouse (connected via cable).

By the way, it's no tablet PC - I just use a tablet as input device: http://a.img-dpreview.com/news/0409/wacmint3-02.jpg

Now that I think about it, the problem might be due to how I implemented the mouse event handling. Do the 'Test' and 'StartPos' buttons work for you, as opposed to the bank/layer counters? If they do, I could try fixing this.
Videogames are for everyone, by everyone

*

Offline TechnoGeek

  • 238
  • 0
  • My new project, Notroid
    • View Profile
Re: KS Java Editor (+ source code)
« Reply #11 on: May 13, 2009, 01:49:44 »
Great, the .jar file works! Thank you very much! :) Looks very nice, too! Then this really must have been what happened, although the original .jar file should still have been in the recycle bin (which it wasn't) because that's where the programme automatically puts already-decompressed archives. Or at least it still should have been SOMEwhere on my computer... Strange...

When trying to open it via the command line you've given me, it says the following:

Spoiler: pretty long code (click to show/hide)

If you can make anything out of this at all... By the way, I don't know why it replaces the full stop with a slash in the first line so that it reads "ksjavaeditor/kseditor" instead of "ksjavaeditor.kseditor", that's not a typo on my part - but maybe this is where the problem lies? Maybe the terminal, for some reason, can't read a full stop properly and therefore replaces it with a slash, making the command useless or inexecutable? I've also tried out the code in all the other subdirectories of the folder, but the result was always the following:

Code: [Select]
Exception in thread "main" java.lang.NoClassDefFoundError: KSJavaEditor/KSEditor
I don't think we have that many Mac users on the forum, so please tell me if there is anything else to test for Mac-friendliness! ;) (eg other possible ways of getting the editor to work) I'll be glad to help!
@oebchen: it's probably case sensitive, i think that's what the error is about, type it in exact case
Spoiler: Technogeek's Signature (click to show/hide)

*

Offline oebchen

  • 45
  • 0
    • View Profile
Re: KS Java Editor (+ source code)
« Reply #12 on: May 13, 2009, 02:07:01 »
Stupid me... :oops::oops::oops: I didn't even think it might be case sensitive because all the other commands that I've used so far haven't been case sensitive - but then I haven't had to start a Java application from the terminal yet; so far I've only changed directories, installed KS levels, stuff like that... So this works too - I feel like a complete fool... :oops: Of course, you may disregard that part of my message now...

*

Offline Looki

  • 166
  • 7
    • View Profile
Re: KS Java Editor (+ source code)
« Reply #13 on: May 13, 2009, 03:00:43 »
AA, yes they do.  :)

*

Offline AA

  • 510
  • 23
  • Was ITA84
    • View Profile
    • Insight on Videogames
Re: KS Java Editor (+ source code)
« Reply #14 on: May 13, 2009, 03:19:53 »
T3c4n0g33k, thanks for your quick intervention!

By the way, I don't know why it replaces the full stop with a slash in the first line so that it reads "ksjavaeditor/kseditor" instead of "ksjavaeditor.kseditor", that's not a typo on my part - but maybe this is where the problem lies? Maybe the terminal, for some reason, can't read a full stop properly and therefore replaces it with a slash, making the command useless or inexecutable?

It may seem weird, but Java always does this: since Java packages are the same as directories, the dot '.' (which delimits packages) and the slash '/' (which delimits directories) are often used interchangeably by the virtual machine.

Looki: Ok, I'll look into it and see what I can do.
Videogames are for everyone, by everyone