Bridge Commander Central
BC Forums => BC Scripting => Topic started by: 086gf on December 30, 2011, 02:43:43 PM
-
When I did this before with KM 1.0 I remember it working properly. Im reorganizing all of the menus again but everything i've tried from before(like creating brand new plugins) is not working 100%. Here's a plugin example of each for a renamed and relocated stock ships.
##### Created by:
##### Bridge Commander Universal Tool
import App
import Foundation
abbrev = "Shuttle"
iconName = "FedShuttle"
longName = "Type 6"
shipFile = "Shuttle"
species = App.SPECIES_GALAXY
menuGroup = "Fed Ships"
playerMenuGroup = "Fed Ships"
Foundation.ShipDef.Shuttle = Foundation.FedShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })
Foundation.ShipDef.Shuttle.hasTGLName = 1
Foundation.ShipDef.Shuttle.hasTGLDesc = 1
Foundation.ShipDef.Shuttle.SubMenu = "Shuttles"
Foundation.ShipDef.Shuttle.fMaxWarp = 6.5 + 0.0001
Foundation.ShipDef.Shuttle.fCruiseWarp = 4.5 + 0.0001
Foundation.ShipDef.Shuttle.sBridge = "Type11Bridge"
if menuGroup: Foundation.ShipDef.Shuttle.RegisterQBShipMenu(menuGroup)
if playerMenuGroup: Foundation.ShipDef.Shuttle.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]
Foundation.ShipDef.Shuttle.name = "Type 6"
##### Created by:
##### Bridge Commander Universal Tool
import App
import Foundation
abbrev = "Warbird"
iconName = "Warbird"
longName = "Dderidex DS9"
shipFile = "Warbird"
species = App.SPECIES_GALAXY
menuGroup = "Romulan Ships"
playerMenuGroup = "Romulan Ships"
Foundation.ShipDef.Warbird = Foundation.RomulanShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })
Foundation.ShipDef.Warbird.hasTGLName = 1
Foundation.ShipDef.Warbird.hasTGLDesc = 1
Foundation.ShipDef.Warbird.fMaxWarp = 9 + 0.0001
Foundation.ShipDef.Warbird.fCruiseWarp = 7 + 0.0001
if menuGroup: Foundation.ShipDef.Warbird.RegisterQBShipMenu(menuGroup)
if playerMenuGroup: Foundation.ShipDef.Warbird.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]
Foundation.ShipDef.Warbird.name = "Dderidex DS9"
EDIT: Oh yeah also im trying to modify the Enterprise G and Sovereign names/submenus and the seperate parts. I want to get rid of the extra layer for each ship(which I did in all of the plugins but no difference just an extra entry) so that its just like the Galaxy and Prometheus. The pics below shows how it looks now.
-
I assume you mean you have duplicates of the Stock entries when you say the menus are not working properly.
The Strange thing is, the Plugins in my install look pretty much the same.
You could try leaving the
Foundation.ShipDef.Shuttle = Foundation.FedShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })
parts away. That worked for the Sovereign in my Install.
My other Stock ship Plugins have the altered Part, like Submenus, put directly after the import Statements, but i don't know if that would change anything.
Concerning the Mvam Extra layer. AFAIK the MVAM mod creates its own Sumenu entry's for a Ships parts. So any Submenu With Ent-G or Sovereign in these MVAM ships ( and their Child- Ships) should go. -At least that worked for me.
-
1) Remove "Foundation.ShipDef.Shuttle = Foundation.FedShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })"
2) Relocate "Foundation.ShipDef.Shuttle.SubMenu = "Shuttles"" to underneath import Foundation
3) Remove the submenus completely?
Alright i'll give those a try.
EDIT: Well the third issue is resolved. Removing the shipdef info line on the ships that i've relocated removes the new entry so I had to put it back in for them but it worked with the others fine. Removing the submenu lines for the G and Sov parts fixed that issue too. I just need the Shuttle , Kessok Mine and both Comm Arrays to only show up in there new locations.
Shuttle should be in Fed Ships/Shuttles only.
##### Created by:
##### Bridge Commander Universal Tool
import App
import Foundation
abbrev = "Shuttle"
iconName = "FedShuttle"
longName = "Type 6"
shipFile = "Shuttle"
species = App.SPECIES_GALAXY
menuGroup = "Fed Ships"
playerMenuGroup = "Fed Ships"
Foundation.ShipDef.Shuttle = Foundation.FedShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })
Foundation.ShipDef.Shuttle.name = "Type 6"
Foundation.ShipDef.Shuttle.SubMenu = "Shuttles"
Foundation.ShipDef.Shuttle.hasTGLName = 1
Foundation.ShipDef.Shuttle.hasTGLDesc = 1
Foundation.ShipDef.Shuttle.fMaxWarp = 6.5 + 0.0001
Foundation.ShipDef.Shuttle.fCruiseWarp = 4.5 + 0.0001
Foundation.ShipDef.Shuttle.sBridge = "Type11Bridge"
if menuGroup: Foundation.ShipDef.Shuttle.RegisterQBShipMenu(menuGroup)
if playerMenuGroup: Foundation.ShipDef.Shuttle.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]
Kessok Mine should be in Kessok Ships only.
##### Created by:
##### Bridge Commander Universal Tool
import App
import Foundation
abbrev = "KessokMine"
iconName = "KessokMine"
longName = "Kessok Mine"
shipFile = "KessokMine"
species = App.SPECIES_GALAXY
menuGroup = "Kessok Ships"
playerMenuGroup = "Kessok Ships"
Foundation.ShipDef.KessokMine = Foundation.KessokShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })
Foundation.ShipDef.KessokMine.name = "Kessok Mine"
Foundation.ShipDef.KessokMine.hasTGLName = 1
Foundation.ShipDef.KessokMine.hasTGLDesc = 1
if menuGroup: Foundation.ShipDef.KessokMine.RegisterQBShipMenu(menuGroup)
if playerMenuGroup: Foundation.ShipDef.KessokMine.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]
CommArray and CommLight should be in Bases only.
##### Created by:
##### Bridge Commander Universal Tool
import App
import Foundation
abbrev = "CommArray"
iconName = "CommArray"
longName = "Communications Array"
shipFile = "CommArray"
species = App.SPECIES_GALAXY
menuGroup = "Bases"
Foundation.ShipDef.CommArray = Foundation.StarBaseDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })
Foundation.ShipDef.CommArray.name = "Communications Array"
Foundation.ShipDef.CommArray.hasTGLName = 1
Foundation.ShipDef.CommArray.hasTGLDesc = 1
if menuGroup: Foundation.ShipDef.CommArray.RegisterQBShipMenu(menuGroup)
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]
##### Created by:
##### Bridge Commander Universal Tool
import App
import Foundation
abbrev = "CommLight"
iconName = "CommLight"
longName = "Communications Array Light"
shipFile = "CommLight"
species = App.SPECIES_GALAXY
menuGroup = "Bases"
Foundation.ShipDef.CommLight = Foundation.StarBaseDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })
Foundation.ShipDef.CommLight.name = "Communications Array Light"
Foundation.ShipDef.CommLight.hasTGLName = 1
Foundation.ShipDef.CommLight.hasTGLDesc = 1
if menuGroup: Foundation.ShipDef.CommLight.RegisterQBShipMenu(menuGroup)
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]
-
I thought that, with an already existing Foundation Entry removing the RaceShipdef part would overwrite that entry, instead of creating a new one with the same name.
After taking a look again I also have the Shuttle still under "Other Ships", so maybe the Menus Positions of Stock Ships are hard Coded.
But it is strange that SubMenus do work for them...
-
Its been done before so its not hardcoded I just need to remember how.
-
Nothing has changed here, just some other ships.
-
No the first two are actually updated.
So, anyone have any ideas?
-
### Custom/ships/file.py
import Foundation
# override the instance name (check staticdefs for more info)
ship = Foundation.ShipDef.KessokHeavy
ship.name = "Oh whatever"
ship.hasTGLName = 0
ship.hasTGLDesc = 1
# player menu
ship.playerMenuGroup = "Yay new player menu"
# ship menu
ship.menuGroup = "Yay new menu"
-
Thanks, i'll try that and post back if it works or not.
-
Thank you that worked!