Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: How do you Spawn a Nexus with the console command mod?  (Read 2348 times)

SYDWAD

  • Lieutenant
  • **
  • Posts: 56
    • View Profile
How do you Spawn a Nexus with the console command mod?
« on: October 16, 2019, 09:37:29 PM »

Earlier i was told i could spawn stations and specifically a [REDACTED] Nexus in a system with the console command mod. Ive been trying but there are no commands for such a thing nor runcode's that exist for it.
Does anyone know how you would spawn a Nexus on your location similar to this runcode that spawns stable locations?:
runcode PlanetAPI star = ((StarSystemAPI) $loc).getStar(); if (star != null) { $loc.addCustomEntity(null, null, "stable_location", "neutral").setCircularOrbitPointingDown(star, VectorUtils.getAngle(star.getLocation(), $playerFleet.getLocation()), MathUtils.getDistance(star.getLocation(), $playerFleet.getLocation()), 180f); }
Logged

SYDWAD

  • Lieutenant
  • **
  • Posts: 56
    • View Profile
Re: How do you Spawn a Nexus with the console command mod?
« Reply #1 on: October 17, 2019, 04:27:55 PM »

Bump

also
Quote from: LazyWizard
ping
Logged

Histidine

  • Admiral
  • *****
  • Posts: 4693
    • View Profile
    • GitHub profile
Re: How do you Spawn a Nexus with the console command mod?
« Reply #2 on: October 18, 2019, 05:46:42 AM »

Code excerpt from RemnantThemeGenerator.addBattlestations. Figure out how to set it up as a console command.

Code: java
	EntityLocation loc = pickCommonLocation(random, data.system, 200f, true, null);

String type = stationTypes.pick();
if (loc != null) {

CampaignFleetAPI fleet = FleetFactoryV3.createEmptyFleet(Factions.REMNANTS, FleetTypes.BATTLESTATION, null);

FleetMemberAPI member = Global.getFactory().createFleetMember(FleetMemberType.SHIP, type);
fleet.getFleetData().addFleetMember(member);

fleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_MAKE_AGGRESSIVE, true);
fleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_NO_JUMP, true);
fleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_MAKE_ALLOW_DISENGAGE, true);

fleet.setStationMode(true);

addRemnantStationInteractionConfig(fleet);

data.system.addEntity(fleet);

fleet.clearAbilities();
fleet.addAbility(Abilities.TRANSPONDER);
fleet.getAbility(Abilities.TRANSPONDER).activate();
fleet.getDetectedRangeMod().modifyFlat("gen", 1000f);

fleet.setAI(null);

setEntityLocation(fleet, loc, null);
convertOrbitWithSpin(fleet, 5f);

boolean damaged = type.toLowerCase().contains("damaged");
float mult = 25f;
int level = 20;
if (damaged) {
mult = 10f;
level = 10;
fleet.getMemoryWithoutUpdate().set("$damagedStation", true);
}
PersonAPI commander = OfficerManagerEvent.createOfficer(
Global.getSector().getFaction(Factions.REMNANTS), level, true);
if (!damaged) {
commander.getStats().setSkillLevel(Skills.GUNNERY_IMPLANTS, 3);
}
FleetFactoryV3.addCommanderSkills(commander, fleet, random);
fleet.setCommander(commander);
fleet.getFlagship().setCaptain(commander);


member.getRepairTracker().setCR(member.getRepairTracker().getMaxCR());

result.add(fleet);
}
Logged

SYDWAD

  • Lieutenant
  • **
  • Posts: 56
    • View Profile
Re: How do you Spawn a Nexus with the console command mod?
« Reply #3 on: October 18, 2019, 01:18:23 PM »

Code excerpt from RemnantThemeGenerator.addBattlestations.

You're a saint Histidine, thank you for the help so far.
Logged

SYDWAD

  • Lieutenant
  • **
  • Posts: 56
    • View Profile
Re: How do you Spawn a Nexus with the console command mod?
« Reply #4 on: October 18, 2019, 04:12:21 PM »

im trying but i dont think im capable of turning that into one of their run commands...
ive got barley any understanding of coding
Logged