Bridge Commander Central

BC Forums => BC Scripting => Topic started by: anubitus on May 28, 2009, 01:11:16 PM

Title: re-aranging my ships in my game install, CeNebula problem
Post by: anubitus on May 28, 2009, 01:11:16 PM
hi,

i ve been trying to rearange my ships in the quickbattle menus.
up till now everything worked fine but now i encountered a problem..

i have two ships called "Endeavour" and they dont work together cos they have the same name so i wanted to rename them, but the nebula endeavour plugin file is inside a multiple ship plugin so it dont work with BCUT.. i opened it in notepad.. changed the name to Endeavour-B but it dont seem to work..

this is my script..

Code: [Select]
...BEGIN OF THE SCRIPT (OTHER SHIPS I HAVENT TOUCHED)

##### USS Endeavour
abbrev = 'Endeavour-B'
iconName = 'Nebula'
longName = 'U.S.S. Endeavour-B'
shipFile = 'Endeavour-B'
species = App.SPECIES_GALAXY
SubMenu = 'Nebula Class'
menuGroup = 'Fed Ships'
playerMenuGroup = 'Fed Ships'


Foundation.ShipDef.Endeavour-B = Foundation.FedShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile, 'SubMenu': SubMenu})
Foundation.ShipDef.Endeavour-B.sBridge = 'nebulabridge'
Foundation.ShipDef.Endeavour-B.__dict__["Default Bridge"] = "nebulabridge"
Foundation.ShipDef.Endeavour-B.fMaxWarp = 9.6
Foundation.ShipDef.Endeavour-B.fCruiseWarp = 9.2
Foundation.ShipDef.Endeavour-B.desc = 'U.S.S. Endeavour-B NCC-71805'


if menuGroup:           Foundation.ShipDef.Endeavour-B.RegisterQBShipMenu(menuGroup)
if playerMenuGroup:     Foundation.ShipDef.Endeavour-B.RegisterQBPlayerShipMenu(playerMenuGroup)


if Foundation.shipList._keyList.has_key(longName):
      Foundation.ShipDef.__dict__[longName].friendlyDetails[2] = Foundation.shipList[longName].friendlyDetails[2]
      Foundation.ShipDef.__dict__[longName].enemyDetails[2] = Foundation.shipList[longName].enemyDetails[2]



def Endeavour-BIDSwap(self):
retval = {"Textures": [["ID_glow", "Data/Models/SharedTextures/Nebula/EndeavourID_glow.tga"], ["ID_spec", "Data/Models/SharedTextures/Nebula/EndeavourID_spec.tga"]]}
return retval


Foundation.ShipDef.Endeavour-B.__dict__['SDT Entry'] = Endeavour-BIDSwap




... REST OF THE PLUGIN

i also changed the name of the gamedir/scripts/ships file to endeavour-B

what am i doing wrong..?

thanks in advance..

AnU

ps: sry if this is a stupid mistake but im new to this scripting stuff and you gotta start somewhere right..? :p
Title: Re: re-aranging my ships in my game install, CeNebula problem
Post by: teleguy on May 28, 2009, 01:24:48 PM
Quote
i also changed the name of the gamedir/scripts/ships file to endeavour-B
endeavour-B or Endeavour-B? Because in the plugin you wrote "shipFile = 'Endeavour-B'" with a capital E.
Title: Re: re-aranging my ships in my game install, CeNebula problem
Post by: MLeo on May 28, 2009, 02:40:18 PM
That isn't the reason!

Foundation.ShipDef.Endeavour-B is not valid Python, neither is Endeavour-BIDSwap.
Replace the - with a _ and it will be.
Leave the long name.
Title: Re: re-aranging my ships in my game install, CeNebula problem
Post by: anubitus on May 31, 2009, 11:17:11 AM
ah.. stupid mistake there.. :p

kk now it looks like this:

Code: [Select]
...BEGIN OF THE SCRIPT (OTHER SHIPS I HAVENT TOUCHED)

##### USS Endeavour
abbrev = 'Endeavour_B'
iconName = 'Nebula'
longName = 'U.S.S. Endeavour-B'
shipFile = 'Endeavour_B'
species = App.SPECIES_GALAXY
SubMenu = 'Nebula Class'
menuGroup = 'Fed Ships'
playerMenuGroup = 'Fed Ships'


Foundation.ShipDef.Endeavour_B = Foundation.FedShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile, 'SubMenu': SubMenu})
Foundation.ShipDef.Endeavour_B.sBridge = 'nebulabridge'
Foundation.ShipDef.Endeavour_B.__dict__["Default Bridge"] = "nebulabridge"
Foundation.ShipDef.Endeavour_B.fMaxWarp = 9.6
Foundation.ShipDef.Endeavour_B.fCruiseWarp = 9.2
Foundation.ShipDef.Endeavour-B.desc = 'U.S.S. Endeavour-B NCC-71805'


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


if Foundation.shipList._keyList.has_key(longName):
      Foundation.ShipDef.__dict__[longName].friendlyDetails[2] = Foundation.shipList[longName].friendlyDetails[2]
      Foundation.ShipDef.__dict__[longName].enemyDetails[2] = Foundation.shipList[longName].enemyDetails[2]



def Endeavour_BIDSwap(self):
retval = {"Textures": [["ID_glow", "Data/Models/SharedTextures/Nebula/EndeavourID_glow.tga"], ["ID_spec", "Data/Models/SharedTextures/Nebula/EndeavourID_spec.tga"]]}
return retval


Foundation.ShipDef.Endeavour_B.__dict__['SDT Entry'] = Endeavour_BIDSwap




... REST OF THE PLUGIN

and it works like a charm..! thanks for the help guys..

ps: yea teleguy, i made a mistake there, i changed it to Endeavour-B with a capital E but in my post i put in a normal e by mistake.. :p