1
Mods / Re: [0.95a] Console Commands v2021.04.10
« on: May 10, 2021, 01:03:48 AM »
I'm trying to get a code that spawns a jump point at the player location and I'm doing it repurposing the old Stable Location spawn code but it keeps erroring out
Is this just overcomplicating things or are my calls no longer active? This is from the past version
Spoiler
runcode Random rndm = new Random;
StarSystemAPI starSystem = Global.getSector().getPlayerFleet().getStarSystem();
JumpPointAPI newJumpPoint = Global.getFactory().createJumpPoint("console_added_jumppoint" + rndm.nextInt(), "Hyperspace Jump Point " + starSystem.getJumpPoints().size());
float distance = MathUtils.getDistance(Global.getSector().getPlayerFleet().getLocation(), starSystem.getStar().getLocation());
OrbitAPI newJumpPointOrbitAroundStar = Global.getFactory().createCircularOrbit(starSystem.getStar(), 0, distance, distance / 10);
newJumpPoint.setOrbit(newJumpPointOrbitAroundStar);
newJumpPoint.setStandardWormholeToHyperspaceVisual();
StarSystemAPI starSystem = Global.getSector().getPlayerFleet().getStarSystem();
JumpPointAPI newJumpPoint = Global.getFactory().createJumpPoint("console_added_jumppoint" + rndm.nextInt(), "Hyperspace Jump Point " + starSystem.getJumpPoints().size());
float distance = MathUtils.getDistance(Global.getSector().getPlayerFleet().getLocation(), starSystem.getStar().getLocation());
OrbitAPI newJumpPointOrbitAroundStar = Global.getFactory().createCircularOrbit(starSystem.getStar(), 0, distance, distance / 10);
newJumpPoint.setOrbit(newJumpPointOrbitAroundStar);
newJumpPoint.setStandardWormholeToHyperspaceVisual();
[close]
Is this just overcomplicating things or are my calls no longer active? This is from the past version