Jump to content

How to replace sound file?


Recommended Posts

I was made aware that an optional part of KWRocketry was actually overwriting a stock Squad file, so I'm trying to fix it.

The part is the launchClamp1, and the specific code is:

PART
{
        name = launchClamp1
        module = Part
.
.
.
        sound_decoupler_fire = activate

It's the last line, which is very strange.  It really looks backwards, in that the file is to the left of the equals sign.

Easy enough, so I wrote a MM patch to make it look like this:

PART
{
        name = launchClamp1
.
.
.
		sound_decoupler_fire_quietkw = activate

The file in question is: sound_decoupler_fire_quietkw.wav

It doesn't seem to be seen when I put it into KWRocketry/Sounds

I would rather not have the file go into any other location, but I can't figure out how to properly specify the new file's location

The log shows it loading the audio file, and then it says no sound file (because I added the 2nd line).  When I remove that and put in EFFECTS instead, no error, but no sound

Here is the latest version of the patch, I tried putting in an effect with the name activate

@PART[launchClamp1]
{
	-sound_decoupler_fire = activate
	%sound_decoupler_fire_quietkw = activate
	%EFFECTS
	{
		activate
		{
			AUDIO
			{
				clip = KWRocketry/launchClamp1/Sounds/sound_decoupler_fire_quietkw
				volume = 1.0
				pitch = 1.0
				loop = false
			}
		}
	}
}

Help?

Edited by linuxgurugamer
Link to comment
Share on other sites

34 minutes ago, linuxgurugamer said:

It's the last line, which is very strange.  It really looks backwards, in that the file is to the left of the equals sign.

Why you say that just look at a stock engine that don't use ModuleEnginesFX

Spoiler

PART
{
    name = microEngine
    module = Part
    author = NovaSilisko
    mesh = model.mu
    scale = 1
    rescaleFactor = 1
    node_stack_top = 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0
    node_stack_bottom = 0.0, -0.2816985, 0.0, 0.0, -1.0, 0.0, 0
    fx_exhaustFlame_white_tiny = 0.0, -0.2816985, 0.0, 0.0, 1.0, 0.0, running
    sound_vent_medium = engage
    sound_rocket_mini = running
    sound_vent_soft = disengage
    sound_explosion_low = flameout
    TechRequired = propulsionSystems
    entryCost = 1500
    cost = 110
    category = Engine
    subcategory = 0
    title = LV-1 "Ant" Liquid Fuel Engine
    manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co
    description = What is this, an engine for ants?
    attachRules = 1,0,1,0,0
    mass = 0.02
    // heatConductivity = 0.06 // half default
    emissiveConstant = 0.8 // engine nozzles are good at radiating.
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.2
    angularDrag = 2
    crashTolerance = 7
    maxTemp = 2000 // = 3600
    bulkheadProfiles = size0
    MODULE
    {
        name = ModuleEngines
        thrustVectorTransformName = thrustTransform
        exhaustDamage = False
        ignitionThreshold = 0.1
        minThrust = 0
        maxThrust = 2
        heatProduction = 25
        fxOffset = 0, 0, 0.02
        EngineType = LiquidFuel
        PROPELLANT
        {
            name = LiquidFuel
            ratio = 0.9
            DrawGauge = True
        }
        PROPELLANT
        {
            name = Oxidizer
            ratio = 1.1
        }
        atmosphereCurve
        {
            key = 0 315
            key = 1 85
            key = 3 0.001
        }
    }
    MODULE
    {
        name = ModuleTestSubject
        environments = 8
        useStaging = False
        useEvent = True
    }
}

 

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

It's strange because the data is on the left.  Not because it is in the file.

And, how can I replace it with my own sound file?

Tried many thing and none worked and remember there have been alot of sound plugins and looking back they all kind of just stop getting worked on here is one

 

Link to comment
Share on other sites

19 hours ago, MeCripp said:

Tried many thing and none worked and remember there have been alot of sound plugins and looking back they all kind of just stop getting worked on here is one

 

Sounds like you put a fair amount of time into this.  Thanks

I'd rather not include another DLL just to replace one sound.

So if no one has any ideas, I'll probably end up putting the new file into the Squad folder. At least this won't overwrite any stock files anymore.

Link to comment
Share on other sites

Just now, Phineas Freak said:

@linuxgurugamer There are two problems with the sounds:

  • KSP has a bug that does not allow any sound files outside of the part folder to be used.
  • Because of the above bug, it is not possible to replace neither the FX or the sounds of parts that use the "old" conventions via MM (i.e. "@sound_decoupler_fire = my_activation_sound).

Ok.  I've solved this by using MM to patch the cfg, and dropping a new sound file into the part folder.

Not perfect, but at least it doesn't change any files.

Thanks for confirming that my solution is essentially the only way to do it.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...