Author Topic: Re: A little treat for debugging excalibur!  (Read 3889 times)

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« on: July 12, 2008, 08:59:06 AM »
*In response to: http://bc-central.net/forums/index.php/topic,3873.msg75396.html#msg75396 *

What problems are you getting then? Sorry for the hijack.
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: A little treat for debugging excalibur!
« Reply #1 on: July 12, 2008, 09:17:36 AM »
None (yet,) but it would nice to just fix a small plugin error and then just hit the restart button.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« Reply #2 on: July 12, 2008, 09:28:01 AM »
BC: Foundation has a "Oh, an error? Oh well, this is the error, next!". Meaning you can reload the module (with the plugin) anyway.
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: A little treat for debugging excalibur!
« Reply #3 on: July 12, 2008, 11:04:14 AM »
So if I get a BSOD on start-up, I can simply reload the faulty plugin and BC will start up. How would I do this?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« Reply #4 on: July 12, 2008, 11:16:59 AM »
I'll split this topic soon (didn't realise this was in BC Scripting :P)

With various degrees of possibility, either you do (from the console) an import to the module the plugin is defined (ie. import Custom.Ships.<<YourShip>>) and then do reload(Custom.Ships.<<YourShip>>) or if that fails (or if the first fails) it gets a bit trickier but this would work:
import sys
del sys.modules["Custom.Ships.<<YourShip>>"]
import Custom.Ships.YourShip

Btw, this assumes you have already fixed the problem!
And mostlikely won't work from inside QB since the (ship) menu has already been built.


But this would only be in BC:Foundation, which nobody has yet (I only have it partially :P).

In the current BC it's also possible, but you would have to restart the Load plugins section, which is slightly more convoluted to do. But luckily it won't load the same module twice.

[EDIT] I should say that from a BSOD it would be rather hard to do this, I do admit 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 Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: A little treat for debugging excalibur!
« Reply #5 on: July 12, 2008, 11:28:45 AM »
:? That's why a restart button would be nice. I now look forward to BC: Foundation.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« Reply #6 on: July 12, 2008, 11:36:04 AM »
I didn't say impossible, just hard, you need a good grasp of how BC does things, and what has already happend.
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: A little treat for debugging excalibur!
« Reply #7 on: July 12, 2008, 11:47:10 AM »
you need a good grasp of how BC does things
I kind of understand it.
and what has already happend.
Typically I do.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« Reply #8 on: July 12, 2008, 12:02:05 PM »
Then tell me where does (in the scripts) BC start?
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: A little treat for debugging excalibur!
« Reply #9 on: July 12, 2008, 12:17:12 PM »
If I had to take a guess, it would be by loading the scripts/MainMenu folder (mainly mainmenu.py) because foundation and anything that relies on foundation (like anything in Custom/Autoload) wasn't originally in BC, and thus won't be called first. (Plus mainmenu loads foundation.)

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« Reply #10 on: July 12, 2008, 12:18:50 PM »
I'm not talking about that.

A module is just that, a module.


[EDIT] Hint, GUI is just created by Python code.
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: A little treat for debugging excalibur!
« Reply #11 on: July 12, 2008, 12:34:46 PM »
A module is just that, a
word kirk does not understand. (I apparently knew much less than I thought I did. :( But, I still want to learn, and understand this.)

My second guess would be App.py (or is that another module? :?) As killing that doesn't allow BC to load the console (or anything.)

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« Reply #12 on: July 12, 2008, 12:37:57 PM »
Modules just store values (can be "real" values or functions).

BC calls (from the exe) several functions in various modules.

So modules are the .py(c) files you see.
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: A little treat for debugging excalibur!
« Reply #13 on: July 12, 2008, 02:10:16 PM »
Ok, so anything that is in .py/.pyc format is a module (in BC's case anyways.)

So,
I'm not talking about that.
What are you talking about?

The only things I see in scripts are modules. And if the first thing BC loads is in scripts
Then tell me where does (in the scripts) BC start?
And yet is not a module.
A module is just that, a module.
Then I am at a complete loss. (Again, please me patient with me, this is something I want to understand)

(Thread should be renamed, "Understanding BC: For Dummies")

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« Reply #14 on: July 12, 2008, 02:12:47 PM »
Sure, it loads a module, but then it calls a function in that module.
And if you want to continue from a bsod, you need to know the functions. ;)
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: A little treat for debugging excalibur!
« Reply #15 on: July 12, 2008, 02:15:18 PM »
Aaahhhh! :D So I need to locate the function the starts BC? Will try.

Edit: So am I correct that the module the function is in is App.py(c)?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« Reply #16 on: July 12, 2008, 02:17:37 PM »
Look at BC:Core in this forum, then add to each method a print statement (or use bcdebug, which you would need to add) and then run it. Assuming Foundation runs before (or nearly before) all that, you can fix the error in Foundation, and then do the startup yourself.
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 USS Frontier

  • Posts: 176
  • Cookies: 562
Re: A little treat for debugging excalibur!
« Reply #17 on: July 13, 2008, 11:02:55 AM »
lol in case of a BSOD, I think it's easier to close the game, open the faulty script and fix it :P


Then tell me where does (in the scripts) BC start?
Would it be one of those python scripts that are compiled in the exe?
Like 'SimpleAPI', 'Appc' or 'new'?  These are the only, *I think*, BC-related (that is, not a script from the regular python build) scripts in the exe.
"Revenge is a dish best served cold"
                    -Old Klingon Proverb
GravityFX Download
Galaxy Charts Download

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: A little treat for debugging excalibur!
« Reply #18 on: July 13, 2008, 04:21:46 PM »
MainMenu first, with 3 to 4 (maybe more, can't completely remember) functions.
In correct order, all of which are normally called from the exe itself (according to some mystic script :P).
Display.py is used (Initialized).
TopWindow.py
StylizedWindow.py (btw, you can create new STStylizedWindow styles!)



Oh, and all this may not be in order or even complete.
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.