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: Anubis-class Cruiser (12/20/24)

Pages: 1 ... 86 87 [88] 89 90 ... 98

Author Topic: [0.97a] Console Commands v2024.10.04  (Read 1776772 times)

Selfcontrol

  • Commander
  • ***
  • Posts: 175
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1305 on: July 12, 2023, 09:11:16 AM »

Suggestion: currently the AddOfficer command can only create male officers, would be good to be able to choose gender, it has effects on dialogue and stuff.

Addofficer does not only create male officer. It's random. I use it from time to time and I get female officers (female name and portrait) too.
Logged

FlareFluffsune

  • Ensign
  • *
  • Posts: 6
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1306 on: July 13, 2023, 05:19:39 AM »

Can I use this to complete missions quickly?
Logged

Mikomikomiko

  • Ensign
  • *
  • Posts: 30
    • View Profile
    • Kitbash album. Not a modder, just a bote maker :P
Re: [0.96a] Console Commands v2023.05.05
« Reply #1307 on: July 14, 2023, 10:02:18 PM »

Suggestion: currently the AddOfficer command can only create male officers, would be good to be able to choose gender, it has effects on dialogue and stuff.

Addofficer does not only create male officer. It's random. I use it from time to time and I get female officers (female name and portrait) too.

I believe the person above you meant with regards to the campaign.xml where the new officer will have

g="MALE"></n>

regardless of portrait and name when you open the save file
Logged

d_ted

  • Ensign
  • *
  • Posts: 4
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1308 on: July 15, 2023, 07:23:02 PM »

Howdy;

You probably though about it but I'm gonna' write it anyway.

It would be awesome to use UP (and DOWN) key to... uuum... search previous (and next with DOWN) commands we wrote before. I don't know how but -for example- Crusader Kings 2 and 3 save your commands on a text file and bring them back even if you quit and restart the game a year later. Cool ehh? ;D
Logged

GriffinMan

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1309 on: July 20, 2023, 04:18:40 AM »

