Fractal Softworks Forum

Starsector => Mods => Modding Resources => Topic started by: Vayra on January 11, 2019, 12:08:03 PM

Title: [TUTORIAL] Intro to modding for complete beginners
Post by: Vayra on January 11, 2019, 12:08:03 PM
(https://i.imgur.com/KEOhW1a.png) (http://starsector.wikia.com/wiki/Intro_to_Modding)

Hey everybody, I've started working on this tutorial on Starsector modding for complete beginners (http://starsector.wikia.com/wiki/Intro_to_Modding), hosted over on the unofficial Starsector wiki. Right now it's just a comprehensive tutorial on creating a custom ship, but I plan to expand it greatly over time. Thought it might be of use to some people. :)
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Thaago on January 11, 2019, 12:50:38 PM
This is absolutely fantastic! Thank you for doing it and I hope you keep going. :)

[Edit] In the 'ship editor' section I recommend adding a link to the ship editor, as its an external piece of software and there are a couple different, more and less up to date programs floating around the forum.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Gotcha! on January 11, 2019, 01:31:06 PM
It is appreciated! Thank you. :)
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Vayra on January 12, 2019, 01:22:44 AM
This is absolutely fantastic! Thank you for doing it and I hope you keep going. :)

[Edit] In the 'ship editor' section I recommend adding a link to the ship editor, as its an external piece of software and there are a couple different, more and less up to date programs floating around the forum.

There's a link in the very beginning where I go over what you'll need, but fair enough -- I've added another link in the section itself.  :)
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Cyan Leader on January 12, 2019, 03:28:50 AM
I'd really appreciate a complete and detailed video on compiling the game/a mod.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Thyrork on January 30, 2019, 12:56:53 AM
Oh boy! This is going to be so damned useful when I sit down to try to dig into the guts of SS. Thank you!
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Toranet on February 02, 2019, 03:39:51 PM
Hey there, I have dived into modding star systems and markets a bit and made my own small mod on those so I might as well add what I dug to your tutorial? It wont be full but it will let you make your own star systems, write the planets in the system yourself or make planet generating script for it and add whatever market conditions you want to the planets you make.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Vayra on February 02, 2019, 10:23:34 PM
Hey there, I have dived into modding star systems and markets a bit and made my own small mod on those so I might as well add what I dug to your tutorial? It wont be full but it will let you make your own star systems, write the planets in the system yourself or make planet generating script for it and add whatever market conditions you want to the planets you make.

For sure! There's already a section for it, just please make sure it's as well screenshotted/explained.  :)

Or if you want, make a new page for it and I can link to it?
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Toranet on February 03, 2019, 02:58:19 AM
I have added my small tutorial to your page, it has a link to a video made by WadeStar I learned from and then my own additions that cover what I struggled with and point out what you have to be carefull with. There are also several extra things that were not mentioned in tutorial such as where you can find the list of all market conditions. I have added it only to System creation, adding markets to planets in said system too due to it doesnt say how to mod market conditions but only how to add them to your planets.
I currently have issues on wiki with making full size pictures, I can add screenshots but they are automaticly transformed into very low resolution versions, how do I make them beter resolution?
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Vayra on August 13, 2019, 09:43:07 PM
Bump, because guess who has two thumbs and just finished adding a complete tutorial on adding custom weapons to the game on the Intro to Modding (https://starsector.wikia.com/wiki/Intro_to_Modding) page?

This gal.  8)
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: WKOB on August 27, 2019, 02:08:47 AM
Nice, this is cool to see with the community's ebb and flow, it's good for knowledge to have somewhere to go that can be easily referenced. I'm not really new at this, but it's helpful even to me as kind of a checklist as I remember how everything works.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Ed on August 29, 2019, 06:55:13 PM
Nice guide, i think i will start making my own ships seeing it is not too complicated, but i want to make custom hullmods and systems too, is there a tutorial for those yet?
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Crimson Sky Gaurdian on September 20, 2019, 04:43:49 AM
Either I'm misunderstanding what 8 bit per channel means, or that's an error, as 8-bit depth results in a ship that just doesn't display for me (whereas 32 does).
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Kal on September 21, 2019, 10:19:55 PM
I found this tutorial really helpful and it made modding seem a lot more approachable to me. Massive kudos for working on this!

