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 [2] 3 4 ... 93

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

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #15 on: September 18, 2012, 11:17:31 AM »

Hah, very interesting. Haven't had a chance to try it, but kudos for putting this together :)
I don't suppose you would be willing to try the main branch and see if it runs in the latest development version? :D I've been using a lot of guesswork, but I'm almost certain it will work without tweaking given the changes you mentioned in our conversation.

Sure, I'll give it a try if you can post a download link. Not set up w/ Mercurial.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #16 on: September 18, 2012, 11:18:23 AM »

Logged
Please check out my SS projects :)
Xeno's Mod Pack

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #17 on: September 18, 2012, 11:18:34 AM »

You can grab it here: https://bitbucket.org/LazyWizard/sfconsole/get/default.zip
The mod folder is SFConsole in the zip.

Edit:
Linky
That's the released version, not the development version.
« Last Edit: September 18, 2012, 11:20:45 AM by LazyWizard »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #18 on: September 18, 2012, 11:24:38 AM »

You can grab it here: https://bitbucket.org/LazyWizard/sfconsole/get/default.zip
The mod folder is SFConsole in the zip.

Sweet - works like a charm. Very good work, sir - I think I'll just leave it enabled :)
Logged

CrashToDesktop

  • Admiral
  • *****
  • Posts: 3876
  • Quartermaster
    • View Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #19 on: September 18, 2012, 11:56:31 AM »

Psst! Be honored LazyWizard!
:)
Anyways, from what I've been playing around with, it's a pretty good tool.  Though I managed to *** up my system pretty badly after I changed some relations and money.  Very fun, and no doubt very useful when put to the right job.
Logged
Quote from: Trylobot
I am officially an epoch.
Quote from: Thaago
Note: please sacrifice your goats responsibly, look up the proper pronunciation of Alex's name. We wouldn't want some other project receiving mystic power.

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #20 on: September 18, 2012, 12:19:56 PM »

I realized I forgot to include the AddItem command (same as AddWeapon, but for CargoItemType.RESOURCE). I'll update the download link in a moment.

Sweet - works like a charm. Very good work, sir - I think I'll just leave it enabled :)

Wow, that's just awesome. Thank you for testing it, and I'm glad you like it. I hope it helps. :) I knew I should have put code in to upload the user's Starfarer directory...

Anyways, from what I've been playing around with, it's a pretty good tool.  Though I managed to *** up my system pretty badly after I changed some relations and money.  Very fun, and no doubt very useful when put to the right job.

You say that like spreading chaos isn't the right job.  ;D
Logged

doodlydee

  • Lieutenant
  • **
  • Posts: 57
    • View Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #21 on: September 18, 2012, 03:23:46 PM »

This is probably a stupid question how do you use the add ship command, I keep trying to add a onslaught but it keeps giving me a error saying variant id or something like that
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #22 on: September 18, 2012, 03:28:02 PM »

This is probably a stupid question how do you use the add ship command, I keep trying to add a onslaught but it keeps giving me a error saying variant id or something like that

You need to use the variant ID of the ship. You can find them in starfarer-core/data/variants (or a mod's data/variants folder). For example, "addship onslaught_Elite" should work.

If you don't know any of the variants, you can always just spawn an empty hull ("addship onslaught_Hull"), which is an auto-generated variant for every ship.
Logged

doodlydee

  • Lieutenant
  • **
  • Posts: 57
    • View Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #23 on: September 18, 2012, 03:34:33 PM »

Thanks for quick reply I just read that in your first post should have done that in first place stupid me, but thanks again
Logged

DeathPhoenyx

  • Ensign
  • *
  • Posts: 6
    • View Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #24 on: September 18, 2012, 04:32:08 PM »

Is there any way to edit the key that brings up the console? I am Spanish, therefore I use a Spanish keyboard and when I press the key that corresponds to your ~ (the one on the left of the 1) and nothing pops up. I have tried to change the keyboard's locale through the windows' language bar but that doesn't make it work.

Also, on a related note: the console pops up nomather in what part of the game are you (in combat, flying through the system, docked in a station etc) or is it more specific?
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #25 on: September 18, 2012, 04:37:16 PM »

Is there any way to edit the key that brings up the console? I am Spanish, therefore I use a Spanish keyboard and when I press the key that corresponds to your ~ (the one on the left of the 1) and nothing pops up. I have tried to change the keyboard's locale through the windows' language bar but that doesn't make it work.

Yes, you can change the key the console uses. You'll need to edit data.scripts.console.ConsoleManager. Just change CONSOLE_KEY (it's near the top of the file) from Keyboard.KEY_GRAVE to any of the keys listed on this page.

Quote
Also, on a related note: the console pops up nomather in what part of the game are you (in combat, flying through the system, docked in a station etc) or is it more specific?

It only works while on the campaign map, while the game is unpaused. This is because the keyboard handler is implemented as a spawn point, and checks for key input once per game frame on the campaign map. I might change this later. :)
Logged

DeathPhoenyx

  • Ensign
  • *
  • Posts: 6
    • View Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #26 on: September 18, 2012, 04:40:15 PM »

Well, that was a quick response. Thanks, I will try it out when I get an opportunity, will report back if something doesn't work.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #27 on: September 18, 2012, 04:45:26 PM »

I'm actually coding the next update of this mod in another window, so I can just tab over when my phone alerts me to a new reply. :)

Speaking of updates, what would be the equivalent key on a Spanish keyboard layout? I can make the next version change the default key based on the locale (or is that too obnoxious?).
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #28 on: September 18, 2012, 04:48:28 PM »

Hey, stupid question:  if I want to write some code that executes a command via the console, then runs the command and updates the text displayed in the console, how would I go about that, roughly? 

I'm trying to figure out how to get this thing to let me give the user some feedback, basically, while executing some commands.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1363
    • View Profile
    • GitHub Profile
Re: Unofficial Developer's Console (beta ready for download)
« Reply #29 on: September 18, 2012, 05:01:20 PM »

What do you mean, update the text displayed in the console? It's just an input popup, it's completely disposable.

And for security reasons, I set up the access modifiers in the mod to make it difficult to run commands through code. The only access point to command execution is through Console.getInput(), which spawns the popup window and handles input itself.

However, you can directly create a BaseCommand object and run it, but it might be buggy (you will have problems with commands that need access to the current location/starsystem or persistent variable storage if you haven't used the console this session, since certain references are only set when the console is called).

Example:
Code
     BaseCommand spawnShip = new AddShip();
     spawnShip.runCommand("onslaught_Elite");
Logged
Pages: 1 [2] 3 4 ... 93