Kerbal101 Posted February 20, 2018 Share Posted February 20, 2018 @MindChirp Done! Quote Link to comment Share on other sites More sharing options...
MindChirp Posted February 21, 2018 Share Posted February 21, 2018 11 hours ago, Kerbal101 said: @MindChirp Done! Thanks Quote Link to comment Share on other sites More sharing options...
ElWanderer Posted February 21, 2018 Share Posted February 21, 2018 21 hours ago, MindChirp said: wait until alt:radar > 70000. global pitch is 90. lock steering to heading(90,pitch). This will try to steer upwards, rather than towards the horizon. Surely you should be aiming at a pitch of 0 here? Doesn't answer why you don't see RCS firing, of course. That is a bit inexplicable without more information (e.g. what does your rocket look like?) Also, you have that code within the for loop, when it really belongs outside it. Quote Link to comment Share on other sites More sharing options...
RizzoTheRat Posted February 23, 2018 Share Posted February 23, 2018 Hi folks, kOS noob here. So far I've managed to achieve orbit with a simple square root of altitude function, and am working on improving my circularisation burn. Great way to learn the maths behind orbital manoeuvres rather than my usual suck it and see approach in KSP. Simple question though, what do people recommend for editing files? I'm currently using notepad which is hardly ideal. I found a list of editors somewhere, and mention of a kOS plugin for Atom, but any specific recommendations? Quote Link to comment Share on other sites More sharing options...
scimas Posted February 23, 2018 Share Posted February 23, 2018 I haven't used it, but someone has posted a syntax highlighting and such plugin for vim, google it, it's somewhere on github. Somebody has also created a plugin for microsoft's visual studio code, I have used it, but not extensively enough to say what all of its features are. Quote Link to comment Share on other sites More sharing options...
kcs123 Posted February 23, 2018 Share Posted February 23, 2018 8 hours ago, RizzoTheRat said: Hi folks, kOS noob here. So far I've managed to achieve orbit with a simple square root of altitude function, and am working on improving my circularisation burn. Great way to learn the maths behind orbital manoeuvres rather than my usual suck it and see approach in KSP. Simple question though, what do people recommend for editing files? I'm currently using notepad which is hardly ideal. I found a list of editors somewhere, and mention of a kOS plugin for Atom, but any specific recommendations? You can found various additions for various text editors on kOS github page. For windows OS, I recommend notepad++ and language addition for it from linked page. Users with other OS such as linux or MAC might have differente preference what text editor offer better features. Quote Link to comment Share on other sites More sharing options...
meyerweb Posted February 23, 2018 Share Posted February 23, 2018 (edited) 13 minutes ago, kcs123 said: You can found various additions for various text editors on kOS github page. For windows OS, I recommend notepad++ and language addition for it from linked page. Users with other OS such as linux or MAC might have differente preference what text editor offer better features. As a Mac user, I use BBEdit even though it has no KerboScript syntax coloring (I haven’t gotten around to defining it). Atom does have a KerboScript highlighting extension (https://atom.io/packages/language-kerboscript), so if you want those sweet sweet colors, it’s a good choice. Edited February 23, 2018 by meyerweb Fixed the URL to point to an active Atom package Quote Link to comment Share on other sites More sharing options...
dafidge9898 Posted February 25, 2018 Share Posted February 25, 2018 Hello everyone! I have a question regarding my code; I am at a loss as to why one piece of it doesn't work. It's a when statement and its contents from line 39 to 44. It's supposed to start and finish a gravity turn. In the past (maybe one or two years ago) I used this same statement to perform gravity turns, and it worked out fine. I have since started playing again and it doesn't work for some reason. Some background info: I have many mods, including Realism Overhaul and its required mods. Code: https://pastebin.com/uBi6eTyA Thank you in advance! Quote Link to comment Share on other sites More sharing options...
Gargamel Posted February 26, 2018 Share Posted February 26, 2018 I haven't tried KOS yet, as, until now, I haven't had a want to. Now I have some probes with Near Future Electric's capacitors on board. I was wondering if KOS would work for this type of script: Quote While Engine Running { If battery < 10% Discharge Next Full Capacitor } While Engine !Running { Charge Next empty Capacitor Repeat until Charge flow is negative } I figure it will with stock parts, but I'm curious if it can easily pick out mod parts, multiple parts that were added via symmetry and identify them individually, and manipulate them like a user would. I'm not asking for the code, I'd rather figure it out myself, but not having touched KOS before, some hints/pointers would be appreciated if it's possible to do this. I'm digging through the documentation now. Quote Link to comment Share on other sites More sharing options...
OccupyMarsNow Posted February 26, 2018 Share Posted February 26, 2018 2 hours ago, Gargamel said: I haven't tried KOS yet, as, until now, I haven't had a want to. Now I have some probes with Near Future Electric's capacitors on board. I was wondering if KOS would work for this type of script: I figure it will with stock parts, but I'm curious if it can easily pick out mod parts, multiple parts that were added via symmetry and identify them individually, and manipulate them like a user would. I'm not asking for the code, I'd rather figure it out myself, but not having touched KOS before, some hints/pointers would be appreciated if it's possible to do this. I'm digging through the documentation now. You can add a name tag to an individual part, and use ship:partsdubbed() to identify it. Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted February 26, 2018 Share Posted February 26, 2018 4 hours ago, Gargamel said: multiple parts that were added via symmetry everything you want but this. You unfortunately can't set name tags via symmetry in the editor so you are better off using partsdubbed to call the capacitors by their name or title so you can get them all Quote Link to comment Share on other sites More sharing options...
ElWanderer Posted February 26, 2018 Share Posted February 26, 2018 (edited) 12 hours ago, dafidge9898 said: Hello everyone! I have a question regarding my code; I am at a loss as to why one piece of it doesn't work. It's a when statement and its contents from line 39 to 44. It's supposed to start and finish a gravity turn. In the past (maybe one or two years ago) I used this same statement to perform gravity turns, and it worked out fine. I have since started playing again and it doesn't work for some reason. Some background info: I have many mods, including Realism Overhaul and its required mods. Code: https://pastebin.com/uBi6eTyA Thank you in advance! Try commenting out lines 39 and 44. The UNTIL block you have above ensures that the conditions of the WHEN will be met immediately. So you may as well run lines 40-43 right away. To put it another way, it is really confusing to mix imperative UNTIL statements with WHEN interrupts/triggers in this way. Triggers should be used for something that you anticipate happening, but don't know when (in relation to the rest of your code). As to why it doesn't work now: from memory the lock steering command (which itself sets up a trigger) within a trigger is not actually applied until the trigger block exits, at which point it'll immediately be countermanded by the lock steering in the UNTIL block below, so it'll never be used. I think this is a known issue: https://github.com/KSP-KOS/KOS/issues/2191 Edited February 26, 2018 by ElWanderer link to Github Quote Link to comment Share on other sites More sharing options...
Gargamel Posted February 26, 2018 Share Posted February 26, 2018 9 hours ago, Drew Kerman said: everything you want but this. You unfortunately can't set name tags via symmetry in the editor so you are better off using partsdubbed to call the capacitors by their name or title so you can get them all Having not played enough with KOS to translate that into English yet, you're saying while it's not easy, it is doable? Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted February 26, 2018 Share Posted February 26, 2018 1 hour ago, Gargamel said: Having not played enough with KOS to translate that into English yet, you're saying while it's not easy, it is doable? if you place 8 capacitors using radial symmetry you still have to tag all 8 individually, so forget tags and just use their name/title. Relevant docs Quote Link to comment Share on other sites More sharing options...
pellinor Posted February 26, 2018 Share Posted February 26, 2018 21 hours ago, Gargamel said: I figure it will with stock parts, but I'm curious if it can easily pick out mod parts, multiple parts that were added via symmetry and identify them individually, and manipulate them like a user would. The capacitor logic probably has its own part module. You could iterate over all parts of the ship and check which ones have that module. To find the name of the capacitor module, check the config files of those parts. Quote Link to comment Share on other sites More sharing options...
Dunbaratu Posted February 27, 2018 Author Share Posted February 27, 2018 18 hours ago, Drew Kerman said: everything you want but this. You unfortunately can't set name tags via symmetry in the editor so you are better off using partsdubbed to call the capacitors by their name or title so you can get them all This is utterly false. Yes If you attach then assign the tag it doesn't clone the tag because that policy still lets you give unique names to the copies. But you can make clones of the tag by detaching the part after it's been given a tag and then reattaching it symmetrically. The tag is copied to the clones at the moment of attachment. The clones all have whatever the tag was at the moment the part got attached. Quote Link to comment Share on other sites More sharing options...
RyanApache Posted February 28, 2018 Share Posted February 28, 2018 Hello all! Does anyone know a kOS script for kartoffelkuchens Falcon Heavy? I want to create a video but i've not really gotten my head around kOS yet - i only know python well. Thanks! Quote Link to comment Share on other sites More sharing options...
RizzoTheRat Posted February 28, 2018 Share Posted February 28, 2018 On 23/02/2018 at 6:10 PM, kcs123 said: You can found various additions for various text editors on kOS github page. For windows OS, I recommend notepad++ and language addition for it from linked page. Users with other OS such as linux or MAC might have differente preference what text editor offer better features. Cheers, went with Notepad++ and a language addon in the end, works very well. Quote Link to comment Share on other sites More sharing options...
Kerbal101 Posted February 28, 2018 Share Posted February 28, 2018 Hello, @RyanApache ! Welcome to the forums! Since your question is about KOS, it has been moved into corresponding topic. /Kerbal101 Quote Link to comment Share on other sites More sharing options...
Qwarkk Posted March 2, 2018 Share Posted March 2, 2018 FUNCTION D_MT { GLOBAL hpd IS 8. GLOBAL mt IS missiontime. GLOBAL d IS FLOOR(mt/(hpd*3600)). GLOBAL h IS FLOOR((mt-hpd*3600*d)/3600). GLOBAL m IS FLOOR((mt-3600*h-hpd*3600*d)/60). GLOBAL s IS ROUND(mt) - m*60 - h*3600 - hpd*3600*d. PRINT m + ":" + s. } I'm using this script to convert MissionTime into a minutes:seconds format. The script works perfectly and gives me the mission time as i want it, but it also gives me a random 0 on the line below. This happens even when im using the following basic script to test it: RUN YOURLIB. PRINT D_MT(). which returns: 1:54 0 Program ended. I have no idea why its returning that 0. Any help? Quote Link to comment Share on other sites More sharing options...
Madmax Posted March 2, 2018 Share Posted March 2, 2018 Count the number of your PRINT statements... You are printing the mission time within your function, then you call the function in a PRINT statement. This prints 0 because you did not define a RETURN value for your function, so I assume 0 is default. Just call your function without the PRINT in front. Quote Link to comment Share on other sites More sharing options...
RizzoTheRat Posted March 4, 2018 Share Posted March 4, 2018 (edited) I'm starting to get somewhere with kOS, but having a couple of issues with a script I'm using to log various parameters in attempt to understand the drag as my VTOL SSTO returns, and get it to land near the KSC. Firstly, I'm assuming that if I measure the acceleration, and then subtract the acceleration due to gravity, any remaining acceleration is due to drag providing the engines are off Set Acc to ship:sensors:Acc. //measured acceleration Set Grav to ship:sensors:grav. //Acceleration due to gravity Set Drag to Acc - Grav. //Acceleration due to drag However in a stable 86km orbit it's measuring acceleration due to gravity at 7.49, but overall acceleration of 6.83, so where's the other 0.66m/s2 coming from? Secondly, I've calculated air density via 2 different methods, Set Vel to ship:velocity:surface. //Velocity vector Set Q to ship:Q * constant:AtmToKPa *1000. //Dynamic pressure in Pa Set DensQ to (2*Q)/Vel:mag^2. //Air density calculated from dynamic pressure Set Tp to ship:sensors:temp. //Measured temperature Set Press to ship:sensors:pres*1000. //Measured pressure in Pa Set DensIns to Press/(287.053*Tp). //Air density calculated from temperature and pressure However with the ship descending through the atmosphere, the density from the instruments is coming out at about 70% of the density from the Q calculation. I can see that there might be a slight error due to when the individual readings are taken, but it's only doing about 200m/s when I took the data so I can't believe the difference would be that high. Any ideas what I'm doing wrong? Edited March 4, 2018 by RizzoTheRat Quote Link to comment Share on other sites More sharing options...
dafidge9898 Posted March 6, 2018 Share Posted March 6, 2018 On 2/26/2018 at 7:25 AM, ElWanderer said: Try commenting out lines 39 and 44. The UNTIL block you have above ensures that the conditions of the WHEN will be met immediately. So you may as well run lines 40-43 right away. To put it another way, it is really confusing to mix imperative UNTIL statements with WHEN interrupts/triggers in this way. Triggers should be used for something that you anticipate happening, but don't know when (in relation to the rest of your code). As to why it doesn't work now: from memory the lock steering command (which itself sets up a trigger) within a trigger is not actually applied until the trigger block exits, at which point it'll immediately be countermanded by the lock steering in the UNTIL block below, so it'll never be used. I think this is a known issue: https://github.com/KSP-KOS/KOS/issues/2191 Thank you, it works now. I'll keep the bug in mind. Quote Link to comment Share on other sites More sharing options...
CptAWatts Posted March 9, 2018 Share Posted March 9, 2018 (edited) Hello, I just recently got back in KSP and of course there was an update a few days ago and quite a few of the mods I had installed don't work anymore. Can anyone confirm the version for 1.3 doesn't work with 1.4? Edited March 9, 2018 by CptAWatts Quote Link to comment Share on other sites More sharing options...
ElWanderer Posted March 9, 2018 Share Posted March 9, 2018 3 hours ago, CptAWatts said: Hello, I just recently got back in KSP and of course there was an update a few days ago and quite a few of the mods I had installed don't work anymore. Can anyone confirm the version for 1.3 doesn't work with 1.4? It doesn't work with v1.4.0, according to one of the devs: https://github.com/KSP-KOS/KOS/issues/2240 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.