Hi, I'm currently trying to get a multi-moon planet to spawn as a test but every time I try I just get a "java.lang.NullPointerException" error and I only get a single planet with one moon and I'm not sure why (Being fair, I have no coding experience and am hacking this together by looking at other code that worked and trying to expand this. 
For reference:
Spoiler
Code
runcode import com.fs.starfarer.api.util.Misc; String planetName = "Invictus"; String moonName = "Vitae"; String moon2Name = "Neptunia"; String moon3Name = "Nidvallir"; float planetOrbitDays = 180; float planetSize = 200; float moonOrbitRadius = planetSize * 4; float moonRadius = planetSize / 4; float moonOrbitDays = 40; float moon2OrbitRadius = planetSize * 6; float moon2Radius = planetSize / 6; float moon2OrbitDays = 60; float moon3OrbitRadius = planetSize * 8; float moon3Radius = planetSize / 6; float moon3OrbitDays = 40; Vector2f playerCoords = $playerFleet.getLocation(); float angleCCW = Misc.getAngleInDegreesStrict(playerCoords); StarSystemAPI sys = (StarSystemAPI)$playerFleet.getContainingLocation(); PlanetAPI star = sys.getStar(); float orbitRadius = Misc.getDistance(star.getLocation(), playerCoords); PlanetAPI planet = sys.addPlanet(planetName, star, planetName, "terran", angleCCW, planetSize, orbitRadius, planetOrbitDays ); MarketAPI market = sys.getEntityById(planetName).getMarket(); market.addCondition("organics_plentiful"); market.addCondition("farmland_bountiful"); market.addCondition("ore_ultrarich"); market.addCondition("rare_ore_ultrarich"); market.addCondition("volatiles_plentiful"); market.addCondition("habitable"); market.addCondition("mild_climate"); market.addCondition("solar_array"); PlanetAPI moon = sys.addPlanet(moonName, planet, moonName, "terran", 0, moonRadius, moonOrbitRadius, moonOrbitDays); market = sys.getEntityById(moonName).getMarket(); market.addCondition("organics_plentiful"); market.addCondition("farmland_bountiful"); market.addCondition("ore_ultrarich"); market.addCondition("rare_ore_ultrarich"); market.addCondition("volatiles_plentiful"); market.addCondition("habitable"); market.addCondition("mild_climate"); market.addCondition("solar_array"); sys.addCustomEntity(null, null, "comm_relay", "player").setCircularOrbitPointingDown(planet, 90, moonOrbitRadius, moonOrbitDays); sys.addCustomEntity(null, null, "nav_buoy", "player").setCircularOrbitPointingDown(planet, 180, moonOrbitRadius, moonOrbitDays); sys.addCustomEntity(null, null, "sensor_array", "player").setCircularOrbitPointingDown(planet, 270, moonOrbitRadius, moonOrbitDays); PlanetAPI moon2 = sys.addPlanet(moon2Name, planet, moon2Name, "ocean", 0, moon2Radius, moon2OrbitRadius, moon2OrbitDays); market = sys.getEntityById(moon2Name).getMarket(); market.addCondition("organics_plentiful"); market.addCondition("farmland_bountiful"); market.addCondition("ore_ultrarich"); market.addCondition("rare_ore_ultrarich"); market.addCondition("volatiles_plentiful"); market.addCondition("habitable"); market.addCondition("mild_climate"); market.addCondition("solar_array"); sys.addCustomEntity(null, null, "comm_relay", "player").setCircularOrbitPointingDown(planet, 90, moon2OrbitRadius, moon2OrbitDays); sys.addCustomEntity(null, null, "nav_buoy", "player").setCircularOrbitPointingDown(planet, 180, moon2OrbitRadius, moon2OrbitDays); sys.addCustomEntity(null, null, "sensor_array", "player").setCircularOrbitPointingDown(planet, 270, moon2OrbitRadius, moon2OrbitDays); PlanetAPI moon3 = sys.addPlanet(moonName, planet, moonName, "barren", 0, moon3Radius, moon3OrbitRadius, moon3OrbitDays); market = sys.getEntityById(moon3Name).getMarket(); market.addCondition("organics_plentiful"); market.addCondition("farmland_bountiful"); market.addCondition("ore_ultrarich"); market.addCondition("rare_ore_ultrarich"); market.addCondition("volatiles_plentiful"); market.addCondition("habitable"); market.addCondition("mild_climate"); market.addCondition("solar_array"); sys.addCustomEntity(null, null, "comm_relay", "player").setCircularOrbitPointingDown(planet, 90, moon3OrbitRadius, moon3OrbitDays); sys.addCustomEntity(null, null, "nav_buoy", "player").setCircularOrbitPointingDown(planet, 180, moon3OrbitRadius, moon3OrbitDays); sys.addCustomEntity(null, null, "sensor_array", "player").setCircularOrbitPointingDown(planet, 270, moon3OrbitRadius, moon3OrbitDays);
[close]
Logged

Ed Wood

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: [0.95a] Console Commands v2021.03.27
« Reply #1310 on: July 25, 2023, 01:40:19 AM »

Some handy snippets to be saved in this thread.

Change limit of industries on planet:
Code
runcode String marketName = "YourPlanetMarket"; int modifier = 10; MarketAPI market = CommandUtils.findBestMarketMatch(planetName); if (market == null) { Console.showMessage("Error - market not found: " + marketName); return; } market.getStats().getDynamic().getMod("max_industries").modifyFlat("playerCustomIndustryMod", modifier);
Market IDs can be listed with "list markets".
[close]

Add industry or structure to build queue
Code
runcode import com.fs.starfarer.api.util.MutableValue; String marketName = "YourMarketName"; String industryID = "QueuedIndustryID"; IndustrySpecAPI spec = Global.getSettings().getIndustrySpec(industryID); if (spec == null) { Console.showMessage("Error - industry not found: " + industryID); return; } int industryCost = (int)spec.getCost(); MutableValue credits = Global.getSector().getPlayerFleet().getCargo().getCredits(); if (industryCost > (int) credits.get()) { Console.showMessage("Error - too expensive:" + industryCost); return; } credits.subtract(industryCost); MarketAPI market = CommandUtils.findBestMarketMatch(marketName); if (market == null) { Console.showMessage("Error - market not found: " + marketName); return; } if (market.getConstructionQueue().hasItem(industryID)) { Console.showMessage("Error - market already has " + industryID); return; } market.getConstructionQueue().addToEnd(industryID, industryCost); Console.showMessage("Success - queued construction of " + industryID + " on " + marketName + " for " + industryCost);
Building IDs can be listed with "list industries".
UI currently supports only 12 buildings and shows them in sorted order, no matter the sequence in which player added them. If building over the UI limit, hidden (last sorted) ones would be: ground defense, patrol hq, cryo revival facility.
[close]

Add a perfect planet with moon and satellites at fleet location
Code
runcode import com.fs.starfarer.api.util.Misc; String planetName = "YourPlanetName"; String moonName = "YourMoonName"; float planetOrbitDays = 180; float planetSize = 200; float moonOrbitRadius = planetSize * 4; float moonRadius = planetSize / 4; float moonOrbitDays = 40; Vector2f playerCoords = $playerFleet.getLocation(); float angleCCW = Misc.getAngleInDegreesStrict(playerCoords); StarSystemAPI sys = (StarSystemAPI)$playerFleet.getContainingLocation(); PlanetAPI star = sys.getStar(); float orbitRadius = Misc.getDistance(star.getLocation(), playerCoords); PlanetAPI planet = sys.addPlanet(planetName, star, planetName, "terran", angleCCW, planetSize, orbitRadius, planetOrbitDays ); MarketAPI market = sys.getEntityById(planetName).getMarket(); market.addCondition("organics_plentiful"); market.addCondition("farmland_bountiful"); market.addCondition("ore_ultrarich"); market.addCondition("rare_ore_ultrarich"); market.addCondition("volatiles_plentiful"); market.addCondition("habitable"); market.addCondition("mild_climate"); market.addCondition("solar_array"); PlanetAPI moon = sys.addPlanet(moonName, planet, moonName, "terran", 0, moonRadius, moonOrbitRadius, moonOrbitDays); market = sys.getEntityById(moonName).getMarket(); market.addCondition("organics_plentiful"); market.addCondition("farmland_bountiful"); market.addCondition("ore_ultrarich"); market.addCondition("rare_ore_ultrarich"); market.addCondition("volatiles_plentiful"); market.addCondition("habitable"); market.addCondition("mild_climate"); market.addCondition("solar_array"); sys.addCustomEntity(null, null, "comm_relay", "player").setCircularOrbitPointingDown(planet, 90, moonOrbitRadius, moonOrbitDays); sys.addCustomEntity(null, null, "nav_buoy", "player").setCircularOrbitPointingDown(planet, 180, moonOrbitRadius, moonOrbitDays); sys.addCustomEntity(null, null, "sensor_array", "player").setCircularOrbitPointingDown(planet, 270, moonOrbitRadius, moonOrbitDays);
Code of adding a derelict cryosleeper was posted somewhere in this thead. Reposting it here:
Spoiler
Code
runcode PlanetAPI star = ((StarSystemAPI) $loc).getStar(); if (star != null) { $loc.addCustomEntity(null, null, "derelict_cryosleeper", "player").setCircularOrbitPointingDown(star, VectorUtils.getAngle(star.getLocation(), $playerFleet.getLocation()), MathUtils.getDistance(star.getLocation(), $playerFleet.getLocation()), 400f); }
[close]
[close]

Add satellites at system center
Code
runcode $loc.addCustomEntity(null, null, "comm_relay", "player").setFixedLocation(0,0);$loc.addCustomEntity(null, null, "nav_buoy", "player").setFixedLocation(0,0);$loc.addCustomEntity(null, null, "sensor_array", "player").setFixedLocation(0,0);
[close]

This console mod is awesome. Game API and scripts, provided with installation, are very handy. I can't think of other game that provided such raw access to everything, for those situations when you're not content with how things are.
Is there a way to run this without spawning the nav buoy and such? I tried deleting the parts that spawn them, but keep getting a nullpointer error. Also, is there a way to spawn the solar array entities in orbit?

Any progress with the solar array?
I also like to know how to spawn solar array to a planet...
PLOX beautiful people of mass editing solve this problem to me!
Logged

ZeroXSEED

  • Ensign
  • *
  • Posts: 9
    • View Profile
Re: [0.95a] Console Commands v2021.04.10
« Reply #1311 on: July 27, 2023, 08:18:47 AM »

Spawning a gas giant:

Code
runcode import com.fs.starfarer.api.util.Misc; String planetName = "Gigantus"; float planetOrbitDays = 2000; float planetSize = 300;  Vector2f playerCoords = $playerFleet.getLocation(); float angleCCW = Misc.getAngleInDegreesStrict(playerCoords); StarSystemAPI sys = (StarSystemAPI)$playerFleet.getContainingLocation(); PlanetAPI star = sys.getStar(); float orbitRadius = Misc.getDistance(star.getLocation(), playerCoords); PlanetAPI planet = sys.addPlanet(planetName, star, planetName, "gas_giant", angleCCW, planetSize, orbitRadius, planetOrbitDays ); MarketAPI market = sys.getEntityById(planetName).getMarket(); market.addCondition("volatiles_plentiful"); market.addCondition("IndEvo_RuinsCondition"); market.addCondition("US_floating"); market.addCondition("ruins_vast");

Spawning a coronal tap:

Code
runcode import com.fs.starfarer.api.util.Misc; String planetName = "Gigantus"; Vector2f playerCoords = $playerFleet.getLocation(); float angleCCW = Misc.getAngleInDegreesStrict(playerCoords); StarSystemAPI sys = (StarSystemAPI)$playerFleet.getContainingLocation(); PlanetAPI star = sys.getStar(); float orbitRadius = Misc.getDistance(star.getLocation(), playerCoords); sys.addCustomEntity(null, null, "coronal_tap", null).setCircularOrbitPointingDown(star, angleCCW, orbitRadius, 360);

I am author of coronal tap one, but couldn't figure out how to make the special effects work... the game rules effect work fine ,but you won't see the star glowing more and the gas flowing like you see in systems where the tap was generated on game start.

Hey speeder, does the same command can spawn ice giant?
Logged

Kat

  • Ensign
  • *
  • Posts: 39
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #1312 on: August 05, 2023, 09:30:39 AM »

Is there an equivalent command to the one in Nexerelin to change the owner of a planet ?

What I want to do is to populate a few more of the moons and planets, and give them to various factions.

There is not, though it'd be easy to add one. I'll add it to the todo list.

Any word on this ?
Logged

Jack Ardan

  • Ensign
  • *
  • Posts: 39
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1313 on: August 05, 2023, 12:56:42 PM »

Is there a way to make bounty missions that i accepted

go from 120 days to 240 days ?
(make it not expire)
Logged

devildrive04

  • Ensign
  • *
  • Posts: 3
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1314 on: August 17, 2023, 02:10:21 PM »

Is there a command to copy and paste codes from the forums to the game?
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 3854
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1315 on: August 17, 2023, 03:38:42 PM »

Is there a command to copy and paste codes from the forums to the game?
control-v will paste the contents of the OS-level clipboard into console commands' console. Copying from the forum to the OS-level clipboard is OS-dependent, however; in many cases that will be control-c, but it might also be command-c, depending.
Logged
Wyvern is 100% correct about the math.

DerkaDur

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1316 on: August 19, 2023, 08:49:41 PM »

Is there a command that lets you find a derelict ship, like the Halbmond from Tahlan? I tried toying around but I'm not sure what command would tell me its location on the map.
Logged

SpaceDrake

  • Admiral
  • *****
  • Posts: 548
  • Piloting space mecha for fun and profit(?)
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1317 on: August 19, 2023, 09:42:14 PM »

Here's a bit of an odd one: is there a known console command or runcode for assigning a Vayra's Sector bounty-on-player to the player on demand? It's something I'd like to do as part of a challenge run I have in mind.
Logged

Kadatherion

  • Lieutenant
  • **
  • Posts: 60
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1318 on: August 20, 2023, 03:05:36 AM »

Is there a command that lets you find a derelict ship, like the Halbmond from Tahlan? I tried toying around but I'm not sure what command would tell me its location on the map.

Not here, but there's one in the ship browser mod (which itself was part of another console addon mod that got merged into that). BUT I've got to add the command, which has worked perfectly fine in my older runs, breaks in my current one. It does list some of the derelicts before stopping for a java error, which leads me to believe it probably is a faulty mod interaction rather than an issue with the command per se, but it also means your mileage may vary depending on your modlist.
Logged

DerkaDur

  • Ensign
  • *
  • Posts: 15
    • View Profile
Re: [0.96a] Console Commands v2023.05.05
« Reply #1319 on: August 21, 2023, 10:40:05 PM »

Oh cool, is that the SCVE mod?
Logged
Pages: 1 ... 86 87 [88] 89 90 ... 98