Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Planet Search Overhaul (07/13/24)

Author Topic: How do you delete a stable location?  (Read 1629 times)

CodeWannaB

  • Ensign
  • *
  • Posts: 2
    • View Profile
How do you delete a stable location?
« on: April 25, 2021, 02:37:13 AM »

Hello I am using the console mod and i was wondering if there is a way to remove a stable location. If someone has a code for that I would be grateful. ;D
Logged

SectorFarer_37?

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: How do you delete a stable location?
« Reply #1 on: April 21, 2024, 02:27:52 PM »

Apologies for being ridiculously late, but if in over 2 years you haven't been able to figure it out, this is a code you can use to delete any stable locations/jump points/planets that exist, including ones created by commands.

runcode SectorEntityToken ent = Global.getSector().getCampaignUI().getCurrentInteractionDialog().getInteractionTarget();
if (ent.getMarket() != null) Global.getSector().getEconomy().removeMarket(ent.getMarket());
ent.getContainingLocation().removeEntity(ent);

You have to be in orbit of them first, though - you can't remotely delete them from across the map.
Logged

XM16E

  • Ensign
  • *
  • Posts: 6
    • View Profile
Re: How do you delete a stable location?
« Reply #2 on: April 21, 2024, 10:40:39 PM »

Also trying to delete jump points.
The script didn't work got "Execution Failed: java.lang.Nullpointer exception"
Using [Console Commands v2023.05.05] version edited to work with 97a-RC11 and using the Java 8 updated JRE for Starsector
The only thing I noticed with the error is that at the top Console Commands says "CAMPAIGN_MAP Target: None" Which tells me the jump point I'm orbiting is not being selected as a target for the runcode script.

Edit: Turns out I had to Interact with it (bring up it's interaction screen) and then copy+paste the runcode script to make it work.
« Last Edit: April 21, 2024, 10:50:39 PM by XM16E »
Logged