Bridge Commander Central

BC Forums => BC Scripting => Topic started by: ACES_HIGH on January 06, 2009, 11:47:13 PM

Title: Ship specific bridge with MVAM?
Post by: ACES_HIGH on January 06, 2009, 11:47:13 PM
I was trying to make DJ's Galaxy's Stardrive switch to the Early TNG bridge when I MVAM, but I can't get the ship specific bridge plugin to work, the bridge just stays the same one I started on.  I've don't stuff like this a couple times before, but I can't seem to get this one to work
Code: [Select]
import Foundation
import App

Foundation.SoundDef("sfx/Weapons/PPhaser.wav", "PPhaser", 0.7)

abbrev = 'DJEnterpriseSeason1DriveSection'
iconName = 'DJGalaxyDriveSection'
longName = 'Season 1 Drive'
shipFile = 'DJEnterpriseSeason1DriveSection'
menuGroup = 'Fed Ships'
playerMenuGroup = 'Fed Ships'
species = App.SPECIES_MARAUDER
SubMenu = "DJ Galaxy Class"
SubSubMenu = "U.S.S. Enterprise *"

Foundation.ShipDef.DJEnterpriseSeason1DriveSection = Foundation.FedShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile, 'SubMenu': SubMenu, 'SubSubMenu': SubSubMenu })
Foundation.ShipDef.DJEnterpriseSeason1DriveSection.dTechs = { 'Fed Ablative Armor': {
"Plates": ["Forward Ablative Armor", "Aft Ablative Armor", "Dorsal Ablative Armor", "Ventral Ablative Armor"]
}}
Foundation.ShipDef.DJEnterpriseSeason1DriveSection.desc = 'Drive section of the USS Enterprise.'
Foundation.ShipDef.DJEnterpriseSeason1DriveSection.sBridge = 'galaxybridge'
Foundation.ShipDef.DJEnterpriseSeason1DriveSection.fMaxWarp = 9.6
Foundation.ShipDef.DJEnterpriseSeason1DriveSection.fWarpEntryDelayTime = 3.5
Foundation.ShipDef.DJEnterpriseSeason1DriveSection.sBridge = 'ETNGGeneric'

if menuGroup:           Foundation.ShipDef.DJEnterpriseSeason1DriveSection.RegisterQBShipMenu(menuGroup)
if playerMenuGroup:     Foundation.ShipDef.DJEnterpriseSeason1DriveSection.RegisterQBPlayerShipMenu(playerMenuGroup)

Title: Re: Ship specific bridge with MVAM?
Post by: Kirk on January 06, 2009, 11:48:14 PM
I don't think it will swap during MVAM, only when beaming.
Title: Re: Ship specific bridge with MVAM?
Post by: ACES_HIGH on January 06, 2009, 11:49:16 PM
oh, ok
Title: Re: Ship specific bridge with MVAM?
Post by: MLeo on January 07, 2009, 02:56:43 PM
I don't believe it will work with the BPCore version of this either.
Title: Re: Ship specific bridge with MVAM?
Post by: Alucard on May 29, 2012, 02:44:03 PM
Hello.  Is there now a solution to this issue? I'm currently playing with the Prometheus and I would like to set up a battle bridge that loads automatically when you separate the Prometheus.
Title: Re: Ship specific bridge with MVAM?
Post by: Phoenix Bondi on May 29, 2012, 07:19:27 PM
its not wise to re-wake a topic this old, can normally get you into trouble with the admins, but as far as i know this has never been finished
Title: Re: Ship specific bridge with MVAM?
Post by: JimmyB76 on May 29, 2012, 08:33:13 PM
well, as far as this plugin, one thing i notice right off the bat is that drive section calls for both the galaxybridge and the ETNGGeneric so that could be a reason it doesnt work...

it could also be that bridge switching may not work with MVAM...  i personally dont know, as ive never tried...
Title: Re: Ship specific bridge with MVAM?
Post by: Alucard on May 30, 2012, 12:48:21 PM
Too bad. But thanks anyway.
Title: Re: Ship specific bridge with MVAM?
Post by: JB2005 on September 17, 2012, 08:53:05 AM
Apologies for bumping this thread, but I had a thought this morning and I've come up with a somewhat crude workaround which makes what's been discussed above possible:



I was going to use the Generic TNG Bridge, but I couldn't get it working so I substituted in the NX Pathfinder to demonstrate the concept!

This was made possible by making 4 alterations to the GalaxyMVAM Plugin Script from the "Stock" MVAMinfinity mod:

First of all, I added an import for LoadBridge - which is a file from Stock BC which is meant to be used to choose the Ship's Bridge at the beginning of a mission in the campaign, but fans of my work will know I use and abuse this script every chance I get!

Next I made the following changes:

Code: [Select]
def MvamGalaxySaucer(pObject, pEvent):


# get the player
pGame = App.Game_GetCurrentGame()
pPlayer = pGame.GetPlayer()
snkMvamModule = __import__ (__name__)
# check if its our full ship
if (pPlayer.GetScript() == "ships." + snkMvamModule.ReturnMvamShips()[0]):
import Custom.Sneaker.Mvam.Seperation
LoadBridge.Load("GalaxyBridge")

###TO CHANGE: change the last word in quotes in the next line to the name of the def. (ie: "MvamGalaxySaucer")
Custom.Sneaker.Mvam.Seperation.Seperation(snkMvamModule, "MvamGalaxySaucer")


