Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: How to enable Prism Freeport in-game? (SOLVED)  (Read 1721 times)

Kesh

  • Ensign
  • *
  • Posts: 26
    • View Profile
How to enable Prism Freeport in-game? (SOLVED)
« on: August 18, 2019, 03:55:05 PM »

I am a little bit late in the game now but I forgot to enable Prism Freeport which I wanted to. Is there a way to enable it in-game?
« Last Edit: August 23, 2019, 03:05:18 AM by Dave1233213 »
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2846
  • Your Friendly Forum Friend
    • View Profile
Re: How to enable Prism Freeport in-game?
« Reply #1 on: August 20, 2019, 08:49:00 PM »

I am a little bit late in the game now but I forgot to enable Prism Freeport which I wanted to. Is there a way to enable it in-game?
Sadly no. Stations and planets are created with the map on the starting of a new game.
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: How to enable Prism Freeport in-game?
« Reply #2 on: August 20, 2019, 11:54:49 PM »

Technically, you could enter the entirety of the Prism Freeport generation code into the console with Console Commands, and that should run and generate it. No idea what could go wrong, though; try it at your own risk.
Logged

Kesh

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: How to enable Prism Freeport in-game?
« Reply #3 on: August 21, 2019, 08:33:10 PM »

Technically, you could enter the entirety of the Prism Freeport generation code into the console with Console Commands, and that should run and generate it. No idea what could go wrong, though; try it at your own risk.

Uhmm... No idea how to do that though. Do you know how?
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: How to enable Prism Freeport in-game?
« Reply #4 on: August 21, 2019, 10:24:59 PM »

Here's the code block:

It's long, so warm up those typing fingers.
Code
protected void addPrismMarket(SectorAPI sector)
{
SectorEntityToken prismEntity;

if (ExerelinSetupData.getInstance().numSystems == 1)
{
// FIXME
SectorEntityToken toOrbit = Global.getSector().getEntityById("jangala"); //null;
float radius = toOrbit.getRadius();
float orbitDistance = radius + 150;
if (toOrbit instanceof PlanetAPI)
{
PlanetAPI planet = (PlanetAPI)toOrbit;
if (planet.isStar())
{
orbitDistance = radius + 2000 + rand.nextFloat() * 500;
}
}
prismEntity = toOrbit.getContainingLocation().addCustomEntity("nex_prismFreeport", "Prism Freeport", "exerelin_freeport_type", "independent");
prismEntity.setCircularOrbitPointingDown(toOrbit, ExerelinUtilsAstro.getRandomAngle(rand), orbitDistance, ExerelinUtilsAstro.getOrbitalPeriod(toOrbit, orbitDistance));
}
else
{
LocationAPI hyperspace = sector.getHyperspace();
prismEntity = hyperspace.addCustomEntity("nex_prismFreeport", "Prism Freeport", "exerelin_freeport_type", "independent");
prismEntity.setCircularOrbitWithSpin(hyperspace.createToken(-8005, -4385), ExerelinUtilsAstro.getRandomAngle(rand), 150, 60, 30, 30);
}

prismEntity.addTag(ExerelinConstants.TAG_UNINVADABLE);

/*
EntityData data = new EntityData(null);
data.name = "Prism Freeport";
data.type = EntityType.STATION;
data.forceMarketSize = 4;

MarketAPI market = addMarketToEntity(prismEntity, data, "independent");
*/

MarketAPI market = Global.getFactory().createMarket("nex_prismFreeport" /*+ "_market"*/, "Prism Freeport", 5);
market.setFactionId(Factions.INDEPENDENT);
market.addCondition(Conditions.POPULATION_5);
market.addIndustry(Industries.POPULATION);
market.addIndustry("commerce");
market.addIndustry(Industries.LIGHTINDUSTRY);
market.addIndustry(Industries.MILITARYBASE);
market.addIndustry(Industries.MEGAPORT);
//market.addIndustry(Industries.HEAVYINDUSTRY);
market.addIndustry(Industries.HEAVYBATTERIES);
market.addIndustry(Industries.STARFORTRESS_HIGH);
market.addIndustry(Industries.CRYOSANCTUM);

market.setFreePort(true);
market.addSubmarket(Submarkets.SUBMARKET_OPEN);
market.addSubmarket(Submarkets.GENERIC_MILITARY);
market.addSubmarket(Submarkets.SUBMARKET_BLACK);
market.addSubmarket(Submarkets.SUBMARKET_STORAGE);

market.getMemoryWithoutUpdate().set(ExerelinConstants.MEMORY_KEY_UNINVADABLE, true);

market.getTariff().modifyFlat("generator", sector.getFaction(Factions.INDEPENDENT).getTariffFraction());
ExerelinUtilsMarket.setTariffs(market);
market.addSubmarket("exerelin_prismMarket");
market.setPrimaryEntity(prismEntity);
prismEntity.setMarket(market);
prismEntity.setFaction(Factions.INDEPENDENT);
market.setSurveyLevel(MarketAPI.SurveyLevel.FULL); // not doing this makes market condition tooltips fail to appear
sector.getEconomy().addMarket(market, true);

//prismEntity.removeTag(Tags.STATION); // workaround http://fractalsoftworks.com/forum/index.php?topic=12548.msg213678#msg213678

//pickEntityInteractionImage(prismEntity, market, "", EntityType.STATION);
//prismEntity.setInteractionImage("illustrations", "space_bar");
prismEntity.setCustomDescriptionId("exerelin_prismFreeport");

// deep hyperspace removal (copypasted from UW)
HyperspaceTerrainPlugin plugin = (HyperspaceTerrainPlugin) Misc.getHyperspaceTerrain().getPlugin();
NebulaEditor editor = new NebulaEditor(plugin);

float minRadius = plugin.getTileSize() * 2f;
float radius = 400;
editor.clearArc(prismEntity.getLocation().x, prismEntity.getLocation().y, 0, radius + minRadius * 0.5f, 0, 360f);
editor.clearArc(prismEntity.getLocation().x, prismEntity.getLocation().y, 0, radius + minRadius, 0, 360f, 0.25f);
}
[close]
Logged

