Didn't forget you Jim but I didn't get around to finishing this up till this afternoon.
Bill's answer is the short one and should work for most cases. For some if there is a soundthread in the loco's script you need to edit the script. Anyhow here's a longer one:
The new steam sound system actually works pretty good. But there are several pieces
spread out in several assets that need to be looked at to make it works properly.
The following 3 items need to be addressed with any upgrade of older steam locos to the
new steam sound system.
The examples are for his USRA Light 2-8-2:
1)The loco's config file needs to reference a new style enginesound asset.
Open for editing in explorer and edit the following tag:
change
enginesound <kuid:96914:53015>
to
enginesound <kuid2:126323:53050:1>
or any other new steam sound asset kuid that you perfer - just make sure it's installed
or you'll get a missing dependency error.
When you edit the configs you should also change the KUID container to reflect any
changes made to asset kuids referenced in the file.
Save and commit.
2)The loco's config file needs to reference a new style enginespec asset or the old
style one needs to have two tags added.
If you're referencing a new enginespec asset open for editing in explorer and edit the following tag:
change
enginespec <kuid:96914:51479>
to
enginespec <kuid:182464:70001>
or any other new steam espec asset kuid that you perfer - just make sure it's installed
or you'll get a missing dependency error.
However if you want to keep Ben's espec for some reason don't change the reference. Instead
open the asset referenced (kuid:96914:51479) for editing in explorer and edit the
config file. Find the steam container and add 2 lines - right at the top after the { is a good place:
Code:
steam
{
number-cylinders 2 <--- add line 1
number-power-strokes 2 <--- add line 2
... don't change the rest of the steam container
Save and commit.
3)The loco's bogeys need to have a direct-drive tag with the appropriate value
specified in their config files.
Right click on the loco in CM and select view dependencies then view in main list. The
list will include all the bogey assets referenced in the config. Open the main drive
wheel bogey and edit the config and either edit or add a direct-drive 1 tag making sure
the value is 1.
Check all other bogeys referenced and make sure the direct-drive tag value is 0 or
there is no direct-drive tag in the config, Edit the configs as necessary.
Save and commit.
In addition, for Ben's loco's that have a custom script with a sound thread that
handles exhaust cuffs the custom script has to be edited and 1 line (or 2 for the 2-8-8-2) commented
out. Usually if the loco asset has a subfolder named sound the script will need to be
modified. AFAIK all of Ben's custom loco scripts are named steamlocomotive0905.gs. If
you edit scripts use your usual editor. You just need one that works with a straight
text file. In windows, notepad.exe will do for small jobs like this. Just make sure
when you're done and have save everything the filename hasn't been changed and it still
has a .gs extension.
open the file "steamlocomotive0905.gs" in the editor and locate the "public void Init(void)" method.
find the line:
SoundSetup();
and change to:
//SoundSetup();
Save and commit.
The line is identified in red in the following partial listing:
Code:
//
// SteamLocomotive.gs
//
// Version 0.9.0.5
//
// by R. Pearson 07-11-05
//
// modified with poor man's steam sounds - four individual chuffs regardless of control
method
// pitch-shifting loop sounds from standard system still used
//
// **********
// DEPENDENCIES:
// A copy of SteamLocoCabinData.gs needs to be in the same directory with this
script
// for this script to work.
// **********
//
// SteamLocomotive class is now derrived from SteamLoco class
// SteamLoco class is derrived from Locomotive class as a base class for steam
// locomotives using cab scripts derrived from SteamCabinwithFireman class - RRP 05-02
-06
//
//include "locomotive.gs"
include "cabin.gs"
include "common.gs"
include "SteamLocoCabinData.gs"
class SteamLocomotive isclass SteamLoco
{
Asset meAsset;
public bool UnloadProduct(LoadingReport report);
public string GetDescriptionHTML(void);
string GetPropertyName(string propertyID);
string GetPropertyDescription(string propertyID);
string GetPropertyType(string propertyID);
void LinkPropertyValue(string propertyID);
//void SetPropertyValue(string propertyID, int value);
define float DDIA = 63.0f; // driver dia in inches
define float QTR = 0.01975f * DDIA; // 99% of distance (m) traveled in 1
quarter rotation
thread void SoundSetup (void) {
int i = 0;
float fac1 = 0.f;
float vol = 1.0f;
float[] fac2 = new float[4];
fac2[0] = 0.95f;
fac2[1] = 1.05f;
fac2[2] = 0.85f;
fac2[3] = 1.15f;
string[] stroke = new string[4];
stroke[0] = "sound/piston_stroke1.wav";
stroke[1] = "sound/piston_stroke2.wav";
stroke[2] = "sound/piston_stroke3.wav";
stroke[3] = "sound/piston_stroke4.wav";
while(1) {
float speed = Math.Fabs(GetVelocity());
if (speed < 0.1f) { // sorry but in TRS2004 the velocity bug means 1st
non 0 velocity is at 0.277 m/s
// we should all be using TRS2006 if we want the
best from the new steam sounds.
Sleep (1.0);
}
else {
// set exhaust volume based on regulator setting, cutoff and loco
speed
// modify to suit your preferences final vol is between 0-1 and is
product of the 3 effects
fac1 = 0.05 + GetEngineSetting("regulator");
if (fac1 < 0.25f)
fac1 = 4.0f * fac1 * Math.Fmin(Math.Fabs(GetEngineSetting
("reverser"))*2.0f + 0.1f,1.0f);
else
fac1 = Math.Fmin(Math.Fabs(GetEngineSetting("reverser"))*2.0f
+0.1f,1.0f);
vol = fac1;
/*
if (speed < 5.36448f)
vol = fac1;
else if (speed < 9.36f)
vol = (1.33-0.0625*speed)*fac1;
else
vol = 0.75f*fac1;
*/
if (speed < 8.9408) {
for (i=0; i<4; i++) {
World.PlaySound(meAsset,stroke[i],vol,50.f,750.f,me,"a.bog0");
Sleep(QTR/speed*fac2[i]);
speed = Math.Fabs(GetVelocity());
if (speed < 0.05f)
break;
}
}
else if (speed < 9.835) {
for (i=0; i<4; i++) {
World.PlaySound(meAsset,stroke
[i],vol*0.75,50.f,750.f,me,"a.bog0");
Sleep(QTR/speed*fac2[i]);
speed = Math.Fabs(GetVelocity());
if (speed < 0.05f)
break;
}
}
else if (speed < 10.729) {
for (i=0; i<4; i++) {
World.PlaySound(meAsset,stroke
[i],vol*0.5,50.f,750.f,me,"a.bog0");
Sleep(QTR/speed*fac2[i]);
speed = Math.Fabs(GetVelocity());
if (speed < 0.05f)
break;
}
}
else if (speed < 11.623) {
for (i=0; i<4; i++) {
World.PlaySound(meAsset,stroke
[i],vol*0.25,50.f,750.f,me,"a.bog0");
Sleep(QTR/speed*fac2[i]);
speed = Math.Fabs(GetVelocity());
if (speed < 0.05f)
break;
}
}
else{
Sleep (1.0);
}
} // end else
} // end while
} //end thread SoundSetup
public void Init(void)
{
inherited();
//Interface.Log("***** " + myName + " Init in loco called *****");
//Interface.Print(myName + " Init in loco called");
meAsset = GetAsset();
[COLOR=#ff0000] SoundSetup(); //<---- EDIT this line
[/COLOR] }
public bool UnloadProduct(LoadingReport report)
{
bool UnloadFlag = false;
return UnloadFlag;
}
// Custom surveyor setup window
public string GetDescriptionHTML(void) {
string htmlData = inherited();
Str.TrimRight(htmlData, "</body></html>");
...
Commit any open assets and check for any errors or missing dependencies.
Bob Pearson