Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: [0.96a] Add Stable Locations using Console Commands  (Read 4366 times)

Uxion

  • Ensign
  • *
  • Posts: 23
    • View Profile
[0.96a] Add Stable Locations using Console Commands
« on: August 13, 2023, 07:21:57 PM »

I made this mod because I wanted to add more Stable Locations in a system.
Obviously this is a cheat.

Instructions:
1) Park your fleet where you want to make a new Stable Location.
2) Open Console Commands
3) Type 'AddStableLocation'
4) Done

Requirements: Console Commands by LazyWizard

Credit to Histidine and Algester's posts, quoted below.

Editing the save is probably too complicated, but you can use the Console Commands mod with the following command (copy and paste):

Code: java
runcode SectorEntityToken fleet = Global.getSector().getPlayerFleet();  
      StarSystemAPI sys = (StarSystemAPI)fleet.getContainingLocation();
      SectorEntityToken stable = fleet.getContainingLocation().addCustomEntity(null, null, "stable_location", "neutral");
      float orbitRadius = com.fs.starfarer.api.util.Misc.getDistance(fleet, sys.getCenter());
      float orbitDays = orbitRadius / (20f + new Random().nextFloat() * 5f);
      float angle = com.fs.starfarer.api.util.Misc.getAngleInDegrees(sys.getCenter().getLocation(), fleet.getLocation());
      stable.setCircularOrbit(sys.getCenter(), angle, orbitRadius, orbitDays);
This creates a new stable location at your fleet's current location. You can tweak orbitDays for realism if you want.

this is the more simplified version of the Stable Location based on the player location found way earlier of this forum post you can search for it though unless you are a lazy person
Code
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); }
you can change stable location to "nav_buoy", "comm_relay", "sensor_array" while adding "nav_buoy_makeshift" so on and so forth turns them into makeshift variants

I got autogenerate Hyperspace jump points to work
Code
runcode Global.getSector().getStarSystem("System Name").autogenerateHyperspaceJumpPoints(true,true)
// the first true statement is for Gas Giants
// the second true statement is for generating Fringe Jump Points
Logged

Enceos

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: [0.96a] Add Stable Locations using Console Commands
« Reply #1 on: January 02, 2024, 04:05:20 PM »

You're my hero! Not a cheat when the game generates no stable locations in a system with a habitable planet.
Logged

Enceos

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: [0.96a] Add Stable Locations using Console Commands
« Reply #2 on: January 16, 2024, 12:04:24 PM »

Just discovered that there's also a standard vanilla option which is limited to two stable locations:

Screenshot
[close]
« Last Edit: January 16, 2024, 12:05:57 PM by Enceos »
Logged