Kesh

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: How to enable Prism Freeport in-game?
« Reply #5 on: August 22, 2019, 12:15:10 AM »

Here's the code block:

It's long, so warm up those typing fingers.
Code
protected void addPrismMarket(SectorAPI sector)
{
SectorEntityToken prismEntity;

if (ExerelinSetupData.getInstance().numSystems == 1)
{
// FIXME
SectorEntityToken toOrbit = Global.getSector().getEntityById("jangala"); //null;
float radius = toOrbit.getRadius();
float orbitDistance = radius + 150;
if (toOrbit instanceof PlanetAPI)
{
PlanetAPI planet = (PlanetAPI)toOrbit;
if (planet.isStar())
{
orbitDistance = radius + 2000 + rand.nextFloat() * 500;
}
}
prismEntity = toOrbit.getContainingLocation().addCustomEntity("nex_prismFreeport", "Prism Freeport", "exerelin_freeport_type", "independent");
prismEntity.setCircularOrbitPointingDown(toOrbit, ExerelinUtilsAstro.getRandomAngle(rand), orbitDistance, ExerelinUtilsAstro.getOrbitalPeriod(toOrbit, orbitDistance));
}
else
{
LocationAPI hyperspace = sector.getHyperspace();
prismEntity = hyperspace.addCustomEntity("nex_prismFreeport", "Prism Freeport", "exerelin_freeport_type", "independent");
prismEntity.setCircularOrbitWithSpin(hyperspace.createToken(-8005, -4385), ExerelinUtilsAstro.getRandomAngle(rand), 150, 60, 30, 30);
}

prismEntity.addTag(ExerelinConstants.TAG_UNINVADABLE);

/*
EntityData data = new EntityData(null);
data.name = "Prism Freeport";
data.type = EntityType.STATION;
data.forceMarketSize = 4;

MarketAPI market = addMarketToEntity(prismEntity, data, "independent");
*/

MarketAPI market = Global.getFactory().createMarket("nex_prismFreeport" /*+ "_market"*/, "Prism Freeport", 5);
market.setFactionId(Factions.INDEPENDENT);
market.addCondition(Conditions.POPULATION_5);
market.addIndustry(Industries.POPULATION);
market.addIndustry("commerce");
market.addIndustry(Industries.LIGHTINDUSTRY);
market.addIndustry(Industries.MILITARYBASE);
market.addIndustry(Industries.MEGAPORT);
//market.addIndustry(Industries.HEAVYINDUSTRY);
market.addIndustry(Industries.HEAVYBATTERIES);
market.addIndustry(Industries.STARFORTRESS_HIGH);
market.addIndustry(Industries.CRYOSANCTUM);

market.setFreePort(true);
market.addSubmarket(Submarkets.SUBMARKET_OPEN);
market.addSubmarket(Submarkets.GENERIC_MILITARY);
market.addSubmarket(Submarkets.SUBMARKET_BLACK);
market.addSubmarket(Submarkets.SUBMARKET_STORAGE);

market.getMemoryWithoutUpdate().set(ExerelinConstants.MEMORY_KEY_UNINVADABLE, true);

market.getTariff().modifyFlat("generator", sector.getFaction(Factions.INDEPENDENT).getTariffFraction());
ExerelinUtilsMarket.setTariffs(market);
market.addSubmarket("exerelin_prismMarket");
market.setPrimaryEntity(prismEntity);
prismEntity.setMarket(market);
prismEntity.setFaction(Factions.INDEPENDENT);
market.setSurveyLevel(MarketAPI.SurveyLevel.FULL); // not doing this makes market condition tooltips fail to appear
sector.getEconomy().addMarket(market, true);

//prismEntity.removeTag(Tags.STATION); // workaround http://fractalsoftworks.com/forum/index.php?topic=12548.msg213678#msg213678

//pickEntityInteractionImage(prismEntity, market, "", EntityType.STATION);
//prismEntity.setInteractionImage("illustrations", "space_bar");
prismEntity.setCustomDescriptionId("exerelin_prismFreeport");

// deep hyperspace removal (copypasted from UW)
HyperspaceTerrainPlugin plugin = (HyperspaceTerrainPlugin) Misc.getHyperspaceTerrain().getPlugin();
NebulaEditor editor = new NebulaEditor(plugin);

float minRadius = plugin.getTileSize() * 2f;
float radius = 400;
editor.clearArc(prismEntity.getLocation().x, prismEntity.getLocation().y, 0, radius + minRadius * 0.5f, 0, 360f);
editor.clearArc(prismEntity.getLocation().x, prismEntity.getLocation().y, 0, radius + minRadius, 0, 360f, 0.25f);
}
[close]

