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: Simulator Enhancements (03/13/24)

Pages: 1 ... 50 51 [52] 53 54 ... 93

Author Topic: [0.96a] Console Commands v2023.05.05  (Read 1535548 times)

Plasmatic

  • Admiral
  • *****
  • Posts: 500
  • Curious no?
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #765 on: January 18, 2020, 05:21:18 AM »

Anyway there to ban me from this mod lol i cannot help but cheat once i found this and its bugging me. lol
uninstall it? :)
Logged
"Better to remain silent and be thought a fool than to speak out and remove all doubt"
- Maurice Switzer

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #766 on: January 18, 2020, 12:51:37 PM »

Any way to change the shortcut to open the console window?

I dont have an English keyboard and I am unable to open the console with any combination of "CTRL+BACKSLASH".

I see someone already told you that it's actually control+backspace, but you can change the keystroke that summons the console with the Settings command.

If for some reason your keyboard doesn't have control or backspace, you can also change it manually by editing the "consoleKeystroke" field in saves/common/config/lw_console_settings.json.data. Set all the "true"s to "false" (these control if you need to hold shift, control, or alt), and the first number to the keycode of the key you want. Keycodes can be found here. If you wanted to summon the console by pressing 9, you'd look for VK_9, which has the keycode 57. So your "consoleKEystroke" would look like "consoleKeystroke": "57|false|false|false".

Yeah, using the settings command is much easier. :)


okay so for some reason what causes console command to crash... out of ALL THE THINGS IN EXISTANCE, is these two settings:

"decivSamplingMonths":16,
"decivMinStreak":3,

For some mystical reason, if you set these settings to bigger values (to prevent random deciv events) the game just refuses to open the console without crashing. I don't see how this is related but holy *** it took a lot of digging around to figure it out. Thing is for some reason changing those values after a save was created might or might not break console commands as well. I even tested it out and for some random reason sometimes it breaks it and other times its fine...

So there you go, I have no idea how this makes sense but hey, I didn't make the mod :3 

I think I also changed those values since I believe vanilla ones were smaller so I guess it has to do with back ground simulation freaking out.

That's incredibly weird. If anything I'd expect it to crash when the console closes, not when it first opens, since the game would be playing catch-up on however many thousands of frames it skipped. I'll look into it.


First off, I love the mod.

Though I'm having some issues, nothing crashing or anything, but i can't seem to get two commands to work..

Namingly \Clear\, and \Clear ships\

If I try storage\clear ships\ it says no such command
Storage\clear\ says the same thing

typeing in just clear simply clears the console, not my storage.

In reference to my earlier question, am I correct in assuming these clear commands are supposed to empty the storage? if so, how do I use them?

You want "storage clear" and "storage clear ships". I'll update Storage's help entry to be more clear (no pun intended).


Anyway there to ban me from this mod lol i cannot help but cheat once i found this and its bugging me. lol

A command to block access to the console on specific saves has been on my todo list for a while. I've just been lacking the motivation to mod for the last several months.


Ok. Current working code for adding planets is.
Code
 RunCode Global.getSector().getStarSystem("System_Name").addPlanet("Added_Planet_Name", Global.getSector().getStarSystem("System_Name").getStar(), "Added_Planet_Name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length) 
Code works great for spawning new planets in a star system. However, do you know how to spawn moons that orbit around a planet?

how to u get it to work? i get an unknown variable error for planet angle

@Coffeeboi: You'd have to do it manually. If you're docked with the planet you want to create a moon for, you can use $context.getEntityInteractedWith() as the anchor for an OrbitAPI you create, then spawn the moon with that orbit (which I _believe_ will handle the positioning of the planet for you).

@nuker22110: You need to replace the placeholder arguments. So Planet_Angle might be 140, Planet_Orbit_length might be 70, etc. You can find examples of addPlanet usage in starsector-core/data/scripts/world/corvus.Corvus.java. Runcode takes Java code as an argument, so checking the files in data/scripts is a good way to get ideas for how to use it.

Oh, and a general statement about runcode snippets: I'd recommend being _extremely_ careful with RunCode if you aren't a modder yourself. RunCode isn't a normal command. You're writing, compiling and running Java code at the same level as an actual mod, without any of the safeties the other console commands have to prevent you from breaking things. The benefit is that you can do almost anything a mod can do with this command, but the downside is you can ruin your savefile if you get something wrong, and mistakes might not be immediately apparent.
« Last Edit: January 18, 2020, 12:53:45 PM by LazyWizard »
Logged

Malleator

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #767 on: January 19, 2020, 08:49:10 AM »

Tried to use the code to add a stable point but I got the error in the screenshot.

This is what I use for stable locations.
Code
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);


