Bridge Commander Central

BC Forums => BC Scripting => Topic started by: Kirk on July 17, 2008, 02:00:51 PM

Title: Reload Hardpoint
Post by: Kirk on July 17, 2008, 02:00:51 PM
Is it possible to reload a ship's hardpoint while ingame? I'm asking because I'm adding blinkers to a ship and it is getting very tedious to add property, load BC, load ship, close BC, add changes, load BC, etc.
Title: Re: Reload Hardpoint
Post by: JimmyB76 on July 17, 2008, 02:08:28 PM
interesting question...  in the past, i would try out a few different kinds of weapons for ship (pulses and such) to see how they would look ingame, and always i would have to exit BC, make the hp change with the new weapon, then reload BC to see the new weapon...
if there were a way to simply pause the game, load the new HP, and then unpause the game without having to exit and reload BC, that would have been useful and time-saving knowledge lol
Title: Re: Reload Hardpoint
Post by: CJLarkin on July 17, 2008, 02:08:58 PM
Could you try ending the current battle, Then restarting?
I.E. Play with ship, ALT-TAB, Modify & Save, go back in, load QB Scenario again ?
Title: Re: Reload Hardpoint
Post by: JimmyB76 on July 17, 2008, 02:09:52 PM
i suppose that is one way, i hadnt really considered that myself lol 
i wonder if that would work with all QB scripts (even scripts for bridges or other mods) when trying to fine-tune certain things...
Title: Re: Reload Hardpoint
Post by: Kirk on July 17, 2008, 02:12:50 PM
Could you try ending the current battle, Then restarting?
I.E. Play with ship, ALT-TAB, Modify & Save, go back in, load QB Scenario again ?
I will try that again, but I believe BC crashes when I exit qb.
Title: Re: Reload Hardpoint
Post by: CJLarkin on July 17, 2008, 02:16:21 PM
Don't exit QB, just end the current battle. Then load the ships again.
Title: Re: Reload Hardpoint
Post by: Kirk on July 17, 2008, 02:19:44 PM
Don't exit QB, just end the current battle. Then load the ships again.
D'oh! Ok.
Title: Re: Reload Hardpoint
Post by: MLeo on July 17, 2008, 02:20:43 PM
I was going to write the same thing. Except the forum software ate it after 2 sequentially being redirected back to the editor because other people posted. :(


I had some extra options (described now), such as manually added/changing hardpoints from the console, but you those changes don't get saved in the hp.


And changing torpedoes (and pulse weapons as well mostlikely) can be done from the console, in fact, my More Than Four Torpedoes mod (part of a bigger, and older, mod of mine, if you have KM you have it) uses this to emulate torpedo rotation. But I can't really advice using it, for one, it's kinda tedious, and two, it doesn't get saved in the hp.
Title: Re: Reload Hardpoint
Post by: Kirk on July 17, 2008, 02:28:13 PM
Restarting qb works. :x Why did such a simple answer elude me! Oh well, thanks for all the help!
Title: Re: Reload Hardpoint
Post by: CJLarkin on July 17, 2008, 02:32:41 PM
Much welcome are you :D
Title: Re: Reload Hardpoint
Post by: JimmyB76 on July 17, 2008, 02:36:13 PM
:x Why did such a simple answer elude me!
lol welcome to my world...
ill have to give that a try next time i want to tweak some scripts (bridge-related and such) next time i feel like jumping back into BC...
Title: Re: Reload Hardpoint
Post by: cnotsch on July 17, 2008, 02:54:41 PM
a very useful tool is the reload() command i think it is somehow global;
if you import a module it stays open until all scripts wich imported that module eighter release it or close themselfes.
so if you start a mod it imports a module (like a hp) and uses it wic means it gets compiled and will mostly not be recompiled until bc restarts.
if you call the reload() method it gets compiled again and all scripts that import that module again get the new one, all open modules stay, i think.
so if you reload(__import__('ships.Hardpoints.*HP*')) all ships created afterwards should get the new HP.

I use this for all my mods while developing/fixing them.
I edit them using alt+tab & Notepad++

Maybe you kow already, maybe it helps, i don't know...
Title: Re: Reload Hardpoint
Post by: MLeo on July 17, 2008, 04:13:13 PM
The code that loads a ship already reloads the hardpoint. Using the reload command.

I would have mentioned it if it was neccesairy. ;)