Jump to content

Meltdown

Members
  • Posts

    27
  • Joined

  • Last visited

Reputation

7 Neutral

Recent Profile Visitors

995 profile views
  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 :
×
×
  • Create New...