erendrake Posted April 20, 2015 Author Share Posted April 20, 2015 (edited) On Github[h=3]"New" features[/h]Due to erendrake's inability to correctly use git. The new list constructor was omitted from the 0.17.0 release binaries.The very important fact that calling user functions from the interpreter prompt can cause all sorts of problems was not properly documented. It is now, at: https://ksp-kos.github.io/KOS_DOC/language/user_functions.html#interpreter-functions[h=3]Bug Fixes:[/h]Many Doc fixesFixed bug with setting KAC Alarm action to correct valueFixed some unneeded log spamming Edited April 20, 2015 by erendrake Link to comment Share on other sites More sharing options...
silentdeth Posted April 21, 2015 Share Posted April 21, 2015 This i my code:// known statesas on.wait 1.sas off.rcs off.set tval to 0.set G to 3531600000000/BODY:MASS.set a to (BODY:RADIUS + (APOAPSIS + PERIAPSIS)/2).print a.set da to max(0.001,maxthrust/mass).set runmode to 31.until runmode = 0{ if runmode = 31// get manuver node {// set v1 to sqrt(G * (BODY:MASS + SHIP:MASS) * ((2/(APOAPSIS + BODY:RADIUS)) - (1/a))). set v1 to velocityat(ship, time:seconds+eta:apoapsis):orbit:mag. set v2 to sqrt(G * (BODY:MASS + SHIP:MASS)/(BODY:RADIUS + APOAPSIS)). print v1. print v2. set deltav to v2 - v1. set node1 to NODE(TIME:SECONDS + ETA:APOAPSIS, 0, 0, deltav). add node1. set burntime to node1:deltav:mag/da. print burntime. if nextnode = node1 { set runmode to 32. } } else if runmode = 32 { set warp to 3. if node1:eta < burntime + 60 { set warp to 0. set runmode to 33. } } else if runmode = 33 { lock steering to node1:deltav. if node1:eta < burntime + 1 { if node1:deltav:mag > 2*da { set tval to 1. } set runmode to 34. } } else if runmode = 34 { if (node1:deltav:mag < 2*da) { set tval to min(1, node1:deltav:mag / da). } if (node1:deltav:mag / da) < 0.1 { wait 0.1. set tval to 0. remove node1. set runmode to 0. } } if (STAGE:SOLIDFUEL < 1) and (SHIP:SOLIDFUEL > 0) { wait 1. } if (STAGE:LIQUIDFUEL < 1) and (SHIP:LIQUIDFUEL > 0) { wait 1. } lock throttle to tval.}Manuver Node is generated in runmode 31.The script should be capable of circularizing any orbit around kerbin.Thanks for looking over it.Your equation for a, the semi-major axis, is incorrect for the circular orbit you wish to achieve. You need to calculate the semi-major axis for the desired orbit, not use the semi-major axis of the current orbit if you wish to use that form of the equation. Also there is no need to include the mass of the ship in your calculation of orbital speed, it is negligible relative to the mass of the body you are orbiting. For a circular orbit the equation for orbital velocity simplifies to:set v1 to sqrt(BODY:MU/(APOAPSIS + BODY:RADIUS)). Link to comment Share on other sites More sharing options...
Pro7ech Posted April 21, 2015 Share Posted April 21, 2015 (edited) Hello, I am new to Kerbal OS. I am having troubles with steering commands. I have tried all steering commands, with the most basic rockets. But none of them work. The gimbal starts to wobble very fast as soon as the steering command triggers, but won't change the rocket direction. I have made sure that SAS is turned off, and it still won't control the rocket, but just start too freak out the gimbal while maintaining the rocket strait. All other commands, logic and loops work perfectly.Does anyone has an idea of what I am doing wrong? Anyone has had the same problem before? For example, this won't work :LOCK STEERING TO R(90,80,0). Edited April 21, 2015 by Pro7ech Link to comment Share on other sites More sharing options...
Drew Kerman Posted April 21, 2015 Share Posted April 21, 2015 It could also have to do with the fact that KSP's logic for measuring the fuel in a stage is currently sketchy at best.Just want to remind everyone that detecting when your engine has run out of fuel by polling the amount of fuel left is so kOS 0.15, dude. Ever since we got access to right-click menus this has gotten very simple: there's a Status field for the engine. Just wait until it says "flame-out!" Link to comment Share on other sites More sharing options...
erendrake Posted April 21, 2015 Author Share Posted April 21, 2015 Hello, I am new to Kerbal OS. I am having troubles with steering commands. I have tried all steering commands, with the most basic rockets. But none of them work. The gimbal starts to wobble very fast as soon as the steering command triggers, but won't change the rocket direction. I have made sure that SAS is turned off, and it still won't control the rocket, but just start too freak out the gimbal while maintaining the rocket strait. All other commands, logic and loops work perfectly.Does anyone has an idea of what I am doing wrong? Anyone has had the same problem before? For example, this won't work :LOCK STEERING TO R(90,80,0).It is usually helpful for us to know what other mods you are running. In this case I assume you are running one of the realism overhaul packs? We have a known issue that craft with little to no reaction wheels don't use enough steering deflection to be useful. If you look around there are some fairly good workarounds Link to comment Share on other sites More sharing options...
leviathan01 Posted April 21, 2015 Share Posted April 21, 2015 does VELOCITYAT account for atmospheric drag. Link to comment Share on other sites More sharing options...
Dunbaratu Posted April 21, 2015 Share Posted April 21, 2015 does VELOCITYAT account for atmospheric drag.No. That's a massively complex calculation. It's just telling you what KSP's orbit prediction line shows on-screen. Link to comment Share on other sites More sharing options...
Pro7ech Posted April 22, 2015 Share Posted April 22, 2015 (edited) It is usually helpful for us to know what other mods you are running. In this case I assume you are running one of the realism overhaul packs? We have a known issue that craft with little to no reaction wheels don't use enough steering deflection to be useful. If you look around there are some fairly good workaroundsYes, my mistake. I am running the realism overhaul pack. I am aware that reaction wheels are not as powerfull than in normal mode. But shouldn't the autopilot also use the gimbal (vectored thrust) of the rocket to steer the rocket? Is there a command for it to only steer rocket with using gimbal?I have read some stuff about it. It seems to be a common problem about vectoring range, with no solution atm but using powerfull sas or rcs. I have also read something about using "Raw control scheme", what is it? Surface control? Edited April 22, 2015 by Pro7ech Link to comment Share on other sites More sharing options...
Ralathon Posted April 22, 2015 Share Posted April 22, 2015 Yes, my mistake. I am running the realism overhaul pack. I am aware that reaction wheels are not as powerfull than in normal mode. But shouldn't the autopilot also use the gimbal (vectored thrust) of the rocket to steer the rocket? Is there a command for it to only steer rocket with using gimbal?I have read some stuff about it. It seems to be a common problem about vectoring range, with no solution atm but using powerfull sas or rcs. I have also read something about using "Raw control scheme", what is it? Surface control?Raw control means directly controlling the various steering apparatus.Normally when you set kOS to point towards a direction the program controls all your RCS and gimbal to make sure you point your nose in that direction. But using raw commands you can tell your spacecraft to rotate in a certain direction with a certain strength. If you write your own PID controller this means you can build your own steering system that bypasses the kOS system. Link to comment Share on other sites More sharing options...
Pro7ech Posted April 22, 2015 Share Posted April 22, 2015 Raw control means directly controlling the various steering apparatus.Normally when you set kOS to point towards a direction the program controls all your RCS and gimbal to make sure you point your nose in that direction. But using raw commands you can tell your spacecraft to rotate in a certain direction with a certain strength. If you write your own PID controller this means you can build your own steering system that bypasses the kOS system.I see, thank you very much. Will need quite some work to make it reliable and safe for my kerbals haha Link to comment Share on other sites More sharing options...
leviathan01 Posted April 23, 2015 Share Posted April 23, 2015 Does RemoteTech v1.6.3 work well with KOS 17? Link to comment Share on other sites More sharing options...
Ziw Posted April 23, 2015 Share Posted April 23, 2015 Does RemoteTech v1.6.3 work well with KOS 17?Yes. Dont forget to check that RT light is green in kOS panel. Link to comment Share on other sites More sharing options...
leviathan01 Posted April 23, 2015 Share Posted April 23, 2015 Yes. Dont forget to check that RT light is green in kOS panel.OK thank you. Link to comment Share on other sites More sharing options...
Astral_Nomad Posted April 23, 2015 Share Posted April 23, 2015 I dont see in the docs anywhere about how to init arrays? or do we? and can we access the subscripts with a variable intead of a real number? Link to comment Share on other sites More sharing options...
Dunbaratu Posted April 24, 2015 Share Posted April 24, 2015 I dont see in the docs anywhere about how to init arrays? or do we? and can we access the subscripts with a variable intead of a real number?// initialize a list:set foo to list(10,15,20,"hello",BODY:kerbin). // just to prove the lists can be heterogeneous.// access with subscripts:set idx to 2.print foo[idx].The markup syntax looks like it got a bit borked, but the examples showing it are here:http://ksp-kos.github.io/KOS_DOC/structures/misc/list.html#constructing-a-list Link to comment Share on other sites More sharing options...
SGCam Posted April 24, 2015 Share Posted April 24, 2015 (edited) Is there a "prompt" or "input" like command in KOS yet? The most recent time I can find this question in the thread is July 2014. Edited April 24, 2015 by SGCam Link to comment Share on other sites More sharing options...
trnt Posted April 26, 2015 Share Posted April 26, 2015 How can I use the suffix "ControlFrom"? none of these work for me: //The root part of my ship was Mk2 Landercan.print ship:rootpart:controlfrom. // It show me error : "Operation is not valid due to the current state of the object." set ship:rootpart:controlfrom to true. //Error : "Set suffix 'controlfrom' not found on Object Part(Mk2LanderCabin ~~~~~~~~~~~print partslist[14]:controlfrom. // partslist[14] was a docking port and it prints same error as above.set partslist[14]:controlfrom to true. // same error as above.Obviously all other suffixes of "part" works fine. I found no changelog about it and I think the code I wrote is not that different from the example on this page... Link to comment Share on other sites More sharing options...
akrasuski1 Posted April 26, 2015 Share Posted April 26, 2015 Is there a "prompt" or "input" like command in KOS yet? The most recent time I can find this question in the thread is July 2014.There isn't any, though I heard it is on the to-be-done list. For now, you can use some libraries from KSLib: https://github.com/KSP-KOS/KSLib If what you really need, is a simple menu, there is a code for that there. Link to comment Share on other sites More sharing options...
SGCam Posted April 27, 2015 Share Posted April 27, 2015 There isn't any, though I heard it is on the to-be-done list. For now, you can use some libraries from KSLib: https://github.com/KSP-KOS/KSLib If what you really need, is a simple menu, there is a code for that there.Thanks, I ended up just writing a simple action group based menu. Link to comment Share on other sites More sharing options...
leviathan01 Posted April 28, 2015 Share Posted April 28, 2015 Does kos work with ksp 1.0 Link to comment Share on other sites More sharing options...
whaaw Posted April 28, 2015 Share Posted April 28, 2015 can you report to me when you tested it?^^ Link to comment Share on other sites More sharing options...
TDW Posted April 28, 2015 Share Posted April 28, 2015 Does kos work with ksp 1.0There is a 1.0 compatibility release on the githubhttps://github.com/KSP-KOS/KOS/releases/tag/v0.17.2There may be some bugs so test you're scripts before relying on them but it is up an working in 1.0. Link to comment Share on other sites More sharing options...
LN400 Posted April 28, 2015 Share Posted April 28, 2015 There is a 1.0 compatibility release on the githubhttps://github.com/KSP-KOS/KOS/releases/tag/v0.17.2There may be some bugs so test you're scripts before relying on them but it is up an working in 1.0.This is awesome. Just a couple more essentials and I'm set. Thanks tons to all the modders who create all these gems. Link to comment Share on other sites More sharing options...
DaniDE Posted April 29, 2015 Share Posted April 29, 2015 (edited) I am so completely new and lost at this Add-On. Browsing through the kOS wiki and tutorials was just overwhelming. But maybe I don´t have to try reinventing the wheel. Does anyone have an existing script that detects fuel at 0% and stages? (assuming I can tag the tanks in question). Also looking for a solution to automatically fire an action group at a certain altitude (maybe even ascent/descent ?). If I see how its done, I could adapt it for my own crafts.Many thanks if anyone could help me with that. Edited April 29, 2015 by DaniDE Link to comment Share on other sites More sharing options...
migol Posted April 29, 2015 Share Posted April 29, 2015 I am so completely new and lost at this Add-On. Browsing through the kOS wiki and tutorials was just overwhelming. But maybe I don´t have to try reinventing the wheel. Does anyone have an existing script that detects fuel at 0% and stages? (assuming I can tag the tanks in question). Also looking for a solution to automatically fire an action group at a certain altitude (maybe even ascent/descent ?). If I see how its done, I could adapt it for my own crafts.Many thanks if anyone could help me with that. http://ksp-kos.github.io/KOS_DOC/tutorials/quickstart.html#step-5-add-staging-logic Link to comment Share on other sites More sharing options...
Recommended Posts