Wow... Thank you very much... Soooo i just need to type this in console commands?
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2846
  • Your Friendly Forum Friend
    • View Profile
Re: How to enable Prism Freeport in-game?
« Reply #6 on: August 22, 2019, 05:47:11 PM »

Here's the code block:

It's long, so warm up those typing fingers.
Code
protected void addPrismMarket(SectorAPI sector)
{
SectorEntityToken prismEntity;

if (ExerelinSetupData.getInstance().numSystems == 1)
{
// FIXME
SectorEntityToken toOrbit = Global.getSector().getEntityById("jangala"); //null;
float radius = toOrbit.getRadius();
float orbitDistance = radius + 150;
if (toOrbit instanceof PlanetAPI)
{
PlanetAPI planet = (PlanetAPI)toOrbit;
if (planet.isStar())
{
orbitDistance = radius + 2000 + rand.nextFloat() * 500;
}
}
prismEntity = toOrbit.getContainingLocation().addCustomEntity("nex_prismFreeport", "Prism Freeport", "exerelin_freeport_type", "independent");
prismEntity.setCircularOrbitPointingDown(toOrbit, ExerelinUtilsAstro.getRandomAngle(rand), orbitDistance, ExerelinUtilsAstro.getOrbitalPeriod(toOrbit, orbitDistance));
}
else
{
LocationAPI hyperspace = sector.getHyperspace();
prismEntity = hyperspace.addCustomEntity("nex_prismFreeport", "Prism Freeport", "exerelin_freeport_type", "independent");
prismEntity.setCircularOrbitWithSpin(hyperspace.createToken(-8005, -4385), ExerelinUtilsAstro.getRandomAngle(rand), 150, 60, 30, 30);
}

prismEntity.addTag(ExerelinConstants.TAG_UNINVADABLE);

/*
EntityData data = new EntityData(null);
data.name = "Prism Freeport";
data.type = EntityType.STATION;
data.forceMarketSize = 4;

MarketAPI market = addMarketToEntity(prismEntity, data, "independent");
*/

MarketAPI market = Global.getFactory().createMarket("nex_prismFreeport" /*+ "_market"*/, "Prism Freeport", 5);
market.setFactionId(Factions.INDEPENDENT);
market.addCondition(Conditions.POPULATION_5);
market.addIndustry(Industries.POPULATION);
market.addIndustry("commerce");
market.addIndustry(Industries.LIGHTINDUSTRY);
market.addIndustry(Industries.MILITARYBASE);
market.addIndustry(Industries.MEGAPORT);
//market.addIndustry(Industries.HEAVYINDUSTRY);
market.addIndustry(Industries.HEAVYBATTERIES);
market.addIndustry(Industries.STARFORTRESS_HIGH);
market.addIndustry(Industries.CRYOSANCTUM);

market.setFreePort(true);
market.addSubmarket(Submarkets.SUBMARKET_OPEN);
market.addSubmarket(Submarkets.GENERIC_MILITARY);
market.addSubmarket(Submarkets.SUBMARKET_BLACK);
market.addSubmarket(Submarkets.SUBMARKET_STORAGE);

market.getMemoryWithoutUpdate().set(ExerelinConstants.MEMORY_KEY_UNINVADABLE, true);

market.getTariff().modifyFlat("generator", sector.getFaction(Factions.INDEPENDENT).getTariffFraction());
ExerelinUtilsMarket.setTariffs(market);
market.addSubmarket("exerelin_prismMarket");
market.setPrimaryEntity(prismEntity);
prismEntity.setMarket(market);
prismEntity.setFaction(Factions.INDEPENDENT);
market.setSurveyLevel(MarketAPI.SurveyLevel.FULL); // not doing this makes market condition tooltips fail to appear
sector.getEconomy().addMarket(market, true);

//prismEntity.removeTag(Tags.STATION); // workaround http://fractalsoftworks.com/forum/index.php?topic=12548.msg213678#msg213678

//pickEntityInteractionImage(prismEntity, market, "", EntityType.STATION);
//prismEntity.setInteractionImage("illustrations", "space_bar");
prismEntity.setCustomDescriptionId("exerelin_prismFreeport");

// deep hyperspace removal (copypasted from UW)
HyperspaceTerrainPlugin plugin = (HyperspaceTerrainPlugin) Misc.getHyperspaceTerrain().getPlugin();
NebulaEditor editor = new NebulaEditor(plugin);

float minRadius = plugin.getTileSize() * 2f;
float radius = 400;
editor.clearArc(prismEntity.getLocation().x, prismEntity.getLocation().y, 0, radius + minRadius * 0.5f, 0, 360f);
editor.clearArc(prismEntity.getLocation().x, prismEntity.getLocation().y, 0, radius + minRadius, 0, 360f, 0.25f);
}
[close]

Wow... Thank you very much... Soooo i just need to type this in console commands?
Sadly it looks like it doesn't work
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

Histidine

  • Admiral
  • *****
  • Posts: 4661
    • View Profile
    • GitHub profile
Re: How to enable Prism Freeport in-game?
« Reply #7 on: August 23, 2019, 02:09:16 AM »

Implemented an easier way to do it.

- Download the Nexerelin hotfix .jar from this post
- Enter in console (copy and paste): runcode new exerelin.world.ExerelinNewGameSetup().addPrismMarket(Global.getSector(), false);
Logged

Kesh

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: How to enable Prism Freeport in-game? (SOLVED)
« Reply #8 on: August 23, 2019, 03:09:40 AM »

Implemented an easier way to do it.

- Download the Nexerelin hotfix .jar from this post
- Enter in console (copy and paste): runcode new exerelin.world.ExerelinNewGameSetup().addPrismMarket(Global.getSector(), false);

It worked!! Thank you very much!!
Logged