Bridge Commander Central
BC Forums => BC Scripting => Topic started by: MLeo 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.
-
None (yet,) but it would nice to just fix a small plugin error and then just hit the restart button.
-
BC: Foundation has a "Oh, an error? Oh well, this is the error, next!". Meaning you can reload the module (with the plugin) anyway.
-
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?
-
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.
-
:? That's why a restart button would be nice. I now look forward to BC: Foundation.
-
I didn't say impossible, just hard, you need a good grasp of how BC does things, and what has already happend.
-
you need a good grasp of how BC does things
I kind of understand it.
and what has already happend.
Typically I do.
-
Then tell me where does (in the scripts) BC start?
-
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.)
-
I'm not talking about that.
A module is just that, a module.
[EDIT] Hint, GUI is just created by Python code.
-
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.)
-
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.
-
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")
-
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. ;)
-
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)?
-
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.
-
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.
-
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.