Author Topic: Helpful Console Codes for BC  (Read 2960 times)

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Helpful Console Codes for BC
« on: May 07, 2008, 11:58:51 PM »
Hey, I was thinking it would be nice if we pooled our knowledge of BC console codes into one easy-to-access thread. I'll start.

Exit BC (in case of BSOD)
Code: [Select]
import sys
sys.exit()

Enter "Edit" mode (useful for making POTDs)
Code: [Select]
Edit()

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Helpful Console Codes for BC
« Reply #1 on: May 08, 2008, 12:37:53 PM »
Code: [Select]
App.g_kUtopiaModule.TakeScreenshot()
Takes a screenshot of the current screen, so, because you are in the console it will take a screenshot of the console as well.

There could be more, but you will need to wait for a mod of mine, which is going slowly.
This mod will include a "dump" command meaning you can dump the entire console to a file instead of just the visible part. And an clear command for clearing the console.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Helpful Console Codes for BC
« Reply #2 on: May 08, 2008, 08:10:05 PM »
Took these from a post MLeo made a while back to DJ Curtis.

Pause BC
Code: [Select]
App.g_kUtopiaModule.Pause(1)Un-pause BC
Code: [Select]
App.g_kUtopiaModule.Pause(0)

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Helpful Console Codes for BC
« Reply #3 on: May 09, 2008, 05:14:15 AM »
Then you would also like to know about these:
Code: [Select]
import SimpleAPI
SimpleAPI.Speed(0.5)

And
Code: [Select]
import SimpleAPI
SimpleAPI.Speed(8)
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Picard_1

  • Guest
Re: Helpful Console Codes for BC
« Reply #4 on: May 09, 2008, 06:18:55 PM »
Isn't there one for cloaking too?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Helpful Console Codes for BC
« Reply #5 on: May 09, 2008, 06:26:29 PM »
Well, assuming a ship has a cloak, you can do this:

For the player:
Code: [Select]
App.Game_GetCurrentPlayer().GetCloakingSubsystem().InstantCloak()
App.Game_GetCurrentPlayer().GetCloakingSubsystem().InstantDecloak()
Or:
Code: [Select]
App.Game_GetCurrentPlayer().GetCloakingSubsystem().StartCloaking()
App.Game_GetCurrentPlayer().GetCloakingSubsystem().StopCloaking()

The latter is used for normal cloaking.

For any other ship:
Code: [Select]
pSet = App.Game_GetCurrentPlayer().GetContainingSet()
pShip = App.ShipClass_Cast(pSet.GetObject("Name of Ship"))
pShip.GetCloakingSubsystem()............ I think you get the drift. ;)


There are also these neat functions in App:
Code: [Select]
CloakingSubsystem_SetCloakTime
CloakingSubsystem_GetCloakTime
CloakingSubsystem_SetShieldDelay
CloakingSubsystem_GetShieldDelay
But these functions are "global", meaning, they affect all ships.

So I'm afraid no variable cloaking for different ships. :(
Yes, I've tried that.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline cnotsch

  • Posts: 85
  • Cookies: 3
Re: Helpful Console Codes for BC
« Reply #6 on: May 13, 2008, 09:46:05 AM »
You can exit a BSOD easyly by pressing Alt+F4  :?

Offline ChronowerX_GT

  • ChronowerX Productions - Founder
  • Posts: 809
  • Cookies: 36
    • ChronowerX Productions
Re: Helpful Console Codes for BC
« Reply #7 on: May 13, 2008, 03:21:30 PM »
Hey Kirk when you use the edit function for a potd what do you do after you've typed it into the console? Nothing really comes up. KM 1.0


Having a smoking section in a restaurant is kinda like having a peeing section in a pool...

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Helpful Console Codes for BC
« Reply #8 on: May 14, 2008, 07:52:31 AM »
You can exit a BSOD easyly by pressing Alt+F4  :?
Never worked for me, and it doesn't work in normal BC either.

However, it does work when the debug console pops up.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Helpful Console Codes for BC
« Reply #9 on: May 14, 2008, 10:53:23 AM »
Hey Kirk when you use the edit function for a potd what do you do after you've typed it into the console? Nothing really comes up. KM 1.0
Keep in mine, it must be Edit()

When you enter "Edit mode" a menu, which I have had little success in using and understanding, should pop up. You can roatate the camera with your mouse and move the camera forward/backward with the up/down arrow keys as well as left/right with the corresponding arrow keys. The only down side is that there is a display in the bottom left of the screen that indicates the camera position. I'm unsure if there can be a script made that removes these numbers.

Offline cnotsch

  • Posts: 85
  • Cookies: 3
Re: Helpful Console Codes for BC
« Reply #10 on: May 14, 2008, 01:31:25 PM »
I think for being able to close it with alt+f4 you have to have the console logger installed & enabled. In my install it is in Autoexec.py in the scripts directory - don't know wich mod braught that with it, I assume it was KM1...