Fractal Softworks Forum

Starsector => Mods => Documentation => Topic started by: Alex on November 18, 2012, 03:04:21 PM

Title: Readme & Feedback
Post by: Alex on November 18, 2012, 03:04:21 PM
This board contains the official modding documentation.

I'll be adding to it over time (likely very gradually). The documentation found here will be more technical, not going to the step-by-step level of some of the guides found in the Modding Resources (http://fractalsoftworks.com/forum/index.php?board=9.0) forum.

The posts with the actual documentation will be locked, in the interest of keeping things neat and tidy. If you spot an error or have a comment, please post in this thread.
Title: Re: Readme & Feedback
Post by: silentstormpt on November 19, 2012, 05:20:45 AM
You can leave this to us, unless we're missing something, for that please "reply what's missing"/"correct what's wrong".
Title: Re: Readme & Feedback
Post by: Alex on November 19, 2012, 09:01:42 AM
The point of this is there are things you'd never know about in the first place, unless I mention them somewhere. There are also things I've told one or two people because they asked about them via PM, but hadn't gotten around more broadly than that. This forum is already a great source of information for modding, but I think an official reference would be useful to augment what's already here. Like I said, though, it's likely to grow very gradually.
Title: Re: Readme & Feedback
Post by: TheHappyFace on November 19, 2012, 10:14:55 PM
+1 for this great idea.
Would make it a lot more easy for people like me.  ;D
Title: Re: Readme & Feedback
Post by: Hyph_K31 on November 20, 2012, 09:01:46 AM
+? from me.

I literally can't wait for more information :)
Title: Re: Readme & Feedback
Post by: Piroton on November 21, 2012, 06:56:39 PM
Awesome!

I was afraid to mod Starfarer because I'm hopeless at java and scripting, so any documentation would be greatly appreciated!

+1
Title: Re: Readme & Feedback
Post by: Cycerin on November 25, 2012, 07:23:04 PM
This is great and you're great.
Title: Re: Readme & Feedback
Post by: Alex on December 07, 2012, 10:04:50 PM
Because I'm, um, so great (thanks, by the way :)), added a new section - this one with details on the mod structure (http://fractalsoftworks.com/forum/index.php?topic=5016.0), and specifically on how the game decides what files to merge, and how. I think there may be some surprises there. Hopefully good ones. Please let me know if you think I missed something.
Title: Re: Readme & Feedback
Post by: LazyWizard on December 08, 2012, 06:13:23 PM
For the Mod Structure & File Merging thread, what about the behavior of class files in a jar and identically-named java files outside of it?
Title: Re: Readme & Feedback
Post by: Alex on December 08, 2012, 08:10:04 PM
Good call - added to the mod_info.json thread, though, in the jar file section. (The answer is it'll prefer stuff from a jar, btw.)
Title: Re: Readme & Feedback
Post by: xenoargh on March 19, 2016, 10:37:17 AM
I would really like to understand how CSV merging prioritizes what gets to modify.  If two mods attempt to change X line, which one gets priority, and why?  It doesn't appear to be load-order and using Replace means I'll be breaking things (or get overridden by further mods), so what's the mechanism?

On a related note, it'd be nice if mod load order was able to be explicitly dealt with; right now, it feels like it's a hodge-podge of rulesets covering things that modify core files, things that add new code, etc., and it'd be nice to have some control, so that mods that mod mods can be a thing.
Title: Re: Readme & Feedback
Post by: Alex on March 19, 2016, 10:51:58 AM
Pretty sure it *is* load order, with the first mod to do it taking priority. Don't remember what the reason was for doing that instead of letting the last mod do it; probably wasn't an accident though. In any case, I'd consider mods trying to change the same thing to be incompatible. (This probably belongs as a question in the modding subforum, though, perhaps even in the misc questions thread.)
Title: Re: Readme & Feedback
Post by: xenoargh on March 19, 2016, 11:06:11 AM
<tests> OK, so the first mod to change a key in CSVs wins the fight, based on the mod's name, which determines the load order.  Does this also apply to modifications of other core files (i.e., hull and proj, etc.?)
Title: Re: Readme & Feedback
Post by: Alex on March 20, 2016, 01:00:32 PM
*Fairly* sure it's the opposite for .json files, with the last one winning. Might clean that up at some point (if anything, it seems like the last one should always win? But not sure why the csv loader is specifically coded against that; don't think I'd do that for no reason).
Title: Re: Readme & Feedback
Post by: xenoargh on March 23, 2016, 02:04:56 PM
It'd be nice if it was consistent, too, so that if you want to do both, you don't have to release two mods ;)
Title: Re: Readme & Feedback
Post by: Alemismun on August 07, 2019, 02:34:52 PM
Im new to the forums... Where do modding questions go?
Title: Re: Readme & Feedback
Post by: Alex on August 07, 2019, 02:36:42 PM
Hi - welcome! The Modding forum, or this thread (http://fractalsoftworks.com/forum/index.php?topic=5061.0) if it's a shorter question.
Title: Re: Readme & Feedback
Post by: Curator on April 13, 2021, 10:54:23 AM
Hey!
There's no information (or I didn't find any) about replacing Vanilla classes.
Title: Re: Readme & Feedback
Post by: Histidine on April 14, 2021, 01:42:33 AM
Hey!
There's no information (or I didn't find any) about replacing Vanilla classes.
Some vanilla classes, like industries, abilities and contact missions, are specified in their CSVs, so you just change the classname specified there.

For other things (pirate base generation is one), the class instance is generated by the game's "lifecycle plugin". You have to either replace that plugin (not recommended for compatibility reasons), or else run code that removes the existing script and adds your own.

For detailed help, I'd suggest a new thread in Modding, or the Misc modding questions thread.