[Tool] FTL Ship Editor: Superluminal [NOT UPDATED TO AE]

Discuss and distribute tools and methods for modding. Moderator - Grognak
Heathen
Posts: 6
Joined: Thu Feb 07, 2013 12:56 am

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby Heathen » Thu Feb 07, 2013 7:14 am

Fantastic ship editor! Got a ship I drew up and running just nicely. Alas, I forgot to add the words "STARBUG 1" to the sides of the ship so I went and edited my PNG image to include it.

superluminal_win_x32_6-2-13 now crashes any time I try to load up that specific PNG image.

http://cloud.steampowered.com/ugc/55871 ... AB9284BB8/

Additionally why is it up there? :S

I can still load the new floor img I made for it, as well as hull images from an unpacked data so it seems strange. Even if I try to load the unedited (without STARBUG 1 on the side) image it will crash.
UltraMantis
Posts: 2141
Joined: Thu Sep 20, 2012 3:17 pm

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby UltraMantis » Thu Feb 07, 2013 7:29 am

How on Earth is the Cat Mantis?! :lol: :lol: :lol:
The only way to get him to fight is to insult his clothes. :lol:

What program did you use to add the text? Maybe the image was saved in the wrong format?
You can edit the offset to move the entire ship (rooms, floor, base image) around. I usually do this in notepad though. Here is the description of ship modding files.
Report spam using the handy Report Button Mod.
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby kartoFlane » Thu Feb 07, 2013 11:30 am

That's really really really weird. The editor should just load the image without any complaint. You should be able to just edit the image you've used, load up the project and it should automatically load the modified image, without changing anything else...
The only way that could break was if you've renamed the files around, but I wrote exceptions for that... Guess I'll need more specific information.
In the superluminal folder, find the Superluminal.bat file. Open it with any text editor and replace the second line with this:
start /b javaw.exe -cp .;Server.jar;Util.jar %1 > crash.log 2>&1 -jar superluminal_win32.jar

Save it as .bat again, double click it. Once the editor opens, try to do exactly what caused the last crash. A crash.log file should appear in the superluminal directory, paste its contents here.
Superluminal2 - a ship editor for FTL
Lord0fHam
Posts: 54
Joined: Sat Feb 02, 2013 1:10 am

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby Lord0fHam » Thu Feb 07, 2013 3:12 pm

Regarding theMac issue, here is what happened when I tried the extra argument on the command line:
iMac:superluminal_mac_x64 mike$ java -XstartOnFirstThread -jar ./superluminal_mac64.jar
java.lang.IllegalArgumentException: Argument not valid
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.graphics.GC.setForeground(Unknown Source)
at com.kartoflane.superluminal.core.Main$4.paintControl(Main.java:1723)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Control.drawWidget(Unknown Source)
at org.eclipse.swt.widgets.Canvas.drawWidget(Unknown Source)
at org.eclipse.swt.widgets.Widget.drawRect(Unknown Source)
at org.eclipse.swt.widgets.Canvas.drawRect(Unknown Source)
at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Unknown Source)
at org.eclipse.swt.widgets.Display.applicationProc(Unknown Source)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at com.kartoflane.superluminal.core.Main.open(Main.java:373)
at com.kartoflane.superluminal.core.Main.main(Main.java:260)

But, big difference: It actually tries to load it but it dies.
Image
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby kartoFlane » Thu Feb 07, 2013 4:45 pm

So the app launched, but then crashed on the first method of the drawing function:

Code: Select all

1722    c = e.display.getSystemColor(SWT.COLOR_WHITE);
1723    e.gc.setForeground(c);
1724    c.dispose();

Interestingly, it set the font properly earlier, and didn't freak out:

Code: Select all

1159    e.gc.setFont(appFont);

Exception text says that argument is invalid, so that probably means that retrieving system colors on Macs doesn't work as it is supposed to (it returns null / disposed)... Guess defining the colors via RGB will fix it. I'll correct the code for that and edit this post when I'm done.

Edit: alright, try this. Corrected the function to directly create colors from RGB, instead of trying to get system colors (which apparently caused problems when the colors were disposed). Also, it comes with the SWT library packed inside the jar, so that it should be possible to run it completely on its own.
Superluminal2 - a ship editor for FTL
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby Vhati » Thu Feb 07, 2013 8:23 pm

