Bridge Commander Central

BC Forums => BC Scripting => Topic started by: 086gf on December 24, 2007, 08:53:28 PM

Title: This is odd...
Post 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.
Title: Re: This is odd...
Post by: MLeo on December 25, 2007, 03:41:52 PM
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.
Title: Re: This is odd...
Post by: 086gf on December 25, 2007, 07:16:56 PM
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.
Title: Re: This is odd...
Post by: MLeo on December 25, 2007, 07:20:38 PM
Right, what changes have you made to the plugins?
Title: Re: This is odd...
Post by: 086gf on December 26, 2007, 12:13:59 AM
Just changed the longnames and thats it, I didn't change the other names or changed the max and cruise speed or anything else.
Title: Re: This is odd...
Post by: FekLeyr Targ on December 26, 2007, 05:18:07 AM
Try this:
Code: [Select]
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'
Title: Re: This is odd...
Post by: 086gf on December 26, 2007, 01:12:00 PM
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...
Title: Re: This is odd...
Post by: JimmyB76 on December 26, 2007, 03:01:24 PM
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:
Code: [Select]
Foundation.ShipDef.BirdOfPrey.name = "whatever you want"

and for the Warbird:
Code: [Select]
Foundation.ShipDef.Warbird.name = "whatever you want"

that should do it...
Title: Re: This is odd...
Post by: MLeo on December 26, 2007, 03:12:09 PM
Thanks Jimmy, but it has to be noted, add
Code: [Select]
import Foundationbefore that.
Title: Re: This is odd...
Post by: JimmyB76 on December 26, 2007, 04:15:14 PM
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 :)
Title: Re: This is odd...
Post by: 086gf on December 26, 2007, 04:29:50 PM
Gonna try that now...

EDIT: Like this?

Quote
#######################################################################################
#                                                                                     #
import Foundation
Foundation.ShipDef.Warbird.name = "Dderidex"
import App
#                                                                                     #
#######################################################################################

EDIT2: That didn't work, I get two entries again.
Title: Re: This is odd...
Post by: MLeo on December 26, 2007, 05:15:04 PM
Delete the rest of the file.
Title: Re: This is odd...
Post by: JimmyB76 on December 26, 2007, 05:15:52 PM
try putting that line under import App...

so it is like:
Code: [Select]
import Foundation
import App
Foundation.ShipDef.Warbird.name = "Dderidex"
Title: Re: This is odd...
Post by: MLeo on December 26, 2007, 05:21:07 PM
The only thing in the file ought to be this:
Code: [Select]
import Foundation
Foundation.ShipDef.Warbird.name = "Dderidex"
Title: Re: This is odd...
Post by: 086gf on December 26, 2007, 05:27:50 PM
Nope, the file came pretty much like this.

Quote
#######################################################################################
#  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]
#                                                                                     #
#######################################################################################
Title: Re: This is odd...
Post by: MLeo on December 26, 2007, 05:33:19 PM
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.

Code: [Select]
#######################################################################################
#  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'
Title: Re: This is odd...
Post by: 086gf on December 26, 2007, 05:36:06 PM
OK, will try that now...

EDIT: Nope, still there.

(http://forums.filefront.com/gallery/images/139190/1_ScreenShot007.jpg)
Title: Re: This is odd...
Post by: Nighthawk on December 27, 2007, 03:11:30 PM
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)
Title: Re: This is odd...
Post by: MLeo on December 27, 2007, 04:42:32 PM
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:
Code: [Select]
import Foundation
Foundation.ShipDef.Warbird.fMaxWarp = 9.0
To include the change Nighthawk wanted (I think) this ought to be added to the previous code:
Code: [Select]
import Foundation
Foundation.ShipDef.Warbird.fMaxWarp = 9.0
Foundation.ShipDef.Warbird.name = "Dderidex"