I find myself wanting to make a button that can basically do exactly what the 'establish a colony' button can do, so i can have some different requirements for this button, however am having some troubles. the colony i make
dose not display faction name,
dose not show up on the players colony menu,
i don't know if the player gets any income from said colony, but is no income/upkeep visible
i cant build industry or structures, nor can i add administrators.
in short, i think im doing something wrong, but i have no idea were to even start.
here is my code, its adapted from something in Nexerelin, as it was recommended to me.
yes i know its a mess, but at this point I'm sick of guessing what's wrong, and trying to adapt something pointlessly.
public static void createColonyStatic(MarketAPI market, PlanetAPI planet,
FactionAPI faction)
{
String factionId = faction.getId();
market.setSize(3);
market.addCondition("population_3");
market.setFactionId(factionId);
market.setPlanetConditionMarketOnly(false);
//market.getMemoryWithoutUpdate().set(MEMORY_KEY_COLONY, true);
//market.getMemoryWithoutUpdate().set(ExerelinConstants.MEMKEY_MARKET_STARTING_FACTION, factionId);
// rename generic-name worlds
if (market.getName().startsWith(planet.getStarSystem().getBaseName() + " ")) {
String tag = NameGenData.TAG_PLANET;
if (planet.isMoon()) tag = NameGenData.TAG_MOON;
String newName = ProcgenUsedNames.pickName(tag, null, null).nameWithRomanSuffixIfAny;
market.setName(newName);
planet.setName(newName);
ProcgenUsedNames.notifyUsed(newName);
}
if (market.hasCondition(Conditions.DECIVILIZED))
{
market.removeCondition(Conditions.DECIVILIZED);
market.addCondition(Conditions.DECIVILIZED_SUBPOP);
}
market.addIndustry(Industries.POPULATION);
// set growth level to 0%
if (!faction.isPlayerFaction()) {
ImmigrationPlugin plugin = getImmigrationPlugin(market);
float min = plugin.getWeightForMarketSize(market.getSize());
market.getPopulation().setWeight(min);
market.getPopulation().normalize();
market.getMemoryWithoutUpdate().set("$nex_delay_growth", true, 10);
}
//NexFactionConfig config = NexConfig.getFactionConfig(factionId);
//if (config.freeMarket)
//{
// market.getMemoryWithoutUpdate().set("$startingFreeMarket", true);
// market.setFreePort(true);
//}
//REMOVED TEST 0
//market.getTariff().modifyFlat("generator", Global.getSector().getFaction(factionId).getTariffFraction());
//NexUtilsMarket.setTariffs(market);
// submarkets
//SectorManager.updateSubmarkets(market, Factions.NEUTRAL, factionId);
//REMOVED TEST 0
//market.addSubmarket(Submarkets.SUBMARKET_STORAGE);
market.setSurveyLevel(MarketAPI.SurveyLevel.FULL);
for (MarketConditionAPI cond : market.getConditions())
{
cond.setSurveyed(true);
}
Global.getSector().getEconomy().addMarket(market, true);
market.getPrimaryEntity().setFaction(factionId); // http://fractalsoftworks.com/forum/index.php?topic=8581.0
//if (!fromDeciv) {
// NexUtilsMarket.addPerson(Global.getSector().getImportantPeople(),
// market, Ranks.CITIZEN, Ranks.POST_ADMINISTRATOR, true);
//market.setImmigrationIncentivesOn(true);
//}
//if (fromDeciv) {
market.addIndustry(Industries.SPACEPORT);
//}
//ColonyManager.buildIndustries(market);
//ColonyManager.getManager().processNPCConstruction(market);
// planet desc change
//MarketDescChanger.getInstance().reportMarketTransfered(market, faction,
//Global.getSector().getFaction(Factions.NEUTRAL), false, false, null, 0);
}
so anyone know to make something like this work?