Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  


Starsector 0.95.1a is out! (12/10/21); Blog post: Hyperspace Topography (10/12/22)

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Uomoz

Pages: [1] 2
General Discussion / Starsector Repo - Starsector Modding Repository
« on: January 13, 2020, 04:03:12 AM »
Hello everyone,

I'm developing a small sideproject to test a few new things for myself and I decided to make a Mods/Package repository for Starsector, with features like bundle packaging and proper tagging in mind.

For Modders:

You can let Starsector Repo make your mod available to download/tag/etc including a small snippet of code in the main post of the mod forum thread.

The system automatically checks the forum post of each mod and finds the download link/images etc by default, but everything the crawler does can be customized by the configuration code.

By default your mod WON'T be included in the repo. You need to add the repo_crawl = true configuration to allow the repo to interact with your mod.

Here's the base configuration. The only needed part for each config are the anchor tags and their content. The only required config is repo_crawl and it must be set to true.

Just add all or some of the code below in the main post of the mod forum thread and you are done!

[anchor=repo_crawl]true[/anchor] Choose if Starsector Repo should crawl this page or not. [Default]: false. [Optional]: NO
[anchor=repo_category]mod[/anchor] Choose one between totalconversion, mod or utility. [Default]: Mod. [Optional]: YES
[anchor=repo_tags]exampletag1,exampletag2[/anchor] Mod tags separated by a comma. for the full list of possible Tags see [Default]: N/A. [Optional]: YES
[anchor=repo_title]Title[/anchor] Overrides the title/name found in the mod_json/version files. [Default]: Parsed from version or mod_json file. [Optional]: YES
[anchor=repo_abstract]Lorem ipsum dolor sit.[/anchor] Overrides the description found in the mod_json file. [Default]: Parsed from the mod_json file. [Optional]: YES
[anchor=repo_image][/anchor] The main mod image (I like a gif here). [Default]: Parses the page for cool images. [Optional]: YES
[anchor=repo_config]data/exampleModConfig.json[/anchor] Specify the config file location of the mod in the main mod folder so it can be edited before downloading it from the repository. [Default]: N/A. [Optional]: YES
[anchor=repo_changelog]Lorem ipsum dolor sit.[/anchor] Specifies the changelog for the latest version. [Default]: N/A. [Optional]: YES
[anchor=repo_link][/anchor] The current version download link (must be direct). [Default]: Parses the page for probable download links. [Optional]: YES

Cleaned up for final implementation:

[anchor=repo_abstract]Lorem ipsum dolor sit.[/anchor]
[anchor=repo_changelog]Lorem ipsum dolor sit.[/anchor]

Absolute Barebone Config, but perfectly working:


Possible Tags (WIP, just for test, they will be changed/deprecated soon)


WIP interface

Global.getCombatEngine().getFleetManager(ENEMY or PLAYER).spawnFleetMember

spawns player owned ships, even if the fleetside is ENEMY.

Modding / Radio chatter mod
« on: April 19, 2014, 03:37:35 PM »
Would anyone find a mod like this interesting, like in HW? If anyone wants to try getting involved PM me.

Modding / PSA: How to re-balance your mod for 0.6.2a
« on: January 20, 2014, 04:25:34 AM »
Alex changed some key values in the latest patch, mostly regarding CR.

From the changelog:

- Halved deployment cost and CR recovery rate (i.e. supply cost and recovery time remain the same, more deployments are possible).
- "Repair cost" in ship_data.csv now includes full repairs to both armor and hull. You'll want to double all the values for the costs to remain as they were.

Basically, you just need to edit ship_data values like this:

x2 "repair cost" values.
1/2 "repair %/day" and "CR to deploy" values.
Fighters needs some sensible values in the "repair cost" column, not 1 (like a talon, 10).

Fan Media & Fiction / Starsector Streaming Channels
« on: November 13, 2013, 05:42:07 PM »
Here are the active and reported streams available for Starsector:

  Forum Id: Uomoz   Bitrate: low   Content: mostly modding development and gameplay
  Forum Id: Cycerin   Bitrate: medium   Content: mostly Starsector+ gameplay
  Forum Id: mendonca   Bitrate: low   Content: ???
  Forum Id: Tecrys   Bitrate: high   Content: ???
  Forum Id: Ashoni   Bitrate: high   Content: mostly vanilla gameplay
  Forum Id: Dias Flac   Bitrate: high   Content: mostly vanilla gameplay

