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

Discuss and distribute tools and methods for modding. Moderator - Grognak
User avatar
kartoFlane
Posts: 1479
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby kartoFlane » Sun Feb 24, 2013 11:43 am

@President Larry
What do you mean it doesn't work with GMM? The manager crashes, or the game?
edit: this could be the same as electricz0ltan's problem right above your post, just check the "don't check if already present" box when exporting, should fix it.

As for directories, you're just loading them wrong; you have to point the editor to the exact folder that contains the blueprints and autoBlueprints files.
I guess that now I really have to write some sort of guide.

@Weltall Zero
You're raising very good points. I have been planning to change it, so that a window pops up at the start of the program, asking to point it to directories, should they seem to be missing, so that you can't omit that step. Or perhaps automatically scanning to find the correct folder... Or just loading data straight from the .dat archives (though I'd need to get some understanding of their structure first)

I've stumbled upon the Preferences class several times during my voyages with google, though I never gave it much thought... I suppose it's worth to take a look, though it's a farily low priority with all those bugs around.

As for NPE's, yeah, I mostly end up not catching them and instead creating a lot of != null if-checks. Though I guess you're right, catching the exceptions allows to easily identify the error, print out relevant message - without crashing the app.
Old habits die hard.

And you're not being rude - I'm not exactly the most experienced programmer out there, so any and every piece of advice is precious and really appreciated :P

As for your problem, that's simply image dimension issue - the floor image has to have the exact same dimensions as the hull image, and the cloak image has to be 20px wider and higher (that's how FTL is programmed). Take a look at default images, guess it'll be easier to understand that way, rather than me attempting to describe it.
Last edited by kartoFlane on Sun Feb 24, 2013 5:59 pm, edited 1 time in total.
Superluminal2 - a ship editor for FTL
Weltall Zero
Posts: 37
Joined: Tue Dec 25, 2012 2:13 pm

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby Weltall Zero » Sun Feb 24, 2013 1:17 pm

kartoFlane wrote:@Weltall Zero
You're raising very good points. I have been planning to change it, so that a window pops up at the start of the program, asking to point it to directories, should they seem to be missing, so that you can't omit that step. Or perhaps automatically scanning to find the correct folder... Or just loading data straight from the .dat archives (though I'd need to get some understanding of their structure first)

I think the first would be just perfect, actually. Also the easiest to implement for you.

kartoFlane wrote:I've stumbled upon the Preferences class several times during my voyages with google, though I never gave it much thought... I suppose it's worth to take a look, though it's a farily low priority with all those bugs around.

Preferences is extremely easy to use, actually, but the documentation seems awful. :/ If I have the time I might actually code the relevant part for your application and post it here (too lazy to install Git on this computer to make a patch :D).

kartoFlane wrote:As for NPE's, yeah, I mostly end up not catching them and instead creating a lot of != null if-checks. Though I guess you're right, catching the exceptions allows to easily identify the error, print out relevant message - without crashing the app.
Old habits die hard.


Coming from C/C++? That's me like 3 years ago (I had been coding exclusively on C++ for about 10 years). :D

kartoFlane wrote:And you're not being rude - I'm not exactly the most experienced programmer out there, so any and every piece of advice is precious and really appreciated :P

Glad to hear that! :)

kartoFlane wrote:As for your problem, that's simply image dimension issue - the floor image has to have the exact same dimensions as the hull image, and the cloak image has to be 20px wider and higher (that's how FTL is programmed). Take a look at default images, guess it'll be easier to understand that way, rather than me attempting to describe it.

Your explanation was absolutely perfect, actually; adding 10 pixels on top/bottom/left/right, so that it's 20 pixels bigger on each dimension, fixed it. :)

I also figured out my problem with the floor layout; I was convinced my floor image was the same size as my hull image, but it was actually smaller for some reason.

By the way, I'll share the way I make floor images, in case anyone finds it useful. What I do is take a screenshot of the room layout, then open it on an image editor (Gimp or Photoshop), select the outside, invert selection, grow by five pixels, fill with black, then contract by two and fill with grey. This makes an image that's almost a perfect match to the ones used by default ships.

Thanks a lot for your prompt and extremelly useful replies, BTW! :)
User avatar
kartoFlane
Posts: 1479
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby kartoFlane » Sun Feb 24, 2013 1:53 pm

Weltall Zero wrote:Coming from C/C++? That's me like 3 years ago (I had been coding exclusively on C++ for about 10 years). :D

Not exactly C per se - a few years ago I've really been into Warcraft 3 modding, creating maps and stuff - and for modding purposes Blizzard had created an event-driven scripting language, Jass, that was loosely based on C (from what I could gather; no objects, manual memory management, etc).
I stuck in there for about 2 or 3 years, and that's where I picked up most of my practices :)

And glad the image issues have been resolved, I was afraid that I'd have yet another bug to fix :D
Last edited by kartoFlane on Tue Feb 26, 2013 12:12 pm, edited 1 time in total.
Superluminal2 - a ship editor for FTL
speedoflight
Posts: 660
Joined: Mon Feb 18, 2013 11:08 am

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby speedoflight » Sun Feb 24, 2013 6:08 pm

Weltall Zero wrote:
By the way, I'll share the way I make floor images, in case anyone finds it useful. What I do is take a screenshot of the room layout, then open it on an image editor (Gimp or Photoshop), select the outside, invert selection, grow by five pixels, fill with black, then contract by two and fill with grey. This makes an image that's almost a perfect match to the ones used by default ships.

Thanks a lot for your prompt and extremelly useful replies, BTW! :)


