Author Topic: Torpedo Question  (Read 1028 times)

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Torpedo Question
« 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.

Offline anazonda

  • Posts: 145
  • Cookies: 8
  • Is it time to back up and leave bc?
Re: Torpedo Question
« Reply #1 on: January 03, 2010, 04:36:05 AM »
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.

Offline KrrKs

  • Posts: 461
  • Cookies: 25
Re: Torpedo Question
« Reply #2 on: January 03, 2010, 09:41:06 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

Offline USS Frontier

  • Posts: 176
  • Cookies: 562
Re: Torpedo Question
« Reply #3 on: January 06, 2010, 09:58:39 PM »
Code: [Select]
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
"Revenge is a dish best served cold"
                    -Old Klingon Proverb
GravityFX Download
Galaxy Charts Download

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: Torpedo Question
« Reply #4 on: January 07, 2010, 03:38:33 PM »
I'll give that a try, thanks Frontier!

Offline Rob Archer

  • Posts: 163
  • Cookies: 545
  • New Frontier MKVI
Re: Torpedo Question
« Reply #5 on: January 08, 2010, 09:53:00 AM »
you'll need an event handler in the torpedo script for when the torpedo is fired too