Bridge Commander Central
BC Forums => BC Scripting => Topic started by: 086gf on December 24, 2007, 08:53:28 PM
-
I changed the longnames of some ships and stations in the custom/ships folder and I now have two entries for the BoP and Warbird. How do I get ride of the extra entry? I tried changing it back to what they were but that didn't help.
-
First of all, moving to Scripting.
Are this the stock ships?
Then you should delete the new plugins you created.
As for changing them, make sure you name the abrev the same, and change any reference to the longName variable in the plugin to the old name.
-
No these are the ships that came with KM(and obviously I posted this over there as well). The stock was BoP and Warbird and I changed them to Bird Of Prey and Dderidex.
-
Right, what changes have you made to the plugins?
-
Just changed the longnames and thats it, I didn't change the other names or changed the max and cruise speed or anything else.
-
Try this:
abbrev = 'Warbird'
iconName = 'Warbird' #Name of the Icon file
longName = 'D Deridex' #This is the Display name.
shipFile = 'Warbird' #Name of the Ship's py(c) file
menuGroup = 'Romulan Ships'
playerMenuGroup = 'Romulan Ships'
-
Whatever that was supposed to do failed miserably.
EDIT: I changed it back to Warbird and that got ride of the extra entry but that didn't work for the bop though...will need the original file.
EDIT2: lol it was BOP and not BoP...silly me but I get Bird Of Prey as the name that shows in the menu and not BOP like it is...*confuzzled*
EDIT3: Guessing there isn't a way to have only one entry for the warbird and have it say Dderidex is there? Oh well...
-
in order to change the name of stock ships, you must add this at the top of the script of the plugin (script in custom/ships) -
for the Bird Of Prey, it would be:
Foundation.ShipDef.BirdOfPrey.name = "whatever you want"
and for the Warbird:
Foundation.ShipDef.Warbird.name = "whatever you want"
that should do it...
-
Thanks Jimmy, but it has to be noted, add
import Foundationbefore that.
-
ah yes indeed...
and the only reason i knew how to do this was because this is something you taught me a long time ago, back in the BCU days...
so the thanks goes to you :)
-
Gonna try that now...
EDIT: Like this?
#######################################################################################
# #
import Foundation
Foundation.ShipDef.Warbird.name = "Dderidex"
import App
# #
#######################################################################################
EDIT2: That didn't work, I get two entries again.
-
Delete the rest of the file.
-
try putting that line under import App...
so it is like:
import Foundation
import App
Foundation.ShipDef.Warbird.name = "Dderidex"
-
The only thing in the file ought to be this:
import Foundation
Foundation.ShipDef.Warbird.name = "Dderidex"
-
Nope, the file came pretty much like this.
#######################################################################################
# Custom Ship Plugin #
# Created by BC - Mod Packager #
# Date: 02.03.2005 #
#######################################################################################
# #
import Foundation
import App
Foundation.ShipDef.Warbird.name = 'Dderidex'
# #
#######################################################################################
# #
abbrev = 'Warbird'
iconName = 'Warbird'
longName = 'Warbird'
shipFile = 'Warbird'
menuGroup = 'Romulan Ships'
playerMenuGroup = 'Romulan Ships'
species = App.SPECIES_GALAXY
# #
#######################################################################################
# #
# Mod Info. Use this as an opportunity to describe your work in brief. This may #
# have use later on for updates and such. #
# #
credits = {
'modName': 'Warbird',
'author': '',
'version': '1.0',
'sources': [ 'http://' ],
'comments': ''
}
# #
#######################################################################################
# #
# This is the ShipDef that adds the Ship to the game... BC-Mod Packager has #
# automatically generated the proper ShipDef Line for you. #
# #
Foundation.ShipDef.Warbird = Foundation.RomulanShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })
Foundation.ShipDef.Warbird.fMaxWarp = 9.0
# #
#######################################################################################
# #
# Uncomment these if you have TGL
#Foundation.ShipDef.Warbird.hasTGLName = 1
#Foundation.ShipDef.Warbird.hasTGLDesc = 1
# Otherwise, uncomment this and type something in:
# Foundation.ShipDef.Warbird.desc = 'No Description Available'
# #
#######################################################################################
# #
# These register the ship with the QuickBattle menus. Don't touch them!!! #
# #
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]
# #
#######################################################################################
-
Ah, so it _isn't_ the stock plugin, right?
Also, I suggest you use code, instead of quote tags.
Nope, the file came pretty much like this.
This is how I see the file should be like, assuming you still want it to overwrite the stock warbird (as this is what it's currently doing, for no good reason, since nothing has changed).
Basicly, the line had to be moved to the end of the file. This will prevent the not overwriting problem.
#######################################################################################
# Custom Ship Plugin #
# Created by BC - Mod Packager #
# Date: 02.03.2005 #
#######################################################################################
# #
import Foundation
import App
# #
#######################################################################################
# #
abbrev = 'Warbird'
iconName = 'Warbird'
longName = 'Warbird'
shipFile = 'Warbird'
menuGroup = 'Romulan Ships'
playerMenuGroup = 'Romulan Ships'
species = App.SPECIES_GALAXY
# #
#######################################################################################
# #
# Mod Info. Use this as an opportunity to describe your work in brief. This may #
# have use later on for updates and such. #
# #
credits = {
'modName': 'Warbird',
'author': '',
'version': '1.0',
'sources': [ 'http://' ],
'comments': ''
}
# #
#######################################################################################
# #
# This is the ShipDef that adds the Ship to the game... BC-Mod Packager has #
# automatically generated the proper ShipDef Line for you. #
# #
Foundation.ShipDef.Warbird = Foundation.RomulanShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })
Foundation.ShipDef.Warbird.fMaxWarp = 9.0
# #
#######################################################################################
# #
# Uncomment these if you have TGL
#Foundation.ShipDef.Warbird.hasTGLName = 1
#Foundation.ShipDef.Warbird.hasTGLDesc = 1
# Otherwise, uncomment this and type something in:
# Foundation.ShipDef.Warbird.desc = 'No Description Available'
# #
#######################################################################################
# #
# These register the ship with the QuickBattle menus. Don't touch them!!! #
# #
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'
-
OK, will try that now...
EDIT: Nope, still there.
(http://forums.filefront.com/gallery/images/139190/1_ScreenShot007.jpg)
-
what if you just delete the Warbird/Dderidex plugin (both .py and .pyc) and make a new one from scratch?
every time I delete a plugin, the ship stops showing up. that's the way it's supposed to be, isn't it?
an afterthought: are you sure you have just one version of the warbird? maybe another plugin was meant to overwrite the stock Warbird and now you're creating a duplicate of the original as Dderidex, but the second plugin keeps making an entry named "Warbird" (if that's even possible)
if you want the ship to be named "Dderidex", modify the "longname" field. also, if you want it to show up as "Dderidex" in game, modify the name in the ship's file (scripts\ships\Warbird.py)
-
Giving a second glance at the plugin, it seems that it's only intention was to give the (stock) warbird the fMaxWarp attribute, for a mod by USS Sovereign (I think, forgot the name, too late).
If rewritten, this would be the result:
import Foundation
Foundation.ShipDef.Warbird.fMaxWarp = 9.0To include the change Nighthawk wanted (I think) this ought to be added to the previous code:
import Foundation
Foundation.ShipDef.Warbird.fMaxWarp = 9.0
Foundation.ShipDef.Warbird.name = "Dderidex"