pObject.CallNextHandler(pEvent)


###TO CHANGE: dont forget to change this name too.
def MvamGalaxyStardrive(pObject, pEvent):


# get the base variables
pGame = App.Game_GetCurrentGame()
pPlayer = pGame.GetPlayer()
snkMvamModule = __import__ (__name__)
# check if its our full ship
if (pPlayer.GetScript() == "ships." + snkMvamModule.ReturnMvamShips()[0]):
import Custom.Sneaker.Mvam.Seperation
LoadBridge.Load("nxpathfinder")


###TO CHANGE: change the last word in quotes in the next line to the name of the def
Custom.Sneaker.Mvam.Seperation.Seperation(snkMvamModule, "MvamGalaxyStardrive")


pObject.CallNextHandler(pEvent)


###OPTIONAL CHANGE: This is the reintegrate sequence. You really don't need to touch this
def Reintegrate(pObject, pEvent):
#get the base variables
pGame = App.Game_GetCurrentGame()
pPlayer = pGame.GetPlayer()
pSet = pPlayer.GetContainingSet()
snkMvamModule = __import__ (__name__)
#check to see if all the ships are still around in the set. start a counter
intCounter = 0
for i in range((len(snkMvamModule.ReturnMvamShips())) - 1):
if (App.ShipClass_GetObject(pSet, snkMvamModule.ReturnMvamShips()[i + 1]) == None):
#make sure we're not skipping the player ship
if (pPlayer.GetScript() != "ships." + snkMvamModule.ReturnMvamShips()[i + 1]):
#NOW it's bad. something isnt right, so notify the counter
intCounter = intCounter + 1
#alright, if this is a legit reintegrate, intCounter will equal 0
if (intCounter == 0):
import Custom.Sneaker.Mvam.Reintegration
Custom.Sneaker.Mvam.Reintegration.Reintegration(snkMvamModule)
LoadBridge.Load("GalaxyBridge")
pObject.CallNextHandler(pEvent))

The addition of the
Code: [Select]
LoadBridge.Load("BRIDGENAME") means that when the plugin runs to either seperate or reintegrate, at the same time it switches the bridge.

Obviously as a practical solution this has its drawbacks - ie that it requires altering the plugin (though the plugin isn't otherwise affected by the alteration) but it shows that it is at least possible!
Title: Re: Ship specific bridge with MVAM?
Post by: Lurok91 on September 17, 2012, 12:38:24 PM
Welcome back, JB  :yay:  Good to see you come up with solution.  :thumbsup:   Yeah, that LoadBridge script is a real little goldmine. I abused it to make Baz's TWOK bridge/crew work with a TMP Kobayashi Maru mission I scripted.  The other JB and I been continuing work on the SP Game Mod.  PM Jimmy and if you've got time, get access to hidden forum and add any thoughts  :thumbsup:
Title: Re: Ship specific bridge with MVAM?
Post by: Mario on September 17, 2012, 01:02:04 PM
Correct implementation would be something like I did in Xtended. Check 000-Expansion-MVAMEvents.py and you'll see that without touching the mvam source code we can attach an event onto MVAM. Which I used and exposed for others in my scenario:
Code: [Select]
ET_MVAM_SEP
ET_MVAM_REIN
Title: Re: Ship specific bridge with MVAM?
Post by: JB2005 on September 17, 2012, 01:06:03 PM
http://www.gamefront.com/files/22272576/GalaxyMvam.rar

Is a copy of the modified script I did, this is set to alternate between the Sovereign and Galaxy Bridges, since they're the  Stock ones it should work for anyone and provides an example!

But like I said it's a terrible way of going about it!
Title: Re: Ship specific bridge with MVAM?
Post by: CyAn1d3 on September 17, 2012, 07:11:11 PM
http://www.gamefront.com/files/22272576/GalaxyMvam.rar

Is a copy of the modified script I did, this is set to alternate between the Sovereign and Galaxy Bridges, since they're the  Stock ones it should work for anyone and provides an example!

But like I said it's a terrible way of going about it!

terrible, but still effective none the less. this may come in handy for me soon.....

have a pat on the back and a cookie for cracking this one JB!
Title: Re: Ship specific bridge with MVAM?
Post by: Lurok91 on September 19, 2012, 05:09:30 AM
yeah, forgot *cookie*  :)
Title: Re: Ship specific bridge with MVAM?
Post by: Alucard on May 23, 2013, 07:31:01 AM
Hello people,

At first: you're doing a great work  :thumbsup:. there is almost no problem that you can?t solve.
as I read yesterday, that it would have worked, I almost danced for joy. but after I changes the script, the bridge changes not automatically.

is that really the right script?
\ scripts \ Custom \ AutoLoad \ Mvam \ GalaxyMvam

if I replace the script code with the scpit code from JB the complete script no longer works. when I press the MVAM button in game, nothing happens.  :idk: What
What did I miss?
Title: Re: Ship specific bridge with MVAM?
Post by: hobbs on May 23, 2013, 08:45:08 AM
did you use note pad?
if you did dont "save as" just save only thing i can think of... but im no scripter lol i cant even get a button to activate a sound file lol
Title: Re: Ship specific bridge with MVAM?
Post by: Alucard on May 23, 2013, 01:50:23 PM
I don?t think that is a problem with "save as". that was in previous modding never a problem.

yes I use the notepad.