Fractal Softworks Forum

Starsector => Mods => Modding Resources => Topic started by: 51ppycup on March 12, 2012, 12:27:48 AM

Title: Ship Modding Tutorial Video
Post by: 51ppycup on March 12, 2012, 12:27:48 AM
Demonstrates how to mod your custom ships into the game using Redbull's fantastic tool.  It's more or less start-to-finish, with the exception of creating the .PNG file.  Hope you find it useful, and I look forward to seeing some more sweet home-brew ships  ;D

http://youtu.be/r4K7S34ShSw?hd=1
Title: Re: Ship Modding Tutorial Video
Post by: Plasmatic on March 12, 2012, 06:54:19 AM
How did you manage to get the ship_data file all lined up nicely in excel?

Mines all bunched up in the first column and looks awful..

Also, where do I go to add descriptions and such? Don't like seeing stuff with no descriptions in game..
Title: Re: Ship Modding Tutorial Video
Post by: XpanD on March 12, 2012, 08:28:32 AM
Great tutorial! It shows the general ideas behind ship modding pretty well, although it shouldn't be followed to the letter for public mods ofcourse. Really nicely done. ;)

How did you manage to get the ship_data file all lined up nicely in excel?

Mines all bunched up in the first column and looks awful..

Also, where do I go to add descriptions and such? Don't like seeing stuff with no descriptions in game..
I don't know about Excel, but in OpenOffice Calc you have to set the column separator to be a comma when opening the file, whereas the default character is a semicolon. I would imagine the fix for Excel to be in the same vein.
Title: Re: Ship Modding Tutorial Video
Post by: Plasmatic on March 12, 2012, 08:43:48 AM
Great tutorial! It shows the general ideas behind ship modding pretty well, although it shouldn't be followed to the letter for public mods ofcourse. Really nicely done. ;)

How did you manage to get the ship_data file all lined up nicely in excel?

Mines all bunched up in the first column and looks awful..

Also, where do I go to add descriptions and such? Don't like seeing stuff with no descriptions in game..
I don't know about Excel, but in OpenOffice Calc you have to set the column separator to be a comma when opening the file, whereas the default character is a semicolon. I would imagine the fix for Excel to be in the same vein.

Got it, just was a bit trickier in my version :) Microsoft likes to hide the functions you want, when you want em :P
Title: Re: Ship Modding Tutorial Video
Post by: XpanD on March 12, 2012, 08:49:35 AM
Oh, and regarding that descriptions question - you can add descriptions through a descriptions.csv file, either in your own mod directory (for public mods) or using the game's one (for private stuff). Here's the basic layout, and an example from my Positron (tagged as xpposi internally) mod:

Code
"id","type","text1","text2","text3"

"xpposi_amy","SHIP","An experimental scout fighter, aimed at quickly capturing critical mission objectives, the Amy Fighter is a testament to Positron engine technology. A single tactical laser is however all that keeps enemies at bay.",

Just paste that into a text file, then change the name to descriptions.csv and edit it in Excel. It should be in your ..\Fractal Softworks\Starfarer\mods\*modname*\Data\Strings folder if your mod actually uses the mod system.

Keep in mind this is for ships. I'm not sure if items use the same format, but the game's files or the weapons mod files should be able to tell you what to do there. ;)
Title: Re: Ship Modding Tutorial Video
Post by: Upgradecap on March 12, 2012, 08:59:34 AM
Oh, and regarding that descriptions question - you can add descriptions through a descriptions.csv file, either in your own mod directory (for public mods) or using the game's one (for private stuff). Here's the basic layout, and an example from my Positron (tagged as xpposi internally) mod:

Code
"id","type","text1","text2","text3"

"xpposi_amy","SHIP","An experimental scout fighter, aimed at quickly capturing critical mission objectives, the Amy Fighter is a testament to Positron engine technology. A single tactical laser is however all that keeps enemies at bay.",
You can use this way to set desciptions for everything. Ships, weapons and hullmods that is.

Just paste that into a text file, then change the name to descriptions.csv and edit it in Excel. It should be in your ..\Fractal Softworks\Starfarer\mods\*modname*\Data\Strings folder if your mod actually uses the mod system.

Keep in mind this is for ships. I'm not sure if items use the same format, but the game's files or the weapons mod files should be able to tell you what to do there. ;)
Title: Re: Ship Modding Tutorial Video
Post by: 51ppycup on March 12, 2012, 10:00:04 AM
Thanks for the tip on adding in descriptions, Ill have to do that!
Title: Re: Ship Modding Tutorial Video
Post by: Plasmatic on March 12, 2012, 10:12:26 AM
Noticing something very strange when i try to separate this stuff in excel..

when i save it seperated i just get an error: Fatal: JSONObject["id"] not found.

so I guess it can't find the values if i save it separated..

