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.
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.
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);
}
Here's the code block:It's long, so warm up those typing fingers.Codeprotected 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]
Sadly it looks like it doesn't workHere's the code block:It's long, so warm up those typing fingers.Codeprotected 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?
Implemented an easier way to do it.
- Download the Nexerelin hotfix .jar from this post (http://fractalsoftworks.com/forum/index.php?topic=9175.msg258196#msg258196)
- Enter in console (copy and paste): runcode new exerelin.world.ExerelinNewGameSetup().addPrismMarket(Global.getSector(), false);