Jump to content

aquilux

Members
  • Posts

    199
  • Joined

  • Last visited

Everything posted by aquilux

  1. I'm not sure about real fuels, so you'll have to try it out both your suggested way, and by listing each fuel, but you'll have to make a whole copy of each fuel. The reason why I had to separate oxidiser and monoprop is that apparently " | " does not work in the filter section. If this changes, or I'm wrong, I'll be combining the two so that there is only one math section and what not.
  2. If the useEngineResponseTime components carry over to any new engines generated by MM copies of .cfg files, then yes you can, otherwise you could probably just change the resources it looks for (unless the engine code gets stupid complicated with the ability to select various fuels). But I just realised that I think I got the math backwards, and I'm in the process of reworking it, so give me a little while.
  3. Engine spool delay for all. Ok, so here is the completed patch. I'd like to thank @Aelfhe1m for all their help, I couldn't have figured this thing without them. This patch adds engine spool delays to all engines that pump some form of fluid for a chemical reaction (stock resources only). The delays are based off of engine mass, with the ratios being loosely based on the KW rocketry engines. //Add engine response time to engines that pump fluids but have no engine spooling. //Author: Aelfhe1m & Aquilux //////////////////////////////////////////////////////////////////// //This script adds engine spooling delay to engines that pump at least one liquid for a chemical reaction. //Engine spooling delay is dependent on the momentum of the turbines in the engine. //This script assumes that turbine mass is an average fraction of engine mass, thus delay is derived from engine mass. // //equations for accel/decel/mass relationships loosely derived from KW rocketry values: // //engineAccelerationSpeed = -1.16878m + 0.0875252m^2 + -0.00253789m^3 + 0.0000260111m^4 + 5.74868 // //engineDecelerationSpeed = 1.14632m + 0.0856818m^2 + -0.00246803m^3 + 0.0000251029m^4 + 5.82994 // //values and derived trend lines can be found here: https://goo.gl/733mKw (published google sheets chart) ////////////////////////////////////////////////////////////////// //Spooling for engines with oxidiser (to account for hybrid and other exotic chemical engines using oxidiser) @PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[Oxidizer],~useEngineResponseTime[True]]] //find parts containing ModuleEngines* that uses Oxidiser, but does not have useEngineResponseTime { @MODULE[ModuleEngines*] { useEngineResponseTime = True //create useEngineResponseTime //////////////////////////////////////////////////begin polynomial math for engineAccelerationSpeed MATHa = #$/mass$ //start first component temp variable @MATHa *= -1.16878 //complete first component // MATHb = #$/mass$ //start second component temp variable @MATHb != 2 //incorporate exponent @MATHb *= 0.0875252 //complete second component // MATHc = #$/mass$ //start third component temp variable @MATHc != 3 //incorporate exponent @MATHc *= -0.00253789 //complete third component // MATHd = #$/mass$ //start fourth component @MATHd != 4 //incorporate exponent @MATHd *= 0.0000260111 //complete fourth component // engineAccelerationSpeed = #$MATHa$ //combine first component @engineAccelerationSpeed += #$MATHb$ //combine second component @engineAccelerationSpeed += #$MATHc$ //combine third component @engineAccelerationSpeed += #$MATHd$ //combine fourth component @engineAccelerationSpeed += 5.74868 //combine fifth component //keep variables initialised //////////////////////////////////////////////////begin polynomial math for engineDecelerationSpeed @MATHa = #$/mass$ //start first component temp variable @MATHa *= 1.14632 //complete first component // @MATHb = #$/mass$ //start second component temp variable @MATHb != 2 //incorporate exponent @MATHb *= 0.0856818 //complete second component // @MATHc = #$/mass$ //start third component temp variable @MATHc != 3 //incorporate exponent @MATHc *= -0.00246803 //complete third component // @MATHd = #$/mass$ //start fourth component @MATHd != 4 //incorporate exponent @MATHd *= 0.0000251029 //complete fourth component // engineDecelerationSpeed = #$MATHa$ //combine first component @engineDecelerationSpeed += #$MATHb$ //combine second component @engineDecelerationSpeed += #$MATHc$ //combine third component @engineDecelerationSpeed += #$MATHd$ //combine fourth component @engineDecelerationSpeed += 5.82994 //combine fifth component // !MATHa = clear //clear temp variable !MATHb = clear //clear temp variable !MATHc = clear //clear temp variable !MATHd = clear //clear temp variable //////////////////////////////////////////////////end polynomial math } } //Spooling for engines with MonoPropellant @PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[MonoPropellant],~useEngineResponseTime[True]]] //find parts containing ModuleEngines* that uses MonoPropellant, but does not have useEngineResponseTime { @MODULE[ModuleEngines*] { useEngineResponseTime = True //create useEngineResponseTime //////////////////////////////////////////////////begin polynomial math for engineAccelerationSpeed MATHa = #$/mass$ //start first component temp variable @MATHa *= -1.16878 //complete first component // MATHb = #$/mass$ //start second component temp variable @MATHb != 2 //incorporate exponent @MATHb *= 0.0875252 //complete second component // MATHc = #$/mass$ //start third component temp variable @MATHc != 3 //incorporate exponent @MATHc *= -0.00253789 //complete third component // MATHd = #$/mass$ //start fourth component @MATHd != 4 //incorporate exponent @MATHd *= 0.0000260111 //complete fourth component // engineAccelerationSpeed = #$MATHa$ //combine first component @engineAccelerationSpeed += #$MATHb$ //combine second component @engineAccelerationSpeed += #$MATHc$ //combine third component @engineAccelerationSpeed += #$MATHd$ //combine fourth component @engineAccelerationSpeed += 5.74868 //combine fifth component //keep variables initialised //////////////////////////////////////////////////begin polynomial math for engineDecelerationSpeed @MATHa = #$/mass$ //start first component temp variable @MATHa *= 1.14632 //complete first component // @MATHb = #$/mass$ //start second component temp variable @MATHb != 2 //incorporate exponent @MATHb *= 0.0856818 //complete second component // @MATHc = #$/mass$ //start third component temp variable @MATHc != 3 //incorporate exponent @MATHc *= -0.00246803 //complete third component // @MATHd = #$/mass$ //start fourth component @MATHd != 4 //incorporate exponent @MATHd *= 0.0000251029 //complete fourth component // engineDecelerationSpeed = #$MATHa$ //combine first component @engineDecelerationSpeed += #$MATHb$ //combine second component @engineDecelerationSpeed += #$MATHc$ //combine third component @engineDecelerationSpeed += #$MATHd$ //combine fourth component @engineDecelerationSpeed += 5.82994 //combine fifth component // !MATHa = clear //clear temp variable !MATHb = clear //clear temp variable !MATHc = clear //clear temp variable !MATHd = clear //clear temp variable //////////////////////////////////////////////////end polynomial math } }
  4. Good eye. I'm not sure how I missed that. Same with the @ on the second section, that was leftover from when I made and deleted the variables twice.
  5. Something in the math keeps throwing exceptions, but I'm not seeing it. I'll keep looking, but for now, this is what I have. //Add engine response time to engines that pump fluids but have no engine spooling. //Author: Aelfhe1m & Aquilux //////////////////////////////////////////////////////////////////// //This script adds engine spooling delay to engines that pump at least one liquid for a chemical reaction. //Engine spooling delay is dependent on the momentum of the turbines in the engine. //This script assumes that turbine mass is an average fraction of engine mass, thus delay is derived from engine mass. // //equations for accel/decel/mass relationships loosely derived from KW rocketry values: // //engineAccelerationSpeed = -0.00488414m + 0.00482174m^2 + -0.000113284m^3 + 0.0000007285m^4 + 0.0898108 // //engineDecelerationSpeed = 0.00557365m + 0.00486915m^2 + -0.000118177m^3 + 0.0000007683m^4 + 0.123049 // //values and derived trend lines can be found here: https://goo.gl/733mKw (published google sheets chart) ////////////////////////////////////////////////////////////////// //Spooling for engines with oxidiser (to account for hybrid and other exotic chemical engines using oxidiser) @PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[Oxidizer],~useEngineResponseTime[True]]] //find parts containing ModuleEnginesFX that uses Oxidiser, but does not have useEngineResponseTime { @MODULE[ModuleEngines*] { useEngineResponseTime = True //create useEngineResponseTime //////////////////////////////////////////////////begin polynomial math for engineAccelerationSpeed MATHa = #$/mass$ //start first component temp variable @MATHa *= -0.00488414 //complete first component // MATHb = #$/mass$ //start second component temp variable @MATHb != 2 //incorporate exponent @MATHb *= 0.00482174 //complete second component // MATHc = #$/mass$ //start third component temp variable @MATHc != 3 //incorporate exponent @MATHc *= -0.000113284 //complete third component // MATHd = #$mass$ //start fourth component @MATHd != 4 //incorporate exponent @MATHd *= 0.0000007285 //complete fourth component // engineAccelerationSpeed = #$MATHa$ //combine first component @engineAccelerationSpeed += #$MATHb$ //combine second component @engineAccelerationSpeed += #$MATHc$ //combine third component @engineAccelerationSpeed += #$MATHd$ //combine fourth component @engineAccelerationSpeed += 0.0898108 //combine fifth component //keep variables initialised //////////////////////////////////////////////////begin polynomial math for engineDecelerationSpeed MATHa = #$/mass$ //start first component temp variable @MATHa *= 0.00557365 //complete first component // MATHb = #$/mass$ //start second component temp variable @MATHb != 2 //incorporate exponent @MATHb *= 0.00486915 //complete second component // MATHc = #$/mass$ //start third component temp variable @MATHc != 3 //incorporate exponent @MATHc *= -0.000118177 //complete third component // MATHd = #$mass$ //start fourth component @MATHd != 4 //incorporate exponent @MATHd *= 0.0000007683 //complete fourth component // engineDecelerationSpeed = #$MATHa$ //combine first component @engineDecelerationSpeed += #$MATHb$ //combine second component @engineDecelerationSpeed += #$MATHc$ //combine third component @engineDecelerationSpeed += #$MATHd$ //combine fourth component @engineDecelerationSpeed += 0.123049 //combine fifth component // !MATHa = clear //clear temp variable !MATHb = clear //clear temp variable !MATHc = clear //clear temp variable !MATHd = clear //clear temp variable //////////////////////////////////////////////////end polynomial math } } //todo: repeat patch for monoprop engines. If I comment out all the MATHd sections, the errors go away. I had thought that maybe it was an issue of too many characters for a number, but rounding up did not help.
  6. That's weird. I could have sworn I copy/pasted from a squad .cfg. That might be it. I was starting to guess that. I feel kind of dumb for not trying it. Thank you so much for the help @Aelfhe1m. Also, considering how atrocious the <code> tool is for tabbing and alignment, I'm not even going to try. I'll just copy/paste directly from notepad++ and dump it into the widget. Hopefully it comes out right on the other side when others copy/paste from the page. In case you or someone else uses notepad++ as well, there's a forum post that has a user defined language syntax that you can download and import to properly highlight MM patches.
  7. This is what I'm working with. //Add engine response time to engines that pump fluids but have no engine spooling. //Author: Aelfhe1m & Aquilux //////////////////////////////////////////////////////////////////// //This script adds engine spooling delay to engines that pump at least one liquid for a chemical reaction. //Engine spooling delay is dependent on the momentum of the turbines in the engine. //This script assumes that turbine mass is an average fraction of engine mass, thus delay is derived from engine mass. // //equations for accel/decel/mass relationships derived from KW rocketry values: // //engineAccelerationSpeed = -0.153838M + 0.00495282M^2 + 1.95125 // //engineDecelerationSpeed = -0.165447M + 0.0053904M^2 + 2.1989 // //values and derived trend lines can be found here: //https://goo.gl/733mKw (published google sheets chart) ////////////////////////////////////////////////////////////////// //Spooling for engines with oxidiser (to account for hybrid and //other exotic chemical engines using oxidiser) //This does not apply the test values to the stock parts in my game. //I could send you my Config Cach, but it might take a while to go through. @PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[Oxidiser],~useEngineResponseTime[True]]] //find parts containing ModuleEnginesFX that use //Oxidiser, but does not have useEngineResponseTime { @MODULE[ModuleEngines*] { //math functions not operative yet, just spits out errors, //////////////////////////////////////begin polynomial math for engineAccelerationSpeed // MATHa = #$/mass$ //start first component temp variable // @MATHa *= -0.153838 //complete first component // // // MATHb = #$/mass$ //start second component temp variable // @MATHb != 2 //incorporate exponent // @MATHb *= 0.00495282 //complete second component // // // MATHc = 1.95125 //set third component temp variable // // // //Do these all need to be "#$/MATH*$" ? // // // engineAccelerationSpeed = MATHa //combine first component // @engineAccelerationSpeed += MATHb //combine second component // @engineAccelerationSpeed += MATHc //combine third component // // // //temp variables not cleared to reduce operations // // // //////////////////////////////////////begin polynomial math for engineDecelerationSpeed // @MATHa = #$/mass$ //alter previously set first component temp variable // @MATHa *= -0.165447 //complete first component // // // @MATHb = #$/mass$ //alter previously set second component temp variable // @MATHb != 2 //incorporate exponent // @MATHb *= 0.0053904 //complete second component // // // @MATHc = 2.1989 //alter previously set third component temp variable // // // engineDecelerationSpeed = MATHa //combine first component // @engineDecelerationSpeed += MATHb //combine second component // @engineDecelerationSpeed += MATHc //combine third component // // // !MATHa = clear //clear temp variable // !MATHb = clear //clear temp variable // !MATHc = clear //clear temp variable // //////////////////////////////////////end polynomial math engineAccelerationSpeed = 6 //absurd test value engineDecelerationSpeed = 6 //more absurdity (for SCIENCE!) useEngineResponseTime = True //create useEngineResponseTime } } //todo: repeat patch for monoprop engines.
  8. @PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[!PROPELLANT[SolidFuel],~useEngineResponseTime[True]]] @PART[*]:HAS[@MODULE[ModuleEngines*]:HAS[@PROPELLANT[Oxidizer],~useEngineResponseTime[True]]] So I'm getting stumped. what is the difference between these, and why would the one asking for oxidiser fail but not the one rejecting solid fuel?
  9. So, I've managed to chart the engineAccelerationSpeed, engineDecelerationSpeed, and Mass values for the KW rocketry engines as examples and derive trendlines. Problem is the equations are polynomial. Now, I'm total crap at algebra and the MM algebra functions appear to be done one step at a time, but this'd be easily solved if I could use multiple variables. and toss them when done. Is this doable within MM config files, or will I have to somehow consolidate the mass variables together? These are the equations: engineAccelerationSpeed = -0.153838m + 0.00495282m2 + 1.95125 engineDecelerationSpeed =-0.165447m + 0.0053904m2 + 2.1989 I want to do something along the line of: engineAccelerationSpeed = #$/mass$ //start first componenet engineAccelerationSpeed *= -0.153838 //complete first component A = #$/mass$ //start second component A != 2 //continue second component A *= 0.00495282 //complete second component engineAccelerationSpeed += A //combine components one and two engineAccelerationSpeed += 1.95125 //combine final component //for final product Is this possible in MM code, or is there some better way to do it?
  10. So I 'll have to make separate MM configs for each resource I guess. I have a few hybrid rocket engines that still need to spool up the delivery of oxidiser, but use solid fuel. Yeah, just found that. Feel kind of dumb for it, but hey, that's how you learn right? Hmmm. Going to have to wrap my head around that math then, I got my assumptions backwards. That clarifies things. I guess I missed that in the documentation. I'll post my results when I figure out the math, as that's likely going to be the last thing I'll figure out.
  11. Sorry, I missed that bit. I've been trying this out: //Add engine response time to all instant response engines based on part mass. //Author: Aelfhe1m, Aquilux //@PART[*]:HAS[@MODULE[ModuleEngines*]]:HAS[PROPELLANT[Oxidizer]|PROPELLANT[MonoPropellant],~useEngineResponseTime[True]] //Aq version @PART[*]:HAS[@MODULE[ModuleEngines*]]:HAS[!PROPELLANT[SolidFuel],~useEngineResponseTime[True]] //Ae version //find parts containing ModuleEnginesFX that uses Oxidiser, but does not have useEngineResponseTime { @MODULE[ModuleEngines*] { engineAccelerationSpeed = #$/mass$ //edit engineAccelerationSpeed, initially set it equal to mass$ @engineAccelerationSpeed *= 4.3333 // modify by multiplying value using KW values for ratio engineDecelerationSpeed = #$/mass$ //same for decel @engineDecelerationSpeed *= 4.4333 // modify by KW ratio // other operators are += for add -= for subtract and |= for raise to the power of (e.g. square) useEngineResponseTime = True //create useEngineResponseTime } } Both my search string and your search string (starting up with one commented out, then restarting with the other commented out and clearing MM's cache between loads) just catches all engines. Solid fuel, Xenon, whatever. Also, I'm getting weird behavior with the "engine??celerationSpeed" values. The "Skipper" LF engine, being the heaviest on my test craft, throttles up and down the fastest, while the "Puff" Monoprop engine, the lightest of them all, is the slowest to respond. Looking at the documentation, ModuleEnginesFX appears not to support those variables, though they obviously have some sort of affect. Test Edit: BTW, your code often contained an extra closing bracket. I tried running it as is once, but it threw a fault. Was this an extra bracket, or were you missing an open bracket? Edit edit: I think I see it in the documentation. I'll try the assumption that it was needed for the nesting, and come back with the results.
  12. But once we find the .cfg we want to edit with the search section, aren't we then telling it which module to modify? What happens if it finds a part without the *FX module, then tries to modify the nonexistant module?
  13. The ModuleEnginesFX issue occured to me as well, but if we also test for ModuleEngines wouldn't we need to detect which one is being used, and change our package accordingly? I was just going to perfect the FX version, then copy it for the sans-FX version. Edit: I'm testing the code now with an absurd delay, I'll see if this patch is catching the solids, though I do have hybrid engines (Solid Fuel+Oxidiser), and figured they'd need spool up times as well.
  14. So, I seem to have it working, though it appears as though it's adding response time to solid fuel engines despite the addition of the requirement for oxidiser as a propellant. I'm trying to figure out what I did wrong, and if I can get it to check for oxidiser OR monopropellant. I know OR involves the | symbol, I just don't know how to incorporate it into the search. Here is what I have (ps: notepad++ is boss for catching nesting errors before you get syntax exceptions). //Add engine response time to all instant response engines based on part mass. //Author: Aelfhe1m, Aquilux @PART[*]:HAS[@MODULE[ModuleEnginesFX]]:HAS[PROPELLANT[Oxidizer]]:HAS[~useEngineResponseTime[True]] //find parts containing ModuleEnginesFX that uses Oxidiser, but does not have useEngineResponseTime { @MODULE[ModuleEnginesFX] { engineAccelerationSpeed = #$/mass$ //edit or create engineAccelerationSpeed, initially set it equal to mass$ @engineAccelerationSpeed *= 1.3333 // modify by multiplying value using KW values for ratio engineDecelerationSpeed = #$/mass$ @engineDecelerationSpeed *= 1.4333 // modify by KW ratio // other operators are += for add -= for subtract and |= for raise to the power of (e.g. square) useEngineResponseTime = True //edit or create useEngineResponseTime, may exist set to false, set true } }
  15. I've been reading through the documentation, and I had another question. Is there an OR operator for the search, or do we have to make a second copy of the patch?
  16. This looks great, I'll start playing around with it. Just two quick things. First, the engine masses listed appear to be the dry mass, so that simplifies things. Second, the tilde in: HAS[~useEngineResponseTime[True]] Is it to get the inverse result (returning true if following argument returns as anything other than true)? I can't seem to find the tilde in the syntax documentation. Edit: upon further thought... If we REALLY want to take into account tankage on engines we could find the dry mass to liquid volume ratio commonly used, derive the tankage weight based off of contained liquid, and subtract that from the part's dry mass before doing the engine spooling calculations, but I imagine that might be a bit much.
  17. Is there a way to do math to a value for one line, using input from another? I was wondering if it was possible to enable engine spooling for all engines that do not have it, and set the spool time according to each engine's mass.
  18. Oh, is that so... So where is the stock DV meter for the VAB and in flight?
  19. So... It's been half a year... Is this officially dead, or is there somewhere more appropriate to be looking for things like this?
  20. Couldn't you rotate the part mesh to make them line up properly to the snaps?
  21. Hey, this is a good thing for me. I had requested someone make it as I do not have the required skills. Now you have.
  22. Oooohhh boy! I've been looking for something like this for a while! This is much more like real life budgets work, though those are usually yearly (Source: was in the navy for 8+ years. October got really interesting as you either tried your best to spend what you had left to maximise what you got paid, or had you transferring fuel between jets because you're coming up short and can't fly some of them but have to keep flying). I even got to the point of requesting it. I had thought the mechanics through a fair amount so if you want to you can take a look at my super old mod request here:
  23. You're right @danfarnsy, I honestly didn't intend to come across as accusatory (the drawback of text yeah?). I was writing while rather aggravated so that may have snuck in, CKAN was supposed to keep anything like this from happening, and it was rather jarring to be blind sighted. As for the change log, I wasn't aware that spacedock had that feature. Good to know. @NecroBones, you make awesome stuff, and I seriously want to keep using it. Now to see how to install this thing around the CKAN updated version.
  24. NecroBones, this is why you set up the versioning correctly. I updated through CKAN and there was no hint of incompatibility even with AVC installed, no warnings, no announcements, no changes to the main post to indicate this issue. SpaceDock lists this latest update as for 1.1.3 still with not even a hard to notice line about the incompatibility, and the curse page says "supports 1.2" not "REQUIRES 1.2", which this update certainly does. I have a line of craft I'm developing using this that is now unusable. I can't find the old version anywhere to roll back and my 1.1.3 install is unplayable without loosing my new craft. Please version this file correctly on all platforms it's available and make the old version available for compatibility with people waiting for mods to be updated, or use module manager configs to only inject the categories that each version of KSP is capable of handling. I have to wait until you do either of these things before I can play KSP again or I loose 4 crew next time it loads.
×
×
  • Create New...