kartoFlane wrote:That's really really really weird. The editor should just load the image without any complaint. You should be able to just edit the image you've used, load up the project and it should automatically load the modified image, without changing anything else...
The only way that could break was if you've renamed the files around, but I wrote exceptions for that... Guess I'll need more specific information.
In the superluminal folder, find the Superluminal.bat file. Open it with any text editor and replace the second line with this:
start /b javaw.exe -cp .;Server.jar;Util.jar %1 > crash.log 2>&1 -jar superluminal_win32.jar

Save it as .bat again, double click it. Once the editor opens, try to do exactly what caused the last crash. A crash.log file should appear in the superluminal directory, paste its contents here.

start /b javaw.exe -jar superluminal_win32.jar > crash.log 2>&1


Windows' cmd.exe has goofy parsing, but there's no need to torment it. :P
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby kartoFlane » Thu Feb 07, 2013 8:31 pm

*shrugs* I found it on google, tried trimming it down a little and it stopped working, figured I'd better not mess with it :P
Superluminal2 - a ship editor for FTL
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby Vhati » Thu Feb 07, 2013 10:32 pm

kartoFlane wrote:*shrugs* I found it on google, tried trimming it down a little and it stopped working, figured I'd better not mess with it :P
start /b javaw.exe -jar superluminal_win32.jar >crash.log 2>&1

  • Commandline apps can print to two streams (stdout #1 and stderr #2).
  • In java, they're System.out.println() and System.err.println().
  • Stdout can be piped into another command (appA.exe args | appB.exe args | appC args, where appB and appC will read stdin and print something new) or redirected into a file with ">out.txt" or equivalently "1>out.txt". If it's not piped or redirected, stdout just winds up in the terminal.
  • Stderr normally goes straight to the terminal. If you have a bunch of piping going on, you want to see errors/warnings, and that stuff won't be clogging the pipeline.
  • If you want to redirect stderr to a file, you can mix it into stdout by putting 2>&1 after the command, and for some reason after the redirect. Or keep them separate and do "appA.exe args 2>err.txt". Redirecting both would be "appA.exe args 1>out.txt 2>err.txt".

  • java.exe is a commandline app. I rather like the realtime feedback, but I guess that's not a common opinion among users.
  • javaw.exe is a GUI app. It needs no terminal. That start command is just to make the script spawn the app and continue on without waiting for the app to finish, so the script's terminal dies quickly. I'm kinda surprised javaw printed anything when you redirected.

Code: Select all

C:\>start /?
Starts a separate window to run a specified program or command.
...
/B           Start application without creating a new window.
...



Back to what you copied...
start /b javaw.exe -cp .;Server.jar;Util.jar SomeClass %1 > crash.log 2>&1
  • Apps you write in java can take args. Java itself gobbles up "-jar blah" and "-cp blah" and such, then passes the rest into "public static void main(String[] args)".
  • Batch scripts can take args. They appear as variables named %1, %2, %3, ..., %9.
    %* is all the args passed to the script, even beyond 10, I think.
  • So originally someone could run "that_script.bat hello world".
    And it'd then run "javaw.exe -cp .;Server.jar;Util.jar SomeClass hello"
  • The app's main class could then do "for (String arg : args) System.out.println(arg);"
Last edited by Vhati on Sat Feb 09, 2013 2:42 am, edited 3 times in total.
MeGusta
Posts: 17
Joined: Wed Feb 06, 2013 8:52 pm

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby MeGusta » Thu Feb 07, 2013 10:33 pm

Code: Select all

Could not find main class: com.kartoflane.superluminal.core.Main Program will exit.


Whats the fix for this. :evil:
User avatar
kartoFlane
Posts: 1488
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] Yet Another FTL Ship Editor: Superluminal - u6-2-

Postby kartoFlane » Thu Feb 07, 2013 11:05 pm

If you're using Windows, have you tried running it using the .bat file? Alternatively, if you're using another OS, try to run the app from command line. The following command should work for both Mac and Linux:
javaw -jar "C/path_to/superluminal.jar"
(of course, replace the C/path_to/ with appropriate path pointing to the directory where you've unpacked the jar file)

@Vhati
Welp, I definitely should look up more on Windows' cmd.exe. So far it looks like it's going to be at least as useful as knowledge of Java itself :)
Superluminal2 - a ship editor for FTL