Bridge Commander Central
BC Forums => BC Scripting => Topic started by: Morgan on January 03, 2010, 03:09:43 AM
-
Okay so I know how to make a torpedo that disables shields but I was wondering if it was possible to expand upon that and make so that it would only succeed a certain amount of times (say it has 1/4 chance of working instead of 100%). If it's possible how would I go about doing that? I'm re-hardpointing a type 11 shuttle to include the tachyon bursts seen in Insurrection and want it to be as realistic as possible.
-
For one I'd say this belongs in scripting.
While I have no clue how to do what you want, I figure that you perhaps have to make a seperate system that does what you want.
Torpedoes, as I understand it, only generates colores, flares and damage, and contain such systems as if it can penetrate shields, like the phased torpedoes.
Correct me if im wrong... wich I probably am.
-
AFAIK Defiants Abandon Ship script includes some kind of getRandonNuber function (or was that a python build in?) anyway, you could look in there on how to wrise/use it
-
import App
fChance = 25.0 #chance probability value in %
if App.g_kSystemWrapper.GetRandomNumber(100) <= fChance:
#Check successfull, do what you want to do...
That's a simple way in BC to check a chance (0 to 100% probability).
Inside the IF, substitute that comment with what your code does when it's successfull.
The fChance variable is kinda obvious: the chance of being successfull. You mentioned to have say 1/4 chance, that = 25%, therefore fChance = 25.0
-
I'll give that a try, thanks Frontier!
-
you'll need an event handler in the torpedo script for when the torpedo is fired too