Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Total Conversion - Removing existing star systems/ships/spawns  (Read 5328 times)

Rushyo

  • Ensign
  • *
  • Posts: 46
    • View Profile
    • Home Page
Total Conversion - Removing existing star systems/ships/spawns
« on: October 30, 2014, 11:23:35 AM »

Tried dropping this one in the 'minor modding questions' thread but I'm beginning to suspect the answer isn't as minor as I'd hope, esp. with the latest patch...

I'm producing a total conversion of the campaign with the aim of having none of the core games star systems or ships involved (or, indeed, markets of any kind). I'd managed to hack together some crude methods of trying to stop these things spawning in the first instance, but they pretty much fell to pieces with the latest patch. I was wondering if anyone has tried this before and has any tips for reliable methods of stripping out the existing game start behaviours?
Logged

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Total Conversion - Removing existing star systems/ships/spawns
« Reply #1 on: October 30, 2014, 12:39:47 PM »

I suggest you look at the core SectorGen.java file

Then have a look at these lines for the planets

Code: java
		initFactionRelationships(sector);

new Askonia().generate(sector);
new Eos().generate(sector);
new Valhalla().generate(sector);
new Arcadia().generate(sector);
new Magec().generate(sector);
new Corvus().generate(sector);

and these lines for the rest of the campaign:

Code: java
		sector.registerPlugin(new CoreCampaignPluginImpl());
sector.addScript(new CoreScript());
sector.addScript(new CoreEventProbabilityManager());
sector.addScript(new EconomyFleetManager());

I think it's best if you unravel that ball of string yourself...it is very....very long...

Best of luck.
Logged

Zaphide

  • Admiral
  • *****
  • Posts: 799
    • View Profile
Re: Total Conversion - Removing existing star systems/ships/spawns
« Reply #2 on: October 30, 2014, 01:11:35 PM »

As Debido alludes to, you need to replace the StarSector-core SectorGen files.

Thankfully with 0.65 this is actually a lot easier. I'll use my modded Exerelin files as an example.

You'll want to look at data/config/settings.json, specifically the plugins section:
Code
	"plugins":{
   "newGameDialogPlugin":"exerelin.plugins.ExerelinNewGameDialogPlugin",
   "newGameCreationEntryPoint":"data.scripts.world.ExerelinSectorGen",
   "coreLifecyclePlugin":"exerelin.plugins.ExerelinLifecyclePlugin",
}

Note in the above the 'newGameCreationEntryPoint. If you change this, everything stems from that class, which (I assume) needs to implement SectorGeneratorPlugin:
Code
package data.scripts.world;

public class ExerelinSectorGen implements SectorGeneratorPlugin
{
        public void generate(SectorAPI sector)
{
                new Exerelin().generate(sector);

                // Still using a lot of StarSector-core functionality
                sector.registerPlugin(new CoreCampaignPluginImpl());
                sector.addScript(new CoreScript());
                sector.addScript(new CoreEventProbabilityManager());
                sector.addScript(new EconomyFleetManager());

                // Overrides dialog picker for some entities
                sector.registerPlugin(new ExerelinCoreCampaignPlugin());
        }
}

I then separate out the world building 'stuff' into another class (in this case Exerelin) but you could just write everything in your SectorGeneratorPlugin:
Code
package data.scripts.world.exerelin;

public class Exerelin
{
public void generate(SectorAPI sector)
{

        }
}

In the above examples I replaced the StarSector-core 'coreLifecyclePlugin' as it has hard-coded references to Jangala in it, which very likely won't exist in your Total Conversion :) I also switched out the 'newGameDialogPlugin' for my own.

EDIT:
You will want to create your own settings.json in your mod that just contains the settings you want to change.

Also, I have replaced the following in my mod_info.json:
Code
"replace":
[
"data/config/settings.json",
"data/campaign/econ/economy.json",
"data/campaign/starmap.json",
],
}

My data/campagin/starmap.json:
Code
{
"starSystemLocations":{

}
}

and my data/campaign/econ/economy.json:
Code
{
"version":2.0,

"initialStepsToRun":200,
"maxExoticUtilityAtRange":14000,
"defaultConnectionMult":1,
"defaultConnectionFlat":1,
"defaultTariff":0.3,

"starSystems":[

],

"map":"../starmap.json",

}

I'm not sure if the last few steps will be required (I am not building a total conversion, and am generating all the market and economy pieces in code).

2nd EDIT:
Added a few other lines to examples.
« Last Edit: October 30, 2014, 01:21:43 PM by Zaphide »
Logged