Can anyone please help me understand how to fill out this command to create planets?
Code
RunCode Global.getSector().getStarSystem("System_Name").addPlanet("Added_Planet_Name", Global.getSector().getStarSystem("System_Name").getStar(), "Added_Planet_Name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length) 
From what I understand, I replace the "System_Name" variable with the system I want to spawn the planet in.
"Added_Planet_Name" is changed to whatever I want to name the planet. Correct me if wrong.
But I don't understand how to fill out: "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length

Can someone please provide a working example of the create planet command? Thanks.
Logged

Althalus

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #768 on: January 19, 2020, 02:13:34 PM »

Tried to use the code to add a stable point but I got the error in the screenshot.

This is what I use for stable locations.
Code
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);

That worked for me, thanks so much!
Logged

Malleator

  • Ensign
  • *
  • Posts: 24
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #769 on: January 20, 2020, 02:15:12 PM »

Is there an easy way, given a ship id, to find which mod it is from?
Additionally, is there a way to list the ids of the ships in the player's fleet?
« Last Edit: January 20, 2020, 02:40:34 PM by Malleator »
Logged

Rasip

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #770 on: January 20, 2020, 05:48:06 PM »

Any chance you can add a config option to disable nuke and "toggleai enemy off"?
Logged

qman

  • Ensign
  • *
  • Posts: 5
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #771 on: January 26, 2020, 02:07:15 PM »

Ok. Current working code for adding planets is.
Code
 RunCode Global.getSector().getStarSystem("System_Name").addPlanet("Added_Planet_Name", Global.getSector().getStarSystem("System_Name").getStar(), "Added_Planet_Name", "Planet_type", Planet_Angle, Planet_Size, Planet_orbit_radius, Planet_Orbit_length) 

how would you use this code to create a terran world in the Beta Morvah star system?
Logged

JNexus

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #772 on: January 30, 2020, 11:07:41 AM »

Hi there! Really usefull mod.
I was wondering if there's any command to "move" a jump point inside a system. Like relocating it.

 Because the system i choose to colonize first has this Inner Jump Point inside my red star corona (i suppose it is a "bug" of Unknown Skies, the red star is bigger than vanilla).
I didn't think AI would ammass just outside it a lot of fleets, trying to reach the jump point then fall back, damaging themselves and repeat till they die. My trade convoys too of course.

Spoiler
[close]

« Last Edit: January 30, 2020, 01:15:31 PM by JNexus »
Logged

Rasip

  • Ensign
  • *
  • Posts: 32
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #773 on: January 30, 2020, 01:30:04 PM »

I don't know of a command to move a jump point, but i have seen them close enough to giant stars to take damage trying to jump without unknown skies. I know i have seen that with nothing but Nexerelin and think i have in vanilla.

Making giants bigger probably makes it more common though.
Logged

e

  • Captain
  • ****
  • Posts: 288
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #774 on: February 03, 2020, 12:29:03 AM »

Is it possible to use console commands to change a planet's size? not to be confused with colony size, what i want is to change the actual planet.

If so, anyone knows a code for it?

Thanks!
Logged

MGD

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #775 on: February 07, 2020, 07:18:53 PM »

right, quick question, can you use the console to finish building something on a planet?
Logged

Mza325

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #776 on: February 08, 2020, 02:19:52 AM »

right, quick question, can you use the console to finish building something on a planet?

Fastbuild
Logged

Valikdu

  • Lieutenant
  • **
  • Posts: 51
  • Ruin... has come to our family.
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #777 on: February 13, 2020, 02:15:32 PM »

Would it be possible to make a command to remove a hullmod from a ship?
Logged
My Dwarf Fortress Mod: DESOLATION 1.5
My Channel: V. S. Cosplay

generalking007

  • Ensign
  • *
  • Posts: 1
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #778 on: February 13, 2020, 02:44:02 PM »

Stupid question, but i downloaded this mod and lazylib, but when i star my launcher, despite having both extracted into my mod folder, the only mod that shows in the mod lsit is lazylib, so i cant activate this mod, any idea why?
Logged

Simal

  • Ensign
  • *
  • Posts: 2
    • View Profile
Re: [0.9.1a] Console Commands v3.0 WIP 7.6 (released 2018-12-07)
« Reply #779 on: February 20, 2020, 03:39:08 PM »

Would there be a way to add built-in special hullmods like targeting supercomputer?
Logged
Pages: 1 ... 50 51 [52] 53 54 ... 93