PM me if you want to be added to the list!

Modding / Modding question: How to sort ships for AI fleets?
« on: September 26, 2013, 05:20:11 PM »
I made a script that builds fleets from scratch but I'm struggling finding a way to properly sort them after the creation (like from Capital down to Civilian, so that crew is better distributed). Anyone having any clue about a way to do this? Thanks!

Modding / [Guide] OH GOD. How to change stations dialogue.
« on: September 17, 2013, 06:22:14 PM »

FIRST, I'm a total noob. Never programmed, nor taken any classes in java or anything. Also my english sucks. So this will be a very practical guide (for people already accustomed with modding). Here's what I did (BE CAREFUL, it's quite complicated, and requires a few external program usage). I hope you use an IDE because otherwise it will be hard (impossible as far as i know).
Basically you need a folder structure like this:

1. Standard scripts folder inside data folder.

2. Inside scripts you need both a file and a plugins folder.

3. Inside plugins you need a file.

4. (The hard part) you need to create a JAR file containing the station interaction plugin itself.

ModPlugin is the new and cooler generator file (that is still working, for now, but is deprecated), mine looks like this, it basically makes your mod start:

package data.scripts;

import com.fs.starfarer.api.BaseModPlugin;
import com.fs.starfarer.api.Global;
import data.scripts.plugins.*;

public class UsSModPlugin extends BaseModPlugin
    private static void initUsS()

    public void onNewGame()
    Global.getSector().registerPlugin(new UsSCoreCampaignPlugin());  ///THE JAVA THAT MANAGES THE CORE CAMPAIGN PLUGINS, LIKE STATIONS/BATTLES/PLANETS.
    initUsS();                                                                            ///STANDARD GEN FILE, LIKE THE OLD ONES. IT DOES NOT APPEAR IN MY FOLDERS BECAUSE I DIDN'T WRITE IT YET.

CoreCampaignPlugin is what manages modded FleetInteractionDialogPlugin, JumpPointInteractionDialogPlugin, PlanetInteractionDialogPlugin, OrbitalStationInteractionDialogPlugin, BattleCreationPlugin. You see, we can do a s**t ton of stuff in this version! :D

Here is how it looks like for UsS.

package data.scripts.plugins;

import com.fs.starfarer.api.PluginPick;
import com.fs.starfarer.api.campaign.BaseCampaignPlugin;
import com.fs.starfarer.api.campaign.OrbitalStationAPI;
import com.fs.starfarer.api.campaign.PlanetAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import data.scripts.*; 

public class UsSCoreCampaignPlugin extends BaseCampaignPlugin {

public String getId() {
return null;

public boolean isTransient() {
return false;

public PluginPick pickInteractionDialogPlugin(SectorEntityToken interactionTarget) {

if (interactionTarget instanceof OrbitalStationAPI) {
return new PluginPick(new UsSStationInteractionDialogPlugin(), PickPriority.MOD_GENERAL);  ///HERE IT IS. UsSStationInteractionDialogPlugin is my implementation of OrbitalStationInteractionDialogPlugin

return null;

Easy huh? NOT!
Here comes the pain. The actual implementation of the plugin NEEDS to be in a Jar. I tried working around that, but Janino (the thing that takes human written code and translate to the game) cannot use stuff inside this particular script, so this needs to be written in something that bypasses Janino. Jar files are pre-compiled compressed java files, so they fit this situation perfectly. How to make a Jar? You need an IDE (like Netbeans, a program to make java stuff), create a folder structure data/scripts with it and add the implementation inside the scripts folder and make it compile it into a Jar file. Also, it needs to be compiled using JDK6, not 7. Questions? I guessed so! Well, ask anything you need here, or find some guides around. It's less hard than one can think when it comes to it.

Anyway Janino will see nothing BUT the game WILL recognize that java file as it was inside the scripts folder! So our CoreCampaignPlugin will activate our working OrbitalStationInteractionDialogPlugin (that is in the Jar instead of outside it)'

Here's my OrbitalStationInteractionDialogPlugin:

package data.scripts;

import com.fs.starfarer.api.Global;
import com.fs.starfarer.api.campaign.CampaignFleetAPI;
import com.fs.starfarer.api.campaign.CoreInteractionListener;
import com.fs.starfarer.api.campaign.CoreUITabId;
import com.fs.starfarer.api.campaign.InteractionDialogAPI;
import com.fs.starfarer.api.campaign.InteractionDialogPlugin;
import com.fs.starfarer.api.campaign.OptionPanelAPI;
import com.fs.starfarer.api.campaign.SectorEntityToken;
import com.fs.starfarer.api.campaign.TextPanelAPI;
import com.fs.starfarer.api.campaign.VisualPanelAPI;
import com.fs.starfarer.api.combat.EngagementResultAPI;
import com.fs.starfarer.api.fleet.FleetMemberAPI;
import java.awt.Color;
import org.lwjgl.input.Keyboard;

public class UsSStationInteractionDialogPlugin implements InteractionDialogPlugin, CoreInteractionListener {

private static enum OptionId {

private InteractionDialogAPI dialog;
private TextPanelAPI textPanel;
private OptionPanelAPI options;
private VisualPanelAPI visual;

private CampaignFleetAPI playerFleet;
private SectorEntityToken station;

private static final Color HIGHLIGHT_COLOR = Global.getSettings().getColor("buttonShortcut");

public void init(InteractionDialogAPI dialog) {
this.dialog = dialog;
textPanel = dialog.getTextPanel();
options = dialog.getOptionPanel();
visual = dialog.getVisualPanel();

playerFleet = Global.getSector().getPlayerFleet();
station = (SectorEntityToken) dialog.getInteractionTarget();

visual.setVisualFade(0.25f, 0.25f);

dialog.setOptionOnEscape("Leave", OptionId.LEAVE);

optionSelected(null, OptionId.INIT);

private EngagementResultAPI lastResult = null;
public void backFromEngagement(EngagementResultAPI result) {
// no combat here, so this won't get called

public void optionSelected(String text, Object optionData) {
if (optionData == null) return;

OptionId option = (OptionId) optionData;

if (text != null) {
textPanel.addParagraph(text, Global.getSettings().getColor("buttonText"));

if (option == OptionId.INIT) {
if (station.getFaction().getRelationship(playerFleet.getFaction().getId()) >= 0) {
                        } else {
                            addText("The Station weapons activate, you are forced to flee.");
                        if  (station.getCustomInteractionDialogImageVisual() != null) {
} else {
visual.showImagePortion("illustrations", "hound_hangar", 800, 800, 0, 0, 400, 400);
} else if (option == OptionId.TRADE_CARGO) {
visual.showCore(CoreUITabId.CARGO, station, station.getFaction().isNeutralFaction(), this);
} else if (option == OptionId.TRADE_SHIPS) {
visual.showCore(CoreUITabId.FLEET, station, station.getFaction().isNeutralFaction(), this);
} else if (option == OptionId.REFIT) {
visual.showCore(CoreUITabId.REFIT, station, station.getFaction().isNeutralFaction(), this);
} else if (option == OptionId.REPAIR_ALL) {
} else if (option == OptionId.LEAVE) {

private void performRepairs() {
float supplies = playerFleet.getCargo().getSupplies();
float needed = playerFleet.getLogistics().getTotalRepairSupplyCost();

textPanel.highlightLastInLastPara("" + (int) needed, HIGHLIGHT_COLOR);

for (FleetMemberAPI member : playerFleet.getFleetData().getMembersListCopy()) {
float max = member.getRepairTracker().getMaxCR();
float curr = member.getRepairTracker().getBaseCR();
if (max > curr) {
member.getRepairTracker().applyCREvent(max - curr, "Repaired at station");
if (needed > 0) {

private void createInitialOptions() {

if (station.getFaction().isNeutralFaction()) {
options.addOption("Transfer cargo or personnel", OptionId.TRADE_CARGO);
options.setShortcut(OptionId.TRADE_CARGO, Keyboard.KEY_I, false, false, false, true);
options.addOption("Transfer ships to or from this station", OptionId.TRADE_SHIPS);
options.setShortcut(OptionId.TRADE_SHIPS, Keyboard.KEY_F, false, false, false, true);
options.addOption("Make use of the dockyard's refitting facilities", OptionId.REFIT);
options.setShortcut(OptionId.REFIT, Keyboard.KEY_R, false, false, false, true);

if (station.getFaction().getRelationship(playerFleet.getFaction().getId()) >= 0) {
                        options.addOption("Trade, or hire personnel", OptionId.TRADE_CARGO);
options.setShortcut(OptionId.TRADE_CARGO, Keyboard.KEY_I, false, false, false, true);
options.addOption("Buy or sell ships", OptionId.TRADE_SHIPS, null);
options.setShortcut(OptionId.TRADE_SHIPS, Keyboard.KEY_F, false, false, false, true);
options.addOption("Make use of the dockyard's refitting facilities", OptionId.REFIT);
options.setShortcut(OptionId.REFIT, Keyboard.KEY_R, false, false, false, true);
float needed = playerFleet.getLogistics().getTotalRepairSupplyCost();
float supplies = playerFleet.getCargo().getSupplies();
options.addOption("Repair your ships at the station's dockyard", OptionId.REPAIR_ALL);

if (needed <= 0) {
options.setEnabled(OptionId.REPAIR_ALL, false);
options.setTooltip(OptionId.REPAIR_ALL, getString("repairTooltipAlreadyRepaired"));
} else if (supplies < needed) {
options.setEnabled(OptionId.REPAIR_ALL, false);
options.setTooltip(OptionId.REPAIR_ALL, getString("repairTooltipNotEnough"));
options.setTooltipHighlightColors(OptionId.REPAIR_ALL, HIGHLIGHT_COLOR, HIGHLIGHT_COLOR);
options.setTooltipHighlights(OptionId.REPAIR_ALL, "" + (int) needed, "" + (int) supplies);
} else {
options.setTooltip(OptionId.REPAIR_ALL, getString("repairTooltip"));
options.setTooltipHighlightColors(OptionId.REPAIR_ALL, HIGHLIGHT_COLOR, HIGHLIGHT_COLOR);
options.setTooltipHighlights(OptionId.REPAIR_ALL, "" + (int) needed, "" + (int) supplies);

options.addOption("Leave", OptionId.LEAVE);

private OptionId lastOptionMousedOver = null;
public void optionMousedOver(String optionText, Object optionData) {


public void advance(float amount) {


private void addText(String text) {

private void appendText(String text) {
textPanel.appendToLastParagraph(" " + text);

private String getString(String id) {
String str = Global.getSettings().getString("stationInteractionDialog", id);

String fleetOrShip = "fleet";
if (playerFleet.getFleetData().getMembersListCopy().size() == 1) {
fleetOrShip = "ship";
if (playerFleet.getFleetData().getMembersListCopy().get(0).isFighterWing()) {
fleetOrShip = "fighter wing";
str = str.replaceAll("\\$fleetOrShip", fleetOrShip);
str = str.replaceAll("\\$stationName", station.getFullName());

float needed = playerFleet.getLogistics().getTotalRepairSupplyCost();
float supplies = playerFleet.getCargo().getSupplies();
str = str.replaceAll("\\$supplies", "" + (int) supplies);
str = str.replaceAll("\\$repairSupplyCost", "" + (int) needed);

return str;

public Object getContext() {
return null;

public void coreUIDismissed() {
optionSelected(null, OptionId.INIT);

The Jar file goes inside the jar folder, and this folder needs to be in the main folder of the mod (with data-graphics-sounds). You also need to add the jar to the mod_info.json, like:    "jars":["jars/uscorbjar.jar"],

Both CoreCampaignPlugin and OrbitalStationInteractionDialogPlugin are a modified version of the official impl version of them. You can find them inside Starsector\starsector-core\\com\fs\starfarer\api\impl\campaign. Edit those versions or mine to achieve whatever your twisted minds want.

I think this is pretty much it, I hope I didn't forget anything. It's 3 am here, CYA!

PS. Thanks to Verrius and Alex, without them I couldn't get it to work.

Suggestions / SELLING: price/space discrepancy
« on: September 15, 2013, 03:48:48 PM »

The cargo space is total (for the entire stack) while the sell price is per unit. I find myself calculating ratios to determine the value of an item, maybe a cargo space per "unit" could be useful paired with the "stack" space info.

Bug Reports & Support / OutOfMemory
« on: March 13, 2013, 06:20:56 AM »
Not really a vanilla bug, I think, but maybe related to some problem with the engine (or me hitting the game maximum capabilities). Happens randomly before any fight in U'sC (after a decently lengthy session).

7053361 [Thread-6] ERROR com.fs.starfarer.combat.D  - java.lang.OutOfMemoryError
at sun.misc.Unsafe.allocateMemory(Native Method)
at java.nio.DirectByteBuffer.<init>(
at java.nio.ByteBuffer.allocateDirect(
at org.lwjgl.BufferUtils.createByteBuffer(
at Source)
at Source)
at Source)
at com.fs.starfarer.combat.CombatEngine.replaceBackground(Unknown Source)
at com.fs.starfarer.campaign.A.super(Unknown Source)
at com.fs.starfarer.campaign.A.super(Unknown Source)
at com.fs.starfarer.ui.for.ÓO0000(Unknown Source)
at com.fs.starfarer.campaign.ui.N.super(Unknown Source)
at com.fs.starfarer.ui.OOoO.super(Unknown Source)
at com.fs.starfarer.ui.Objectsuper.o00000(Unknown Source)
at com.fs.starfarer.A.ÖÖÒ000(Unknown Source)
at Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$ Source)

Suggestions / Automated Shields
« on: March 12, 2013, 05:55:32 PM »
A control (or maybe to be coherent with current autofire implementation a shift-control) to set the shield AI controlled?

Discussions / Community Awards
« on: February 01, 2013, 01:50:05 PM »
One vote for each category per User.

User: Best Moderator

User: Best Overall Forum Presence (interesting posts etc.)

User: Best Mod Creator

User: Best Spriter

User: Best Coder

User: Best Video Maker

User: Best Story & Fan Fiction Maker

Mods: Best Mod

Mods: Best Faction

Mods: Best Total Conversion

Mods: Best Mod Resource

Modding / Drone System aiHints meaning
« on: September 23, 2012, 03:28:27 PM »
Can someone explain what this values means in a drone .sysem file? Ty in advance ;)

         "LIGHT_ESCORT":{"mult":1, "flat":20},
         "DESTROYER_ESCORT":{"mult":1, "flat":20},
         "FULL_ESCORT":{"mult":1, "flat":20},

Fan Media & Fiction / Huske System: Challenges and Roleplay
« on: September 01, 2012, 02:00:56 AM »
Roleplay topic for Huske System's players.

I will ask moderators to delete any non-RP post.

Challenges should at least be 1 sentence long and have some sort of RP flavor.

Any public player interaction should be channeled through here.

General Discussion / Huske System: AI vs AI battles (Roleplay PvP) 2.0
« on: August 28, 2012, 01:06:39 PM »
Forum Multiplayer. Video of each battle (720p). Inscriptions are always open, it's a free environment, anyone can climb to the top.
Even if a someone is WAY ahead, that doesn't interfere with the other players, almost at all. There will always be able competitors for every Admiral and the few ahead can *at best* stop 1 Defense of *1* player. So don't be shy, fight, earn your daily bread!



...T1 Restock Phase - T1 Challenges, Trade and Fights ...


- Organize challenges, turns and chat between players.

- Ships, Crew, Intel, Captains, Admiral Marketplace, Videos, We got everything you need!

How to start:

- Players must provide fleet name, faction name and admiral name (the universe is vanilla, but u're free to play minor, completley new, factions or play inside bigger vanilla factions).

- When starting out a fleet, players might spend up to 12000 + [total value of Skipped turns, see below, usually makes catching up very feasible] credits in SHIP HULLS (+ WEAPONS VALUE for each ship) \ FIGHTER WINGS.

- The game is organized in Turns divided in 2 phases. read below for more information.

Fleet composition:

- PM me the .variant files (HIGHLY SUGGESTED TRYLOBOT's EDITOR) and fleet composition. You can freely use Vanilla variants. No variants descriptions allowed, as building em take too much of my time. Remember to specify WeaponGroups in the .variant file. Use prefixes or suffixes for both .variant file names AND ids (Your_Nick_buffalomkII_CS for name and id, please). Name and ID should be identical and differ from previous versions of your ships. Upload variants using sites like

- Variants need to be inside OP boundaries.

- No FP Limit.

- Veterancy status of the crew can be upgraded paying the difference.

- Refitting costs the Weapons Value of the ship.

- Hangar space limit the amount of fighters (up to 100% hangar space used).

- All fleet compositions are hidden and known only by the owner player and ME.

- Default Veterancy status on all ships is GREEN.

- Player can sell ships for 1\2 their price (and transfer\sell crew and weapons aswell for 1\2 the price).

- Player can freely name ships, just PM me.

- Player can set the whole fleet behaviour (Attack, Defend).

Restock Phase:

- All modifications\upgrades\purchases must be requested during a Restock Phase. Basically everything that's not in the Challenge Phase.

- Players can either buy empty ships or add them Weapons, paying the Weapons Value cost of the ship.

- Completely destroyed fighters and ships can be repaired paying their Weapons value. Assigned crew is lost though.

- You can freely barter stuff with other players.

- A player may exchange money and stuff but his total possessions can never go below his starting pool (12k in money and\or ships). This is to prevent fake accounts for easy money + various shenanigans. This counts for quit fleets too.

- Form Alliances (YES, you can fight adding your ships to your partner), mercenary jobs, swapping factions (many players may share the same faction while performing in different fleets) are HIGHLY encouraged and resolved in this phase.

- You can declare to be Skipping (see Challenge Phase for mechanic) in this Phase.

Challenge Phase:

- Each player fight, defend or skip every turn spending his single action (token). Challenge Phase doesn't pass until everyone has either fought traded or skipped the turn. During a turn, each player can challenge others once (Challenge) and be challenged once (Defense).


- You can publically challenge other players fleets on The Roleplay and Challenge thread, and both fleets earn 25% of the enemy destroyed\disabled ships value (not escaped) in usable money + the value of the weapons of the ships destroyed.

- Battles with no losses will be discarded and re-recorded.

- In battle, both fleets are fully controlled by Admiral AI.

- There's no way to lose SHIPS and MONEY during a fight unless a hull gets COMPLETELY destroyed, then it needs to be repaired.

- Players that (W)on their last turn Challenge may only challenge players that (W)on last turn. Players that (L)ost their last turn Challenge may only challenge players that (L)ost last turn. This rule apply until there are enough fleets of the same pool.

- For multi-player factions vs multi-player factions: The W\L rule apply for them and it now consider for each MP-fleet a "Leader". Factions and Alliances must declare the Leader or it will be arbitrarily assigned.

- When players share the Faction, they can challenge adding their ships together (consuming all participants Challenge token) or challenge alone. On the other hand other players may challenge the whole Faction fleet or any of its singular players.


- A player that Skips his turn gets Credits (see table in the Player Chart) and cannot be challenged for that turn. If done after challenged, the player gets only the Challenge Skip reward (as he only Skipped his attack). Skip Rewards scale up during the turns.


- A Player fleet can forcefully defend another fleet spending its Challenge token, in that case nobody can attack the defended fleet without facing both. This can also be issu

- There is none.

Suggestions / Forum Suggestion: "Mods" subforum
« on: August 15, 2012, 12:33:39 PM »
I think it would be neat to add a subforum "MODS" under Modding, so that there can be a place to put all Mod Topics, separated from general modding questions and discussions. That could result in a better highlight for actual mods and add a way to better keep on track of all mod versions for forum guests.

Pages: [1] 2