Author Topic: Changing a ships warps sounds  (Read 5712 times)

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Changing a ships warps sounds
« on: June 01, 2009, 06:26:48 AM »
Hi,
   AS much a I love my new TMP connie the TNG warp sounds are bugging me.

I have seen TMP warp sounds on BC files but these will over write the default warp sfx's

So can I give a ship its own sound files like you can for phasers and torps?

I created a sound plugin with BCUT but have no idea of to associate it with the ship?

Sorry if this is a newbie question.
Whatever knocks us back, can only make us stronger.

Offline teleguy

  • Posts: 363
  • Cookies: 53
Re: Changing a ships warps sounds
« Reply #1 on: June 01, 2009, 07:51:51 AM »

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Changing a ships warps sounds
« Reply #2 on: June 01, 2009, 08:55:02 AM »
OK, I must be dumb. I've read it through several times looked at example files and can not find any ref to sounddef "warp enter" Etc..

Here is the sound pak I created.


#####  Created by:
#####  Bridge Commander Universal Tool


import App
import Foundation


Foundation.SoundDef("sfx/TMPenter warp.wav", "TMPwarpenter", 1)
Foundation.SoundDef("sfx/TMPwarp flash.wav", "TMPwarpflash", 1)
Foundation.SoundDef("sfx/TMPexit warp.wav", "TMPwarpexit", 1)


It is proberley obvious but how to I first off call this up in my ship plugin and how do I assign the right sound to the right action?
Whatever knocks us back, can only make us stronger.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Changing a ships warps sounds
« Reply #3 on: June 01, 2009, 09:12:41 AM »
NanoFX looks, per race, for two sounds, based on a naming scheme, both sounds start with the race name and end with either "EnterWarp" and "ExitWarp".

It's in the last section of my post.

Also, use code tags for posting code.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Changing a ships warps sounds
« Reply #4 on: June 01, 2009, 09:59:55 AM »
I see how the game looks for example the fed warp enter sfx when the ship is fedshipdef.

I see the extra lines of code for "overriding" the fed warp flash etc.

Is there an override for the warp enter / exit sounds of do I have to create a "new race" to define the TMP warp sounds.

The last set of code in the example calls up a my breen race define, where the warp sounds are set. I can't see where this code came from.

Sorry to be a pain but I really do want to understand this.
Whatever knocks us back, can only make us stronger.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Changing a ships warps sounds
« Reply #5 on: June 01, 2009, 10:19:08 AM »
Like I said, NanoFX uses a naming convention, meaning there is no code to specify the specific sounds.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Changing a ships warps sounds
« Reply #6 on: June 01, 2009, 11:04:39 AM »
Ok I get most of this. Is there a ship I can look at as an example?
Whatever knocks us back, can only make us stronger.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Changing a ships warps sounds
« Reply #7 on: June 01, 2009, 11:19:41 AM »
Every ship uses this.

Here are the steps (consider each block to be it's own file):
Code: [Select]
import Foundation
oBazTMPRace = Foundation.RaceDef("BazTMP", "BTMP")

Code: [Select]
import Foundation
import BazTMPRace

class BazTMPShipDef(Foundation.ShipDef):
    def __init__(self, abbrev, species, dict):
        dict['race'] = BazTMPRace.oBazTMPRace
        Foundation.ShipDef.__init__(self, abbrev, species, dict)

Then, in your ship plugin, you import the new shipdef file (say BazTMPShipDef) and then create your ship plugin using that (so instead of the Foundation.<Something>ShipDef(....) you use BazTMPShipDef.BazTMPShipDef(....)).

NanoFX will now look for BazTMPEnterWarp and BazTMPExitWarp.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Changing a ships warps sounds
« Reply #8 on: June 01, 2009, 11:34:16 AM »
Ok one very stupid question before I try this.

The 2 files I need to create to define "My TMP" race. what file names do I use and do I put them is Scripts/custom/ships?
Whatever knocks us back, can only make us stronger.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Changing a ships warps sounds
« Reply #9 on: June 01, 2009, 11:49:53 AM »
Any name you like, anywhere under scripts and in a directory with an __init__.pyc, you can put the two definitions even together in a single file.

It's the first parameter of Foundation.RaceDef that NanoFX looks at.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Changing a ships warps sounds
« Reply #10 on: June 01, 2009, 11:53:06 AM »
Ok will give it a try when I get home.

Thank you for your patience cookie incoming.

Hopefully this will work for me now.
Whatever knocks us back, can only make us stronger.

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Changing a ships warps sounds
« Reply #11 on: June 01, 2009, 02:27:48 PM »
ok I'm doing something wrong now I have the BSOD and the CD cursor.

I have attached the files I have created
Whatever knocks us back, can only make us stronger.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Changing a ships warps sounds
« Reply #12 on: June 01, 2009, 02:35:16 PM »
While you can name it anything you like, you have to name it consistently.

Meaning, you can't call it "BazTMPRace" at one place, and mean "TMPbcDef" in another.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline USS Frontier

  • Posts: 176
  • Cookies: 562
Re: Changing a ships warps sounds
« Reply #13 on: June 01, 2009, 06:12:49 PM »
MLeo, while that method will work, it will create "inconsistencies" with the Races for mods that use the Races system...
Since that is a Fed ship, but with this modification will be from a completely different race.

And the shameless advertising:
With Galaxy Charts v2 you'll be able to do this for all your TMP ships in a relatively easy way and still maintain them in the Fed race :P
"Revenge is a dish best served cold"
                    -Old Klingon Proverb
GravityFX Download
Galaxy Charts Download

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Changing a ships warps sounds
« Reply #14 on: June 01, 2009, 06:35:46 PM »
Perhaps the "code" can be used to denote the general race? Or maybe we should introduce a "parent" race.

TBH, I'm not too thrilled with this system, but it's how NanoFX works.


I suppose that's why I had this idea of a FoundationFX in my head... But then again, I've had that since my time on FTB/FoundationTech.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Changing a ships warps sounds
« Reply #15 on: June 01, 2009, 06:40:37 PM »
Either way it is still not working for me.

I renamed the race files BazTMPRace & BazTMPRace1

They sit happly in the custom/ships folder and the game works.

When I change the connie from foundation.fedshipdef to foundation.baztmpshipdef the game still BSOD on me.
Whatever knocks us back, can only make us stronger.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Changing a ships warps sounds
« Reply #16 on: June 01, 2009, 06:52:50 PM »
The names should be BazTMPRace.py and BazTMPShipDef.py

And in your ship plugin you should import BazTMPShipDef and then use BazTMPShipDef.BazTMPShipDef(....) instead of the Foundation.FedShipDef(....)
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Changing a ships warps sounds
« Reply #17 on: June 02, 2009, 06:10:39 AM »
Ok this is where I am at the moment. I'm still getting the BSOD with this files in customer/ships.

File 1 BazTMPRace.py

Code: [Select]
import Foundation
oBazTMPRace = Foundation.RaceDef("BazTMP", "BTMP")

File 2 BazTMPShipDef.py

Code: [Select]
import Foundation


class BazTMPShipDef(Foundation.ShipDef):
    def __init__(self, abbrev, species, dict):
        dict['race'] = Foundation.BazTMPRace
        Foundation.ShipDef.__init__(self, abbrev, species, dict)

File 3 BCrefit.py

Code: [Select]
##### Created by:
##### Bridge Commander Ship Menu Creator v5.6



import App
import Foundation
import BazTMPShipDef


abbrev = 'bcrfit'
iconName = 'bcrefit'
longName = 'Baz1701 Refit Enterprise'
shipFile = 'bcrfit'
species = App.SPECIES_GALAXY
# SubMenu
menuGroup = 'Fed Ships'
playerMenuGroup = 'Fed Ships'


Foundation.ShipDef.bcrfit = BazTMPShipDef.BazTMPShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })


# Foundation.ShipDef.bcrfit.fMaxWarp
# Foundation.ShipDef.bcrfit.fCruiseWarp
Foundation.ShipDef.bcrfit.desc = 'After complete its historic 5 year mission the Enterprise under went an 18 month refit. As described by Captain Willard Decker she was almost an totally new ship.'


if menuGroup:           Foundation.ShipDef.bcrfit.RegisterQBShipMenu(menuGroup)
if playerMenuGroup:     Foundation.ShipDef.bcrfit.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]

Is there something else I'm missing?
Whatever knocks us back, can only make us stronger.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Changing a ships warps sounds
« Reply #18 on: June 02, 2009, 12:52:40 PM »
Here are the fixed snippits.
Remember, this tend not to propagate outside of their files, unless requested.


File 1 BazTMPRace.py

Code: [Select]
import Foundation
oBazTMPRace = Foundation.RaceDef("BazTMP", "BTMP")

File 2 BazTMPShipDef.py

Code: [Select]
import Foundation
import BazTMPRace

class BazTMPShipDef(Foundation.ShipDef):
    def __init__(self, abbrev, species, dict):
        dict['race'] = BazTMPRace.BazTMPRace
        Foundation.ShipDef.__init__(self, abbrev, species, dict)

File 3 BCrefit.py

Code: [Select]
##### Created by:
##### Bridge Commander Ship Menu Creator v5.6



import App
import Foundation
import BazTMPShipDef


abbrev = 'bcrfit'
iconName = 'bcrefit'
longName = 'Baz1701 Refit Enterprise'
shipFile = 'bcrfit'
species = App.SPECIES_GALAXY
# SubMenu
menuGroup = 'Fed Ships'
playerMenuGroup = 'Fed Ships'


Foundation.ShipDef.bcrfit = BazTMPShipDef.BazTMPShipDef(abbrev, species, { 'name': longName, 'iconName': iconName, 'shipFile': shipFile })


# Foundation.ShipDef.bcrfit.fMaxWarp
# Foundation.ShipDef.bcrfit.fCruiseWarp
Foundation.ShipDef.bcrfit.desc = 'After complete its historic 5 year mission the Enterprise under went an 18 month refit. As described by Captain Willard Decker she was almost an totally new ship.'


if menuGroup:           Foundation.ShipDef.bcrfit.RegisterQBShipMenu(menuGroup)
if playerMenuGroup:     Foundation.ShipDef.bcrfit.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]
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline baz1701

  • Posts: 3392
  • Cookies: 1434
Re: Changing a ships warps sounds
« Reply #19 on: June 02, 2009, 03:18:43 PM »
right I've posted the new script into the files using notepad++

So thing again bsod death. remove the ship py leave the race files there and it loads.

I have created a new plugin for both feddefship and shipdef and edited them in notepad++ again they game bsod?
Whatever knocks us back, can only make us stronger.