Lol, thats exactly the method im using, im glad someone else had the idea (im using gimp). Except for the layouts that comes with holes in the middle, that needs a bit more work.

Anyways, kartoFlane, GREAT UPDATE!!, even if i am not ready for gibs, it will be really useful in the future. I hope in a few days i can share my work with the community, once i resolve the weapon graphics and audio issues im having (really giving me a real headache btw).

I really im glad of the effort ure putting on this proyect, since this editor seems to be the only one that works almost for everyone, even if it have some bugs (that will only be fixed with time, like any proyect), its maybe the best editor so far, and seeing that u are pointed to improve it in future updates, its worthy all the support u can get from the community.

Good job!.
My currently mods / wips ->
ImageImage
Vhati
Posts: 792
Joined: Thu Oct 25, 2012 12:01 pm

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby Vhati » Sun Feb 24, 2013 6:42 pm

kartoFlane wrote:@Weltall Zero
You're raising very good points. I have been planning to change it, so that a window pops up at the start of the program, asking to point it to directories, should they seem to be missing, so that you can't omit that step. Or perhaps automatically scanning to find the correct folder... Or just loading data straight from the .dat archives (though I'd need to get some understanding of their structure first)
Here are parts of the Profile/SavedGame editor for reference...

This is what I'm using to find FTL's resource folder.
Source: GitHub - FTLProfileEditor.java

This class maps regions of a dat read-only as if they were individual files.
Plus methods to repair typoed xml before feeding a genuine xml parser.
Source: GitHub - MappedDatParser.java

Code: Select all

Example usage:
MappedDatParser resourceParser = new MappedDatParser( new File(datsFolder, "resource.dat") );
...
InputStream kestrelStream = resourceParser.getInputStream( "img/ship/kestral_base.png" );
BufferedImage kestrelImage = ImageIO.read( kestrelStream );
kestrelStream.close();
...
InputStream rockStream = resourceParser.getInputStream( "img/ship/rock_cruiser_base.png" );
BufferedImage rockImage = ImageIO.read( rockStream );
rockStream.close();
...
resourceParser.close();


* I may have painted myself into a corner such that I wouldn't be able to add dat writing without closing the mapper, making changes, and instantiating a new one.
Weltall Zero
Posts: 37
Joined: Tue Dec 25, 2012 2:13 pm

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby Weltall Zero » Sun Feb 24, 2013 9:38 pm

speedoflight wrote:
Weltall Zero wrote:
By the way, I'll share the way I make floor images, in case anyone finds it useful. What I do is take a screenshot of the room layout, then open it on an image editor (Gimp or Photoshop), select the outside, invert selection, grow by five pixels, fill with black, then contract by two and fill with grey. This makes an image that's almost a perfect match to the ones used by default ships.

Thanks a lot for your prompt and extremelly useful replies, BTW! :)


Lol, thats exactly the method im using, im glad someone else had the idea (im using gimp). Except for the layouts that comes with holes in the middle, that needs a bit more work.


Huh? Isn't that the same, only when selecting "the outside", you just include the holes too? Should be a simple matter of shift-clicking them with the "magic wand" tool.

By the way, to make them perfectly FTL compliant, you want to delete most of the rooms that are airlocks, or at least their exterior walls, before going on with the procedure. That way, your airlock doors will indent in, not out. Like this:
Image
Note however that the white, single-pixel lines above doors on top and to the left are unavoidable, as this seems to be a minor bug with FTL itself (the other ships have them too). It seems to be a bit of the room extending past the door.
speedoflight
Posts: 660
Joined: Mon Feb 18, 2013 11:08 am

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby speedoflight » Sun Feb 24, 2013 9:48 pm

Yeah u completely right about airlocks (and actually i didnt think in that), but that is one of the multiple things i will improve once i get my mod working 100%. Then will be the time to improve every detail. Its no sense to work in those details when u cant even get your own mod working lol. In fact, once i check my mod works, i will re-done the entire floor, cloak and shield graphics.
My currently mods / wips ->
ImageImage
President Larry
Posts: 21
Joined: Sun Jan 20, 2013 6:40 am

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby President Larry » Sun Feb 24, 2013 11:45 pm

kartoFlane wrote:@President Larry
What do you mean it doesn't work with GMM? The manager crashes, or the game?
edit: this could be the same as electricz0ltan's problem right above your post, just check the "don't check if already present" box when exporting, should fix it.


the game crashes
Subzero2
Posts: 4
Joined: Fri Feb 22, 2013 10:10 pm

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby Subzero2 » Mon Feb 25, 2013 5:09 am

this may be a nooby question but can you add custom weapons if you added new weapons into the resources folder?
User avatar
kartoFlane
Posts: 1479
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Tool] FTL Ship Editor: Superluminal - b23-2-13

Postby kartoFlane » Mon Feb 25, 2013 11:33 am

Yes; you have to add all resources used by the weapon to the resources location, and in the data location you have to modify blueprints.xml and animations.xml so that they include your custom weapon.

edit...
@Vhati
Thanks, I'll look into the profile editor. As for dat parser, I have already changed the editor to unpack the archives by itself (using the lib KuroSaru released), only requiring user to point it to data.dat and resource.dat files... But reading all of the data straight from archives seems like a better idea. Guess I'll do it sometime in the future.

@President Larry
Do as I told electricz0ltan then, export your ship with "don't check if already present" box checked.
I'm fixing the bug you're both having for next update
Superluminal2 - a ship editor for FTL

Who is online

Users browsing this forum: No registered users and 11 guests