Jump to content

[SOLVED] Help; adding custom sound to a part...


Recommended Posts

I'm quite new to the whole config side of KSP. I wanted to try and make an animated part, which was easier than I thought thanks to partTools, but how do I go around adding custom sounds to a part? I've read the documentation, but I feel like something is missing there... Not quite sure.

I've got my sounds folder with my .wav inside.

I've tried something like this:


EFFECTS
{
sinkMotor
{
AUDIO
{
channel = Ship
clip = Heatsink/sounds/sound_extend
volume = 1.0 1.0
pitch = 1.0 1.0
loop = false
}
}
}

MODULE
{
name = ModuleAnimateGeneric
animationName = ExtendShield
startEventGUIName = "Extend"
endEventGUIName = "Contract"
toggleActionName = Toggle Heat Sink

startRetractEffect = sinkMotor
startDeployEffect = sinkMotor
}

I don't know, but is startRetractEffect or ModuleAnimateGeneric an issue here? Is there a list of possible calls somewhere? Didn't find any in the doc. I'm more of a designer than a "coder", so go easy on me please. :blush:

Just to be clear, when I right click the part and hit "Extend", the animation starts, which is when I want my sound to start as well.

Edited by Neeken
Link to comment
Share on other sites

Well, that's a big part of the problem. Can't really find many solid code references online. And all examples are for engines and whatnot, which is not what I need. They use "sound_filename = activate" etc. It's the "activate" here I need to swap out. Sadly, I can't find the different possible calls to put there instead. Of course, might be the one I have to use either way, but I would like a confirmation.

stock ModuleAnimateGeneric doesn't call FX nodes. You have to use FSAnimateGeneric

I see, will try it. Though I'm pretty sure I did. And this is the main problem, I couldn't find a reference to "FSAnimateGeneric" anywhere. The API isn't... well, very good... :P

Link to comment
Share on other sites

ModuleAnimateGeneric doesn't have settings for FX at all. for stock part modules, only ModuleEngineFX calls FXnode for particles and audio; and it only does so in 5 specific conditions: Power; Running; Engage; Disengage; Flameout

Firespitter has one of the best module documentations available in KSP mods; It's not part of stock modules. Check B9's landing gears for configs that can help your setup.

https://docs.google.com/document/d/1iD52DfHft04Hb48TEhF5a4n5JOc8efUevdg5Y_QPICQ/edit

Link to comment
Share on other sites

... it only does so in 5 specific conditions: Power; Running; Engage; Disengage; Flameout

I see. So that's the issue then.

Firespitter has one of the best module documentations available in KSP mods; It's not part of stock modules. Check B9's landing gears for configs that can help your setup.

Yes, I do have a firespitter version that was in a b9 pack or something, can't remember where I got it from atm. Will take a look, thanks.

Edit: So it seems like it's not possible to add sound to other types of parts (other than gears, engines...) without creating a plugin yourself. I'll keep looking though.

Edited by Neeken
Link to comment
Share on other sites

Well... Never mind me. You were totally right, I only had to use FSAnimateGeneric. >< No idea why it didn't work the first few times I tried. Thanks for your help though. :)

So this is what it ended up as:


EFFECTS
{
sinkMotor
{
AUDIO
{
channel = Ship
clip = HeatSink/sounds/sound_extend
volume = 0.0 0.0
volume = 1.0 1.0
pitch = 0.0 0.0
pitch = 1.0 1.0
loop = false
}
}
}

MODULE
{
name = FSanimateGeneric
animationName = ExtendShield
startEventGUIName = Extend
endEventGUIName = Contract
toggleActionName = Toggle Heat Sink
playAnimationOnEditorSpawn = False
startRetractEffect = sinkMotor
startDeployEffect = sinkMotor
}

Which was pretty much what I tested with earlier. I did update the firespitter.dll at the same time as I rewrote the entire script, so who knows if it was the dll or the script that had errors. *note to self (again): eliminate one thing at a time!*

Link to comment
Share on other sites

Yea, I'm aware of that. But I did test multiple times with FS instead after you mentioned it, but it still wouldn't work. I might've messed up my paths or something silly like that, as I've re-exported the .mu file and renamed everything all over again as well. But what ever, it works, so I'm happy. :]

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...