The only problems I ran into turned out to be related to me trying to use the incorrect version of the ship and weapon editor, and those respective threads cleared up the issue. It was a very nice way to get started and I really appreciate including the links to kit-bashing and art tutorials as well.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: connortron7 on September 30, 2019, 10:54:59 AM
I found this tutorial really helpful and it made modding seem a lot more approachable to me. Massive kudos for working on this!

The only problems I ran into turned out to be related to me trying to use the incorrect version of the ship and weapon editor, and those respective threads cleared up the issue. It was a very nice way to get started and I really appreciate including the links to kit-bashing and art tutorials as well.

Same here! I literally never did any code work in my life but always wanted to mod ss, thanks to this i was able to with some trial and error but nonetheless this was great! Im already underway with the sprite work on my 3rd ship.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Vayra on October 01, 2019, 12:07:56 PM
Either I'm misunderstanding what 8 bit per channel means, or that's an error, as 8-bit depth results in a ship that just doesn't display for me (whereas 32 does).

8 per channel is 32! R + G + B + A. :) (unless I'm misunderstanding you now...)

I'm glad people are using and enjoying the tutorial - maybe I'll add a third section soon!
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Crimson Sky Gaurdian on October 02, 2019, 04:35:05 AM
Either I'm misunderstanding what 8 bit per channel means, or that's an error, as 8-bit depth results in a ship that just doesn't display for me (whereas 32 does).

8 per channel is 32! R + G + B + A. :) (unless I'm misunderstanding you now...)

I'm glad people are using and enjoying the tutorial - maybe I'll add a third section soon!
Ah! Well, until this I didn't know what a channel even was, so I guessed :P

Something on (adding new) hull mods would be amazing!
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Ed on October 02, 2019, 05:28:02 AM
Vayra i think one of the things you could explain next would be when a modder actually need an IDE to compile stuff into a jar and how to do so, this seem to be the main question people get after making a simple ship/weapon
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: wombatz on October 04, 2019, 12:57:05 PM
Thanks for the tutorial, it was clear and easy to follow.
Tried it out but when launching the game, it crashes and tells me Fatal: JSONObject["id"] not found.
I searched around but coulndn't find anything usefull. Do you have any clue about what I did wrong?

Log says
9935 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - org.json.JSONException: JSONObject["id"] not found.
org.json.JSONException: JSONObject["id"] not found.
   at org.json.JSONObject.get(JSONObject.java:406)
   at org.json.JSONObject.getString(JSONObject.java:577)
   at com.fs.starfarer.loading.LoadingUtils.o00000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.ö00000(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.ÒO0000(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

First time modder here, so the log isn't much help for me.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: outdated on October 04, 2019, 02:09:21 PM
JSONObject["id"]

Double check your mod_info.json file.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: wombatz on October 05, 2019, 05:03:30 AM
I did, hullid and name where all correct.
I redid the tutorial step by step and found the error, I somehow messed up the description. Deleting the strings folder solved the issue.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: gmansawesome on October 15, 2019, 10:32:02 PM
Hi, I started playing starsector after watching Seth's video and I want to make some personal adjustments for my game. My favorite ships are carriers, and I feel like it would be much cooler if there were more LPC slots. Is there any way to edit Vanilla carriers to add more LPC slots?
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: gmansawesome on October 15, 2019, 10:34:31 PM
Adding to my previous comment.

Would a new ship data file of a modified vanilla ship automatically override the core vanilla ship file in-game?
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Ed on October 16, 2019, 02:34:36 PM
Adding to my previous comment.

Would a new ship data file of a modified vanilla ship automatically override the core vanilla ship file in-game?

If you want to modify just your game you can modify the ship_data file in the base game, but if you want to make a mod i recommend not changing vanilla ships and making your own for compatibility reasons.
Also use this thread for this kind of question.
http://fractalsoftworks.com/forum/index.php?topic=5061.5400
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: KnightOfTigers on October 25, 2019, 05:35:35 AM
Hello there, I'm also new to modding around here. The tutorial is really well made, however I'm having an issue. As of now I'm focusing on adding some ships but I'm stuck with my first one. I've followed each step to make my ship functionnal but when loading the game, I get this error :

Code
5921 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NumberFormatException: For input string: "
"
java.lang.NumberFormatException: For input string: "
"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.fs.starfarer.loading.ShipHullSpecLoader.o00000(Unknown Source)
at com.fs.starfarer.loading.ShipHullSpecLoader.Ò00000(Unknown Source)
at com.fs.starfarer.loading.SpecStore.ÒO0000(Unknown Source)
at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Usually logs can help me but this time it's a bit hard for me to get something useful out of this error. I've double checked every file I've made but I don't see anything suspicious. I just made an extra step which consists of adding a built-in weapon to my ship.

Sorry for my bad English, I'm trying my best to make it understandable because I'm French.

If needed, you can find my "mod" attached to my post.

Thanks for any eventual help!

[attachment deleted by admin]
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: creature on October 25, 2019, 06:37:21 AM
Hello there...
Hey, I checked your ship data files. Check inside your file, "galaxytigers_midtech2x_cv.ship". I noticed this out of place line in there:

 "coversColor": "\r",

the \r can sometimes be added by the Ship and Weapon editor, iirc. Try removing it and see if it works then.

 "coversColor": "",

Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: KnightOfTigers on October 25, 2019, 07:04:32 AM
Hello there...
Hey, I checked your ship data files. Check inside your file, "galaxytigers_midtech2x_cv.ship". I noticed this out of place line in there:

 "coversColor": "\r",

the \r can sometimes be added by the Ship and Weapon editor, iirc. Try removing it and see if it works then.

 "coversColor": "",

Thanks a lot for your answer! When you mentionned the "galaxytigers_midtech2x_cv.ship" file I immediatly saw that it was a mistake I've made because the other ship file ("galaxytigers_heron.ship") is the file I want to keep. I deleted the wrong one (I've checked the line before doing so and I saw the famous \r) and tried to load my mod, and now it works!

Thank you again! If I get this error again when adding other ships then I'll know where it comes from!

I've got another question even though it is not topic related. Do you know where I could get the weapon mounts pictures? I guess you know what I mean, those "holes" we see when no weapons are equiped. I wasn't able to find them anywhere in the core files nor on the Internet. Must I "extract" them from ship pictures?
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: creature on October 25, 2019, 02:06:10 PM
Hello there...
Hey, I checked your ship data files. Check inside your file, "galaxytigers_midtech2x_cv.ship". I noticed this out of place line in there:

 "coversColor": "\r",

the \r can sometimes be added by the Ship and Weapon editor, iirc. Try removing it and see if it works then.

 "coversColor": "",
I've got another question even though it is not topic related. Do you know where I could get the weapon mounts pictures? I guess you know what I mean, those "holes" we see when no weapons are equiped. I wasn't able to find them anywhere in the core files nor on the Internet. Must I "extract" them from ship pictures?
Hey again! You can definitely do that, but Tartiflette already has a collection here at the bottom of the Kitbash Database, if you want to speed things up a bit.
https://fractalsoftworks.com/forum/index.php?topic=9320.0
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: KnightOfTigers on October 26, 2019, 01:30:10 AM
Oh my I feel so stupid ;D Anyways thanks again for your help!
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Vayra on January 23, 2020, 12:41:27 AM
Minor update, but I finished the blueprint section: https://starsector.fandom.com/wiki/Intro_to_Modding#Custom_Blueprint_and_Manufacturer.2FTech_Type
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Bhdeale on March 27, 2020, 09:22:59 AM
Hey there! I wanted to help out and it was a good chance to see what I could learn so I added a section about adding star systems. I only covered the programmatic generation for now, haven't made one using just csvs/config yet.
Let me know if there's anything I need to fix/move/change.
I really appreciate the effort you've put into making a tutorial! It has been a lot of reverse-engineering to make anything so far :D
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Stuffwriter on April 10, 2020, 10:16:38 PM
I've found this tutorial to be extremely helpful, but I've run into an impasse!

The ship editor appears to be unable to load or access the excel file with all my ship data.

It keeps saying it's a windows exception and then the program crashes.

EXCEPTION_ACCESS_VIOLATION

Any idea what might be causing that?
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Bhdeale on April 13, 2020, 02:17:09 PM
I'm no windows genius or anything, but you may be running into a permissions problem or file lock problem.

You could try running the ship editor program with elevated privileges (you might want to make a backup of your ship data file just in case)
Right click on the executable -> Run As Administrator

You could see if another program has locked the file (programs do this when they want to exclusively use a file sometimes) by closing other programs or just restarting your computer.

You may also need to check the file is editable, go to your ship_data and right click -> Properties -> Uncheck the "Read-only" box

Hope any of this helps :)
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Stuffwriter on April 13, 2020, 04:41:08 PM
Unfortunately, I had already tried all these fixes before posting this.

This one's a real headscratcher. I was excited about making a mod, but I can't get any further than this.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Harmful Mechanic on April 13, 2020, 05:25:19 PM
As I recall, the editor has never handled the ship_data.csv and weapon_data.csv files well. You may as well grab a standalone editor anyway; there's enough Starsector stuff in .csv files that the ship editor doesn't open, you'll need it at some point.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Stuffwriter on April 13, 2020, 09:44:10 PM
Can you recommend something?
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Harmful Mechanic on April 13, 2020, 10:02:01 PM
I'm on a Mac; I use CSVEdit. I've heard good things about Ron's Editor, Google Sheets, and CSVEd. Try a few and stick with what you like.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Thaago on April 14, 2020, 12:20:08 AM
On windows here: I use excel for the csv files, though you may need to tweak settings to make it work (mine worked standard, but non-US number/demarkation formats will be wrong: commas must be for separating values, not as part of a number).

I've had the same issue with the editor: over the years features have gotten less reliable, which is a real pity. Its still the best tool for setting ship bounds, engine/weapon locations etc though.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: AxleMC131 on April 14, 2020, 12:33:08 AM
The other CSV (spreadsheet) editor I'd recommend is LibreOffice, which is what I use. It's free to use and, as far as I know, cross-compatible.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Stuffwriter on April 14, 2020, 10:09:16 AM
I finally managed to diagnose the problem...

I had my folders arranged incorrectly and an errant capital letter was confusing the game. Modding is hard, apparently.

I've got it working now.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Stuffwriter on April 14, 2020, 04:03:25 PM
Quick question: How do you modify how many flux vents and capacitors you can put on a ship? I can't find the stat in the .csv
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: SafariJohn on April 14, 2020, 04:20:39 PM
Those two stats are based on ship size. 10-20-30-50 IIRC. They can be modified, though, e.g. the Loadout Design skill.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Neuromute on April 18, 2020, 10:39:25 PM
I followed the instructions for making a weapon (I'm trying to make a large beam weapon) and no matter what I do it won't show up in the game.

When I use console commands to examine it, it always says added weapons: none.

I've scoured the internet for other weapon making guides or examples but nothing works. Even when I try copying over weapons from other mods they don't show up.

I've made some mods that add ships before, and some that add systems, and they work perfectly.

I don't know what I'm doing wrong. Help?
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: AxleMC131 on April 18, 2020, 11:57:35 PM
(You definitely enabled the mod in the launcher?  ;) )

Post a download for the mod here and I'll take a look.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Neuromute on April 19, 2020, 08:10:48 AM
I'd have to learn how to make something downloadable. At this point it was just a re-skinned high intensity laser anyway, I was trying to get anything to work and then alter from there.

Could you link a mod that just adds a single weapon? That way I can alter something that already works.
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: SafariJohn on April 19, 2020, 09:00:04 AM
Rebalanced Pilums mod only modifies one weapon: https://fractalsoftworks.com/forum/index.php?topic=10598.0
Title: Re: [TUTORIAL] Intro to modding for complete beginners
Post by: Neuromute on April 20, 2020, 12:03:13 AM
Editing rebalanced pilums worked! I still have no idea what I was doing wrong, but it works now so I guess it doesn't matter.

Thanks!