How did you manage it 51ppycup?
Title: Re: Ship Modding Tutorial Video
Post by: XpanD on March 12, 2012, 10:16:16 AM
You should not have to separate values manually, Excel should be able to do it for you when you load the file (though I'm not sure how to set that). For example, when I run a .csv through OpenOffice Calc with the right settings it opens with all the column stuff working nicely right away. The ID error is probably caused by Excel appending some sort of new values to the file, and having the file automatically loaded as it should be loaded should help avoid that.
Title: Re: Ship Modding Tutorial Video
Post by: Reshy on March 12, 2012, 10:16:25 AM
I've had problems with the tool.  Sometimes the .ship formatting doesn't work, it also requires you to manually add the ship_data.csv and the variant system doesn't work pretty much at all.
Title: Re: Ship Modding Tutorial Video
Post by: 51ppycup on March 12, 2012, 10:41:02 AM
Noticing something very strange when i try to separate this stuff in excel..

when i save it seperated i just get an error: Fatal: JSONObject["id"] not found.

so I guess it can't find the values if i save it separated..

How did you manage it 51ppycup?

I haven't run into that issue myself.  I've been using MS Excel 2003 (I think, could be '07).  As far as the variant system is concerned, I haven't played with it.
Title: Re: Ship Modding Tutorial Video
Post by: XpanD on March 12, 2012, 10:55:35 AM
I've had problems with the tool.  Sometimes the .ship formatting doesn't work, it also requires you to manually add the ship_data.csv and the variant system doesn't work pretty much at all.

The variant part of Redbull's editor has worked great for me so far. It does take a bit of getting used to, though. Having to CTRL-click several weapons into a group at once, for example, is a trick that's pretty easy to miss.
Title: Re: Ship Modding Tutorial Video
Post by: Plasmatic on March 12, 2012, 11:13:49 AM
I use Excel 2010 but I can't find the option to set it to open with comma separation.. i gotta seperate it manually when i open it..

Every which way I try I can't seem to get it to work.. I guess I need to get Open office..

EDIT: maybe I can do this in Notepad++? anybody have any idea how?
Title: Re: Ship Modding Tutorial Video
Post by: Trylobot on March 12, 2012, 11:19:30 AM
I've been using redbull's editor to save both .ship and .variant files with no problems. Then again, I made mods before any tools were available so I already know what needs to go where; and, I do end up hand-editing for little tweaks or easy modifications.

The real win with the ship editor is the ability to define coordinates for bounds, engines and hardpoints. Those tasks were the most time-consuming and error-prone before.
Title: Re: Ship Modding Tutorial Video
Post by: XpanD on March 12, 2012, 11:31:38 AM
I use Excel 2010 but I can't find the option to set it to open with comma separation.. i gotta seperate it manually when i open it..

Every which way I try I can't seem to get it to work.. I guess I need to get Open office..

EDIT: maybe I can do this in Notepad++? anybody have any idea how?

Notepad++ is what I used before I saw this video and saw how easy using an Office application would be. I wouldn't want to go back, now. Maybe install OpenOffice Calc only (and not all the other parts), just for modding? Or wait for 51ppycup to give you the fix. :P
Title: Re: Ship Modding Tutorial Video
Post by: icepick37 on March 12, 2012, 11:39:10 AM
I've been using redbull's editor to save both .ship and .variant files with no problems. Then again, I made mods before any tools were available so I already know what needs to go where; and, I do end up hand-editing for little tweaks or easy modifications.

The real win with the ship editor is the ability to define coordinates for bounds, engines and hardpoints. Those tasks were the most time-consuming and error-prone before.
Really? Measure tool in gimp is awesome for that. I find all the coordinates that way. Clicking on the sprite is too niggly and imprecise.
Title: Re: Ship Modding Tutorial Video
Post by: Plasmatic on March 12, 2012, 11:39:52 AM
I managed to fix it.. Searched on the internet for a solution and it turns out its CSV's are racist :P

I live in Europe, more specifically Sweden, and we use a comma as the decimal sign, and the ; thingy as a separator. thats what messes up with excel, it uses the computers settings when determining what to separate with..

Fixed it by changing computer to use . for decimals and , for separator.

I just gotta be careful when I want to write decimals and what not to use the . now :P

Now when i open the csv is excel it opens all nice and separated.

best of all though is the fact that Starfarer doesn't crash horribly when I start it :P
Title: Re: Ship Modding Tutorial Video
Post by: 51ppycup on March 12, 2012, 11:40:36 AM
I'd say just grab OpenOffice.  It's 100% free and open source.  Make sure you get it from a legit site though (like SourceForge), and be careful not to install any advertiser products that may come "conveniently" bundled with it.  ;)

EDIT: Yay, you fixed it :D
Title: Re: Ship Modding Tutorial Video
Post by: Plasmatic on March 13, 2012, 07:52:57 AM
I'd say just grab OpenOffice.  It's 100% free and open source.  Make sure you get it from a legit site though (like SourceForge), and be careful not to install any advertiser products that may come "conveniently" bundled with it.  ;)

EDIT: Yay, you fixed it :D

Your not out of the water yet mister :P

Now you need to put up a video tutorial of how to get the ships in game, (and not just hack it into an existing campaign) I mean so the AI fleets uses it too!

EDIT: I took it upon myself to make the .ship files for the ships, one Energy based and one Ballistic Based. Please note, I did not include any missile launchers.
I cannot say how balanced they are compared to other cruisers, but I did make their stats based on other vanilla cruisers.

Took quite some time to get the bounds right.. since I'm a bit of the perfectionist I did it by hand in the .ship file.. just using the ship editor to get the approximate coordinates, but I can happily say, both sides of the ship are identical as far as bounds go.

The turrets on the other hand, don't seem to be quite mirrored, they are off by 1 pixel sideways. but I matched them to the .png so I blame 51ppycup :)

http://www.mediafire.com/?2z2rr9dq0jjp3k9 both in one mod

And

http://www.mediafire.com/?8zgd239c78m3n7p seperate mods

Also note, this does nothing to add them into the campaign as I do not know how to do that other than hacking a save file. (which is shown in the tutorial video)

EDIT Seems I made an error in the -ship files, will reupload asap.

EDIT 2: Fixed, Please note I have not had a chance to actually test these at all.