Jump to content

Meltdown

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by Meltdown

  1. You can use vectoralgebra and 'part:position - ship:position' to get the length of an object.
  2. function circa { parameter a,b,tollerance. return abs(a-b) <= tollerance. } "abs(a.b) <= tollerance" is already a boolean expression which will return true or false so you can use it this way, too.
  3. // [Int,Int] ==> [Boolean] function is_equal{ Parameter n,m. if mod(n,m) <> 0 return false. else return true. } This will work for any natural number. Have a look at the function; It takes two arguments and is returning a boolean. If you call it in the kOS Window with "Print is_equal(1,2).", the compiler reads it like this : print is_equal(1,2) print is equal(false) print false
  4. { global file is lex( "xcopy",xcopy@, "erase", erase@, "erase_all",erase_all@, "download", download@ ). function xcopy { Parameter file, orig, trgt. switch to trgt. if exists(file) { erase(file,trgt). } switch to orig. copypath(file ,trgt + ":/"). switch to trgt. runpath(file). } function erase { Parameter File, vol. switch to vol. deletepath(File). } function erase_all { parameter vol. switch to vol. list files in file. for x in file { erase(x,vol). } } function download { Parameter file, vol. xcopy(file,vol,1). } } //use it like this : file["xcopy"]("test.ks",0,1). file["xcopy"]("testme.ks",0,1). print "xcopy okay". file["download"]("testme2.ks",0). print "download okay". Handle with care! I just had a glance at it and it works. I really don't want to harm or damage your files! I repeat, be cautious with it.
  5. I don't think it's possible to get the REPL working while the compiler is trying to evaluate your loop. My formulation was hereof missleading as I ment the direct game inputs like the arrowkeys, WASD or +mouse. I might be totally wrong, probably some other user can serve you a solution with more experience in kOS.
  6. That's not correct. If one is treating one file as one script without any declaration of functions, the script will eventually lock one out of the terminal. If one is implementing a userinput, the script can surely check the state each cycle. If one is inputting new commands while a script is running, those inputs are getting queued up and executed after the actual program has ended (like in any other PL where "run mycode.extension" will just do that). Loops are also like in any other PL, one can make them run in the backround or keep the script from executing further until a certain condition is met. One can even run a whole program nested inside an until-loop by the use of delegates. Check out http://ksp-kos.github.io/KOS_DOC/language/flow.html and http://ksp-kos.github.io/KOS_DOC/language/delegates.html for more info.
  7. I can't pull any part of Unity's code either with kOS. kOS is a pseudo-OS which is restricted to the tools the devs are offering. Its not possible to request a resources definition because the OS isn't offering any interface for unity itself. Thanks. I wasn't expecting them in another folder than that of RF itself. edit : Nevermind, I found out that one can pull the density from within kOS. Thanks for your help, keep your great mod running, it'S so much fun playing with it!
  8. kOS can't get the density out of RF directly as the "getDensity"-method is internal; Its not possible to call the method like stage:resources:"Kerosene":getDensity() so I have to either put them in by hand or write my own extension for kOS so I can query the method with the kOS language itself but this is far over my capabilities as I can barely walk straight and chew bubblegum at the same time. The data I can get is mostly from the modules*RF which is visible in the right-click menu. Its even harder to interact with Testflight but thats another story.... Currently I'm using this but the densities are from wiki and somewhat different from those in RF : function deltavstage { local fuelslex is lex( "Lqdoxygen", 1.141e-3, "Kerosene", 8.1715e-4, "solidfuel", 1.78e-3, "Lqdhydrogen", 7.085e-5, "nto", 1.44246e-3, "udmh", 7.93e-4, "aerozine50", 9.03e-4, "mmh", 8.75e-4, "htp",1.484e-3, "Hydrazine", 7.9452e-4 ). local fuelmass is 0. local Lfuels is fuelslex:keys. local m is 0. for x in fuelslex:keys { set fuelmass to fuelmass + fuelslex[x] * stage:resourcesLex[Lfuels[m]]:Amount. set m to m + 1. } [...] As you can see I'm querrying the values from a lexicon called fuelslex and I wasn't able to find the densities somewhere. I know that it isn't good style to put those values in by hand because of the intercompatibility but I have no other choice.
  9. I'm currently investigating how RF is getting the densities for the fuels/oxidizers for a dVscript in kOS. Unfortunately, I wasn't able to find the densities noted somewhere in cleartext so I came to you, my fellow rocket nerds in the hope of getting an answer for my question.
  10. So I dropped the Heatshield and turned a few rounds in orbit : here's the result The tyres kept spinning while in orbit and finally broke to stress / failure time. Putting on the breaks reset the failure time. I didn't think about that in the first place but it fixed the problem :-)
  11. I will test it without the heatshield once i finished downloading a fresh ksp install.
  12. I don't have any problems while launching,the tires are only breaking due to stress when timewarp is active. I have to admit that timewarp is far above KSP stock values in RSS and the wheels start to break at the 10k mark. I checked the tires after they broke and all of them showed a wheelstress of 400 the least, the most was something in the 2k. I might also just add some leeway to the wheelMedium.cfg as RSS is kinda tricky when timewarping to say the least.
  13. I encounter a problem with some of the wheels provided by this mod : This is the craft I'm trying to get to Mars in RSS but as soon as I'm in orbit around earth and the timewarp starts, the wheels brake due to stress. Any idea why this is happening? I tripplechecked all the fairings and it seems as if they're fine.
  14. It is absolutely possible to write a compiler for any IDE that is able to check for syntaxerrors. Semantics are a completely different chapter.
  15. I'm running kOS with RSS and I have some troubles which I don't understand : I'm launching from Brownsville for an orbit that is close to coplanar with the moons orbit. I set the script to start when the relative inclination starts to climb again after it was falling. But when I try to follow the launch azimuth for an orbit with the same inclination as of the moons orbit, I'm always getting into an orbit that is relativly inclined to the moons orbit of about 15° (or rads) but perfectly inclined (up to 3 decimal places). Am I getting there something wrong? Do I have to wait for brownsville to be under the AN/DN of the moonorbit to get into a relative inclination of under 1 ? If I start from brownsville with the above mentioned method straight east, I'm getting into an orbit that is relatively inclined by the difference of moons inclination and Brownsville's latitude. How do I calculate the correct launchazimuth to get into an orbit that is coplanar with the moon? Here is the code I'm currently using for the Launch Azimuth calculation :
  16. I'm currently running my own setup of configs for RF and BDB (here's ( Atlas configs for BDB ) an example on how I managed it). If you want a helping hand, drop me a message.
  17. I'm looking for the atmospheric scale height for a calculation of the pressure at a given height. I had a look at the configs but I couldnt find it. I calculated a height of about 7.05km but my predictions told me a height of around 8.4km with a temp of 288K. Can anyone point me into the right direction?
  18. I will keep that in mind once it is released! Right now I simply put the Volume of those tanks up to about 100m³ and simply delete the B9 entries (-MODULE[ModuleB9*] {}). It's not the cleanest way but it gets the rocket into orbit.
  19. I changed the code but it seems as if MM isn't patching and I still have the same settings ingame as before : two subtypes for the tank and one changed proppreset of the engine (KeroLOx in a 1.1 - 0.9 ratio) which I can't find the MM Patch anywhere. http://pastebin.com/6cykAP1W It looks like BDB is pulling some of the tankdata from B9 mod : edit: I got the engine running now. The Tank is now dry without the B-9 Subtypes UI.
  20. I'm currently running the BDB-Mod and tried to get the missing engines working with RF. I changed the configs for the Atlas style rocket but I can't get it working. Here's the cfg for both the tanks and the main engine : http://pastebin.com/wvBht7xT I put the engine cfg in ...\gameData\RealFuels-Stockalike\Stockalike_Bluedog_Atlas.cfg and the tank cfg in \gameData\RealFuels\Bluedog_Atlas_tanks.cfg. What am I missing?
  21. I have one more question I'm not 100% sure about : @MODULE[ModuleEngine*] { @name = ModuleEnginesRF @maxThrust = 350 @heatProduction = 156 @atmosphereCurve { @key,0 = 0 275 @key,1 = 1 248 taken from ...\Gamedata\RealFuels-Stockalike\Stockalike_Squad.cfg l.166 ff The allocationcurve of the ISP in the Atmosphere is set to only 2 values which should be sufficient for such a small ISP but I would like to know If you or any other forumuser could tell me which function is representing the correlation between density of the atmosphere and the increase in ISP most accurately? Is there a difference in the function between different props? I haven't done alot of programming with Unityscript but might it be that the KSP engine is calculation it on it's own and it just needs the start-ending ISP ?
  22. Pardon my ignorance if I was a bit unprecise in my first post but what I was talking about was the delta-v of both props compared to it's capacity taken in a tank as I just got confused and got misleaded by KERs output while playing around with both props in the VAB. As you can see the stats are more inline with your predictions and the volume of the LO2-LH2mixture basicly got tripled compared to the RP-1 LO2 stored in one tank. I simply saw the impulse, thrust and the d-v and just thought something went fubar. (0.0708kg per 1l Lh2 according to http://www.storhy.net/train-in/PDF-TI/10_e.pdf)
  23. Hey, I've been using RF with RSS and alot of other mods for a while now and always was thinking that a higher ISP is better but I found something annoying ingame that I simply can't understand : All rocketengines that are burning LoxLH have a higher ISP and thrust stated but compared to KeroLox or any other Derivate it's simply an underperforming experience. Is this an intended feature or did I encounter a config's bug? And while I started another reply, is there anyone on the config for BDB still working? I would like to use those nicely textured engines in my RSS campaign but the boiloff is making this incredibly hard. I could also contribute some lines but first of all I have to undertand how to implement it. edit I found a few RF stockalike configs in the bdb-topic (klick me) about a year ago. Can I use them as a reference for RSS and all the other missing engines or did anything change since feb 2016 I should know of? What's this @AthmosphereCurve all about?
×
×
  • Create New...