Jump to content

Snjo

Members
  • Posts

    779
  • Joined

  • Last visited

Everything posted by Snjo

  1. I just put a rocket with floats into orbit with no ill effects. Can you post a craft file for one that fails, and describe your flight path? edit: well, no Ill effects until shortly after this when I "landed" with no parachute
  2. Not all features are done yet for the engine sound module, but it will all work very soon. The silence at low thrust thing is going to be controlled by a cfg setting. So the documetation is this: MODULE { name = FSengineSounds //the names of the sound in the game database. Open the alt+f12 debug menu/sounds to seea list of loaded ones: // any unnamed sound will be disabled, so just comment out the lines for the sounds you don't use. //the engine start sound engage = Firespitter/Sounds/sound_fspropstart //the constant thrust independent background hum of an engine (unimplemented) running = // the thrust based pitched main engine sound power = Firespitter/Sounds/sound_fspropidle // the engine shut down sound (unimplemented) disengage = // loss of fuel flameout sound (unimplemented) flameout = // engine overheat warning sound warning = Firespitter/Sounds/sound_fsheatDing // the default pitch of the engine power sound. 1 is the same pitch as the original sound file. powerPitchBase = 1.0 // how much above the default pitch the power goes based on thrust. final pitch = powerPitchBase + (thrust * thrustAddedToPitch ) thrustAddedToPitch = 1.0 // how quickly the engine power sound volume ramps up from silent when started. set to 1 for immediate full volume. This value is added to the volume every 0.2 seconds until it reaches 1. powerFadeInSpeed = 0.005 // how long the volume is off after starting the engine, to allow the engage sound to be heard powerFadeInDelay = 0.5 // thrust values below this level will yield a silent engine sound (not implemented) powerLowerThreshold = 0.0 // volume adjustment for the power sound powerVolume = 1.0 // volume adjustment for the engage sound engageVolume = 1.0 // normalized engine heat value at which the warning sound chimes. set above 1 to disable (or don't name the sound of course) warningSoundThreshold = 0.8 // how often the warning sound can play in seconds warningCooldownTime = 2.0 // random start dealy for the power sound, to make several engines not play in sync. makes for a better soundscape. randomStartDelay = 1.0 //for playing engines slightly out of sync } The unimplemented things might spawn some more variables, but probably just volume settings.
  3. Now that I've gotten my animation module up and running I can do the bomb bays right, with the option of opening it in the hangar for placing stuff inside, but having it closed on launch.
  4. IF you deviate from the structure made by the mod creator, you can break stuff loading from the game database, if the plugin uses that. I load sounds from Firespitter/Sounds in the game database. If the sounds had been moved, that would break. With increasing use of parts fetching resources from other parts' assets, I think this will become even more of a thing to keep in mind.
  5. Yeah, I 'm not touching the playAutomatically, but I'm also making it irrevlevat, I think. The fact that it was brought up means I may not have been successful. Each update the current animation time and speed is saved to a persistent variable, so I don't have to handle the onsave and onload. For whatever you like. Maybe you have a nice gun to mount there. Maybe some science equipment. Maybe this guy:
  6. Well, the weird thing is, I actually do tell the clip to run as soon as it launches, just in the opposite direction of what you would think, or at 0 speed, so it really shouldn't matter. (that's just to get it in the same position as it was when the game saved the craft)
  7. What are you making?!? Maybe it's the fact that they have infinite node strength. I'll have to test that out with different values. No. So what does the stock one do, in combination with what setting in unity? Does it play too much, or too little?
  8. I've made a new module to replace the stock moduleAnimateGeneric, which can have EVA actions, start in the deployed state, custom animation speed,, and can handle more than one animation on a part, which was a problem. As part of that I made a hangar UI toggle for the start state, and then adapted that for my engines as well, which is very good news for people building push props. You can now set the direction the prop is pushing while in the hangar action editor, so you won't need to remember it after you launch: edit: pre-release with these features v5.1 pre-release -Fuel drop Tank -The Electric helicopter rotor can now start deployed (by using the action editor popup in the hangar) -Engines with reverse thrust capabilities can now set default state in the hangar action editor -FSanimateGeneric, replacement module for ModuleAnimateGeneric. (EVA toggle, custom speed, set start state in hangar, multiple animations per part) -Bug fix: Wheel colliders spamming errors on launch -Bug fix: GUI parts spamming nullrefs when launching from main menu directly to runway
  9. There's no need to find the right place for the folder. Just put the Firespitter folder in the GameData folder alongside the Squad folder. If you have no parts actions or sounds, that means you did it all too manually, and lost the plugin and sounds folder in the process. Check the guide for more info
  10. None of those parts do anything new I think. I just corrected a wheel collider bug that threw some errors, but I doubt that would be it. About the example craft, putting them in a Ships folder was my first attempt, it didn't get included in the list. I don't like having my craft list cluttered by stuff I didn't make if I install a mod, so I 'd rather you move them from example craft to the stock or save/ships folder yourself. Also moving them outside the GamaData folder seems silly now that we've got this nice tidy way to get rid of a whole mod.
  11. Oh no! Can you give me steps to replicate it? What parts did you use, and how?
  12. I gots to try that Are you using mbm textures or png. I use png. Are you naming your textures in the cfg? Don't do that. Did you draw them with crayons? Or are they messed up in some other way?
  13. Yes, put it anywhere in there, either in its own folder alongside Squad and Firespitter, or in the Firespitter folder.
  14. There's no reason engine sounds shouldn't work on Mac now, since I now load the sounds directly from the games database in a new way. If a mac user can test it and report back, I'd appreciate it. I'll fire up linux to test that myself.
  15. The new version for KSP 0.20.0 is now on spaceport Download from Spaceport Public change log and todo-list Confused? Check the Firespitter parts guide v5.0 New: -KSP 0.20.0 compatible -Two new flags -Sounds should now work on mac Changes: Changed part names, these now start with FS! Read more below. fighterTailGear bomberLandingGear propellerEngine PropellerEnginePush PropellerEngineElectric copterRotorMain copterRotorMainElectric copterRotorMainLarge copterRotorTail copterRotorTail2 copterRotorFenestron copterRotorFenestronBothFins copterRotorFenestronNoFins FSswampEngine - corrected typo (FSswampEnginre) fighterWing jerrycan fighterLandingGear -fenestron rescaleFactor set to 1.0 -set part scale values to 1.0 - Info Popup: The hot-key can be deactivated with a button, so it will not interfere with RCS keybinds in flight mode. Changed many PartModule plugin class names. Added a new module to handle engine sounds. Allows for sounds to run even at the bottom throttle levels on propeller engines. It more consistently plays the engage engine sound, and has an optional overheat warning sound. removed HoverEngine (now found in FS Experiments) Important All these re-namings will severely affect you ability to continue a saved game with craft that contain any of the engines or wings. Back up your save games! It will also give errors on saved craft that contain these changed parts. You can, if you are a notepad hero, go into the craft file, find any part names or FS part module names that don't start with FS, and add FS to the names. I successfully resurrected the included example craft this way. You will want to pull the engine off and replace it afterwards.
  16. v5.0 Pre-release for KSP 0.20.0 Download Changes: Changed part names, now start with FS! Read more below. fighterTailGear bomberLandingGear propellerEngine PropellerEnginePush PropellerEngineElectric copterRotorMain copterRotorMainElectric copterRotorMainLarge copterRotorTail copterRotorTail2 copterRotorFenestron copterRotorFenestronBothFins copterRotorFenestronNoFins FSswampEngine - corrected typo (FSswampEnginre) fighterWing jerrycan fighterLandingGear Changed many PartModule plugin class names. Added a new module to handle engine sounds. Allows for sounds to run even at the bottom throttle levels on propeller engines. It more consistently plays the engage engine sound, and has an optional overheat warning sound. removed HoverEngine (now found in FS Experiments) - Info Popup: The hot-key can be deactivated with a button, so it will not interfere with RCS keybinds in flight mode. Important All these re-namings will severely affect you ability to continue a saved game with craft that contain any of the engines or wings. Back up your save games! It will also give errors on saved craft that contain these changed parts. You can, if you are a notepad hero, go into the craft file, find any part names or FS part module names that don't start with FS, and add FS to the names. I successfully resurrected the included example craft this way. You will want to pull the engine off and replace it afterwards. I'd really appreciate it if you play around with this and reported any errors on this forum. Thanks, and I'm sorry if I broke your stuff
  17. Add this to the top: PART { And this to the bottom: } And if it's not there already, add the line Scale = 1 You can put it in the GameData folder in a subfolder of your choosing. It would be good to replicate how the Squad folder is set up
  18. KSP doesn't seem to trigger the OnApplicationPause event. At least not when just throwing this in the plugin: private void OnApplicationPause(bool pauseStatus) { Debug.Log("Paused: " + pauseStatus); } I was hoping for something like bool HighLogic.GameState.paused But have come up empty so far.
  19. This will get fixed, but the way I understand it is, the engine stock sounds are loaded from unity, not from the folder structure into the game database. The game database only contains other sounds. They ran into a bug where these sounds got loaded twice, so they removed the smarter method In the old cfg parsing, all sounds were at some root level, now that that's no longer true, it doesn't parse that folder structure correctly, or we don't know how to write it in the cfg. Most likely we will need to wait for a patch, and the write something new in the cfg file that includes the path in the game database.
  20. I'm making my own engine sound handler that loads sounds from the game database and plays it according to thrust. For the very simple sound loading code/test, check this thread, otherwise full code: plugin using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; public class FSengineSounds : PartModule { [KSPField] public string engage; [KSPField] public string running; [KSPField] public string power; [KSPField] public string disengage; [KSPField] public string flameout; [KSPField] public string warning; [KSPField] public float powerFadeInSpeed = 0.02f; [KSPField] public float powerFadeInDelay = 0.0f; [KSPField] public float powerVolume = 1.0f; [KSPField] public float engageVolume = 1.0f; [KSPField] public float powerPitchBase = 0.8f; [KSPField] public float thrustAddedToPowerPitch = 0.3f; [KSPField] public bool useDebug = false; [KSPField] public bool showVolumeDebug = false; private ModuleEngines engine; private bool oldIgnitionState; private bool oldFlameOutState; private float currentPowerFadeIn; private float currentPowerDelay; private string doesExist = "..."; public FXGroup engageGroup; public bool engageAssigned; public FXGroup runningGroup; public bool runningAssigned; public FXGroup powerGroup; public bool powerAssigned; public FXGroup disengageGroup; public bool disengageAssigned; public FXGroup flameoutGroup; public bool flameoutAssigned; public FXGroup warningGroup; public bool warningAssigned; /// <summary> /// Fills an FXGroup with sound values /// </summary> /// <param name="group">The group that will receive a new sound</param> /// <param name="name">The name of the sound in the game database. No file extensions. e.g. Firespitter\Sounds\sound_fspropidle</param> /// <param name="loop">Does the sound loop by default?</param> /// <returns></returns> public bool createGroup(FXGroup group, string name, bool loop) { if (name != string.Empty) { if (!GameDatabase.Instance.ExistsAudioClip(name)) return false; group.audio = gameObject.AddComponent<AudioSource>(); group.audio.volume = GameSettings.SHIP_VOLUME; group.audio.rolloffMode = AudioRolloffMode.Logarithmic; group.audio.dopplerLevel = 0f; group.audio.panLevel = 1f; group.audio.clip = GameDatabase.Instance.GetAudioClip(name); group.audio.loop = loop; group.audio.playOnAwake = false; return true; } return false; } private void OnDestroy() { GameEvents.onGamePause.Remove(new EventVoid.OnEvent(this.FSOnPause)); GameEvents.onGameUnpause.Remove(new EventVoid.OnEvent(this.FSOnUnPause)); } private void FSOnPause() { powerGroup.audio.volume = 0f; } private void FSOnUnPause() { powerGroup.audio.volume = GameSettings.SHIP_VOLUME; } public override void OnStart(PartModule.StartState state) { base.OnStart(state); engageAssigned = createGroup(engageGroup, engage, false); runningAssigned = createGroup(runningGroup, running, true); powerAssigned = createGroup(powerGroup, power, true); disengageAssigned = createGroup(disengageGroup, disengage, true); flameoutAssigned = createGroup(flameoutGroup, flameout, false); warningAssigned = createGroup(warningGroup, warning, false); engine = part.GetComponent<ModuleEngines>(); GameEvents.onGamePause.Add(new EventVoid.OnEvent(this.FSOnPause)); GameEvents.onGameUnpause.Add(new EventVoid.OnEvent(this.FSOnUnPause)); /*public string engage; public string running; public string power; public string disengage; public string flameout; public string warning;*/ /* powerGroup.audio = gameObject.AddComponent<AudioSource>(); powerGroup.audio.volume = 1; powerGroup.audio.Stop();*/ } public override void OnFixedUpdate() { base.OnFixedUpdate(); if (engine != null) { if (TimeWarp.WarpMode == TimeWarp.Modes.HIGH && TimeWarp.CurrentRate > 1.1f) { if (powerAssigned) powerGroup.audio.volume = 0f; } else { // power/running sound if (engine.getIgnitionState && !engine.getFlameoutState) { if (currentPowerDelay > 0f) currentPowerDelay -= Time.deltaTime; float adjustedThrustPitch = ((engine.finalThrust / engine.maxThrust) * thrustAddedToPowerPitch) + powerPitchBase; if (powerAssigned && currentPowerDelay <= 0f) { if (currentPowerFadeIn < 1f) { currentPowerFadeIn += powerFadeInSpeed; if (currentPowerFadeIn > 1f) currentPowerFadeIn = 1f; } powerGroup.audio.volume = GameSettings.SHIP_VOLUME * currentPowerFadeIn * powerVolume; if (!powerGroup.audio.isPlaying) powerGroup.audio.Play(); powerGroup.audio.pitch = adjustedThrustPitch; } } else { if (powerAssigned) { if (powerGroup.audio.isPlaying) powerGroup.audio.Stop(); currentPowerFadeIn = 0f; currentPowerDelay = powerFadeInDelay; } } // engage sound if (engageAssigned) { if (engine.getIgnitionState && !oldIgnitionState) { if (!engine.getFlameoutState) { engageGroup.audio.volume = GameSettings.SHIP_VOLUME * engageVolume; engageGroup.audio.Play(); } } oldIgnitionState = engine.getIgnitionState; } } //if (part.temperature > part.maxTemp * warningSound) //{ // if (timeCounter == 0) // { // heatDing.Play(); // } // timeCounter++; // if (timeCounter >= 100) // { // timeCounter = 0; // } //} //else //{ // timeCounter = 0; //} } } public void OnGUI() { if (showVolumeDebug) GUI.Label(new Rect(250f, 300f, 200f, 30f), "engine volume: " + currentPowerFadeIn); if (useDebug) { Rect menuItemRect = new Rect(250f, 200f, 300f, 150f); Vector2 buttonSize = new Vector2(30f, 30f); Vector2 menuItemSize = new Vector2(200f, 35f); if (GUI.Button(new Rect(menuItemRect.x, menuItemRect.y, buttonSize.x, buttonSize.y), "OK")) { doesExist = "" + GameDatabase.Instance.ExistsAudioClip(power); } if (GUI.Button(new Rect(menuItemRect.x + buttonSize.x + 10f, menuItemRect.y, buttonSize.x, buttonSize.y), "C")) { doesExist = "clear"; } if (GUI.Button(new Rect(menuItemRect.x + ((buttonSize.x + 10f) * 2), menuItemRect.y, buttonSize.x, buttonSize.y), ">")) { //powerGroup.audio.clip = GameDatabase.Instance.GetAudioClip(soundName); //source.PlayOneShot(clip); powerGroup.audio.Play(); } GUI.Label(new Rect(menuItemRect.x + ((buttonSize.x + 10f) * 3), menuItemRect.y, menuItemSize.x - buttonSize.x - 10f, buttonSize.y), "exists: " + doesExist); menuItemRect.y += 30; power = GUI.TextField(new Rect(menuItemRect.x + buttonSize.x + 10f, menuItemRect.y, menuItemSize.x - buttonSize.x - 10f, buttonSize.y), power); } } } part.cfg PART { [...] // --- general parameters --- name = FScopterRotorMain module = Part author = Snjo [...] // --- FX definitions --- //fx_exhaustLight_yellow = 0.0, -0.1, 0.0, 0.0, 0.0, 1.0, power //fx_smokeTrail_light = 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, power fx_exhaustSparks_flameout = 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, flameout // --- Sound FX definition --- //sound_fspropstart.wav = engage //sound_fscoptermain.wav = power sound_explosion_low = flameout [...] MODULE { name = FSengineSounds useDebug = False showVolumeDebug = True engage = Firespitter/Sounds/sound_fspropstart //running = power = Firespitter/Sounds/sound_fscoptermain //disengage = //flameout = warning = Firespitter/Sounds/sound_fsheatDing powerPitchBase = 0.8 thrustAddedToPitch = 0.3 powerFadeInSpeed = 0.005 powerFadeInDelay = 1.0 powerVolume = 0.5 engageVolume = 1.5 } MODULE { name = ModuleEngines [...] } } I'm building this for propeller engines, so I haven't implemented the minimum thrust threshold to stop the sound yet, like you would have with the jet engines. And not all sounds are playing yet, but you get the idea hopefully.
  21. thanks! that got me to notice i had defined the texture badly on the jerrycan
×
×
  • Create New...