Dunbaratu Posted September 7, 2013 Share Posted September 7, 2013 (edited) No, I know what he wants, and it's a crutch for bad programmers.If you need crutches like that and GOTO then you are doing it wrong. This isn't asking for goto. It's asking for exit. Not the same thing. And no, wrapping the code in an if-condition for each possible exception is NOT good style as it leads to excessive nesting. When you chose to troll by pretending this is a crutch for bad programmers, you are claiming no languages should have ever contained exit, return, break, or try/catch.Why wouldn't the engines be started? Why would you want to end the program if they aren't. How about you check to see if they are started and if they aren't, you start them?There is no such API yet in the language for checking what the stages contain to decide if activating a stage is a good idea to get the engines started or not.Furthermore if his main loop had a close condition he could close it, at will, himself. What you are talking about already exist. He just hasn't set it up correctly.This exists outside any loop. It's sanity checking to make sure the program was being run at the time it was meant to be run (after launching, coming down, engines ready to be used) before doing the rest of the work. And despite your claims to the contrary, having sanity checks that cause a routine to return prematurely before it continues blindly ahead, and that give an explanation why this is happening are a good programming practice. And since there are no subroutines in this language, the level at which its appropriate to do a "return" is to exit the program file that might have been called from some other program file. Edited September 7, 2013 by Steven Mading Link to comment Share on other sites More sharing options...
Sma Posted September 7, 2013 Share Posted September 7, 2013 Again, I don't know if I'm doing something wrong (or if I missed someone else posting about this), but as far as I can tell surfacespeed is not the same as surface speed on the navball. As far as I can tell (thanks to Kerbal Engineer) the navball surface speed is verticalspeed + surfacespeed (vertical and horizontal speed). Figured this out while trying to keep navball surface speed around 200m/s. Link to comment Share on other sites More sharing options...
Ralathon Posted September 7, 2013 Share Posted September 7, 2013 Surface speed on the navball is the length of the velocity vector. This means it is sqrt (vertspeed^2 + horizontalspeed^2). Link to comment Share on other sites More sharing options...
T10 Posted September 7, 2013 Share Posted September 7, 2013 Great plugin! I just launched my first orbital probe with it, and so far I'm loving it.Two issues though:-Some commands (e.g. throttle, steering) are case sensitive, and need to be in lower case. The plugin won't report that it doesn't understand the command however.-Using lower case r when telling the computer to set a direction will freeze ksp.exe Link to comment Share on other sites More sharing options...
Dunbaratu Posted September 7, 2013 Share Posted September 7, 2013 (edited) There is a break and no you don't have to wrap anything in anything. His main loop needs a close THIS. IS. NOT. A. LOOP. For the umpteenth time.AND NO, setting up a WHEN check is NOT the same thing because it causes the system to continually check again and again and again every cycle instead of just checking once at a single point in the code.You shouldn't be condescendingly haughty while at the same time not even bothering to pay attention to what was said so you keep getting the details wrong. Your notion that a return or an exit or a try/catch mechanism are only used by incompetent programmers and are akin to using a GOTO is laughable. You're not helping. I can't believe you actually object to having a mechanism used by professional programmers for over 30 years now. Edited September 7, 2013 by Steven Mading Link to comment Share on other sites More sharing options...
Dunbaratu Posted September 7, 2013 Share Posted September 7, 2013 Again, I don't know if I'm doing something wrong (or if I missed someone else posting about this), but as far as I can tell surfacespeed is not the same as surface speed on the navball. As far as I can tell (thanks to Kerbal Engineer) the navball surface speed is verticalspeed + surfacespeed (vertical and horizontal speed). Figured this out while trying to keep navball surface speed around 200m/s. Yeah the relative-to-surface information (like surface-relative prograde and retrograde directions) are still not there in the system, but it looks like they're planned. The thing called 'surfacespeed' is missing the vertical component is is just the x/y part of the speed (not the z part). It was added for rover driving control.Since the language has no trig, and you can't do a square root, there isn't really any way to determine the magnitude of a vector from its three parts yet. (You can't do it by the Pythagorean formula because there's no square root, and you can't do it by trig on the angles because there's no trig). For now you have to accept sort of sloppy calculations until those things exists. Link to comment Share on other sites More sharing options...
drtedastro Posted September 7, 2013 Share Posted September 7, 2013 doesn't it have x^y, where y could be (1/2) for square root, or (1/3) for cube root??thought i saw that it did, but that might have been a different thread.... Link to comment Share on other sites More sharing options...
Gaius Posted September 8, 2013 Share Posted September 8, 2013 No, I know what he wants, and it's a crutch for bad programmers.If you need crutches like that and GOTO then you are doing it wrong.There are two kinds of bad programmers, those who use GOTO (or whatever passes for it in the language in question) when they shouldn't, and those who refuse to use GOTO when they should. The latter tend to be more annoying, because at least the former will admit they're doing it wrong; the latter are more dangerous because they often refuse to admit that they have some very bad coding habits they need to work on. Trying to correct them is like questioning anyone's religious beliefs -- those who truly believe GOTO is the Devil will not listen to any reasoned arguments on the subject, it's heresy. The dogma must be upheld at any cost... in the idealized world they live in, exceptions simply don't exist. Those who admit to exceptions are salvageable -- they're okay with GOTO statements as long as you spell it "THROW"... Link to comment Share on other sites More sharing options...
KevinLaity Posted September 8, 2013 Author Share Posted September 8, 2013 Kevin, I was wondering how you structured the longitude coordinate system.Actually my mod is just grabbing the vessel.longitude value. I assumed it would be fine and hadn't thought to test it thoroughly. I'll take a closer look when I have a chance. Link to comment Share on other sites More sharing options...
KevinLaity Posted September 8, 2013 Author Share Posted September 8, 2013 Great plugin! I just launched my first orbital probe with it, and so far I'm loving it.Two issues though:-Some commands (e.g. throttle, steering) are case sensitive, and need to be in lower case. The plugin won't report that it doesn't understand the command however.-Using lower case r when telling the computer to set a direction will freeze ksp.exeThe first bug you mentioned should now be fixed in 0.5. I'll look into the second. Link to comment Share on other sites More sharing options...
soggymushrooms Posted September 8, 2013 Share Posted September 8, 2013 Are there any target values other than heading and bearing? I was really hoping for a way to point a craft at a target. Link to comment Share on other sites More sharing options...
Payload Posted September 8, 2013 Share Posted September 8, 2013 Persistent displays now working guys. Watch the video if you haven't yet. Awesome. Link to comment Share on other sites More sharing options...
KevinLaity Posted September 8, 2013 Author Share Posted September 8, 2013 (edited) Are there any target values other than heading and bearing? I was really hoping for a way to point a craft at a target.Yes if you're in a space craft you can point at a target usingLOCK STEERING TO TARGET:DIRECTION. Edited September 8, 2013 by KevinLaity Learned to use a code block! Link to comment Share on other sites More sharing options...
Sma Posted September 8, 2013 Share Posted September 8, 2013 Persistent displays now working guys. Watch the video if you haven't yet. Awesome. and I just mentioned this yesterday, wasn't expecting it to be this soon. Though I imagine it was already in the works.One problem I have with this mod though...it's making me want to get a RaspberryPi(or similar) and slap it on the side of a concrete form tube rocket, (my brothers father-in-law has one like that...with out the RaspberryPi though). Link to comment Share on other sites More sharing options...
Kalista Posted September 8, 2013 Share Posted September 8, 2013 For some reason for me now attempting to switch to archive while still on the ground freezes up the terminal requiring me to cut power to it and rebooting to get it to respond. Link to comment Share on other sites More sharing options...
Apollo13 Posted September 8, 2013 Share Posted September 8, 2013 (edited) Would it be possible to package the mod such that we simply copy it to GameData instead of installing the individual pieces in Parts, Plugins, PluginData?EDIT: Answered below. It's in the ToDo list. Edited September 8, 2013 by Apollo13 Link to comment Share on other sites More sharing options...
Payload Posted September 8, 2013 Share Posted September 8, 2013 and I just mentioned this yesterday, wasn't expecting it to be this soon. Though I imagine it was already in the works.One problem I have with this mod though...it's making me want to get a RaspberryPi(or similar) and slap it on the side of a concrete form tube rocket, (my brothers father-in-law has one like that...with out the RaspberryPi though).HAHA I was thinking of taking an Arduino and trying to write a plugin that will send data out over serial so I can have it be the flight computer. It could be a neat KSP JoyStick thing and a flight computer. The RasPi is a great idea though. That you can plug right into a cheap reverse cam monitor or something and be ready to go. Receive info from Telemachus and send commands to an arduino programmed to be a joystick. Total Rocket Station. And your out what? 70-80$ HAHAHA I spent more on dinner last night. Gotta love cheap computers. Link to comment Share on other sites More sharing options...
Sma Posted September 8, 2013 Share Posted September 8, 2013 HAHA I was thinking of taking an Arduino and trying to write a plugin that will send data out over serial so I can have it be the flight computer. It could be a neat KSP JoyStick thing and a flight computer. The RasPi is a great idea though. That you can plug right into a cheap reverse cam monitor or something and be ready to go. Receive info from Telemachus and send commands to an arduino programmed to be a joystick. Total Rocket Station. And your out what? 70-80$ HAHAHA I spent more on dinner last night. Gotta love cheap computers.Someone I think is working on a physical control panel for KSP with LED readout displays and such. Forget who or which forum/thread I saw it in though. Link to comment Share on other sites More sharing options...
CaptainKipard Posted September 8, 2013 Share Posted September 8, 2013 (edited) Would it be possible to package the mod such that we simply copy it to GameData instead of installing the individual pieces in Parts, Plugins, PluginData?Kevin already said he'll get around it.I love the new update Kevin. Thankyou for trigonometry. Edited September 8, 2013 by Cpt. Kipard Link to comment Share on other sites More sharing options...
TMS Posted September 8, 2013 Share Posted September 8, 2013 Yeah, some very neat additions in there, Kevin. Math and warp control are especially welcome. Would physical warp need a separate command? Link to comment Share on other sites More sharing options...
Sma Posted September 8, 2013 Share Posted September 8, 2013 (edited) Is it just me, or can you only use only 11 lines when using "position"?print "hello" at (0,10)When I tried displaying something on line 10 it put it up on line 0. It's also pretty slow to update when you have 4 or 5 lines updating lol, but I guess that can't be helped at the moment. It's still pretty fun. At the moment my "orbit" program is getting better. At least not it stops when PE gets to 100,000. AP still goes out much further than I'd like though but I think that's just a combination of controlling the throttle and pitch properly Edited September 8, 2013 by Sma Link to comment Share on other sites More sharing options...
Secret Squirrel Posted September 8, 2013 Share Posted September 8, 2013 (edited) I am about 5K from my target, trying to drive my rover to target but it's just bugging out. I tried just print target distance and locks up kOS and I have to toggle power off and on to get my prompt back and be able to type in the terminal again. Is there a max target:distance it can calculate to or should I be able to target anything and that value work?ok never mind it's not the target distance I just realized I didn't have the target set lol. But its still bugging out simple setup just like in the video but on duna. I wanted to see if my rover will drive well or if I needed to tweak speed and stuff. Edited September 8, 2013 by Secret Squirrel Link to comment Share on other sites More sharing options...
theSpeare Posted September 8, 2013 Share Posted September 8, 2013 Warp control's perfect. Physical is the only thing left in that area.While you're at functions we could sure use a "round" function. Link to comment Share on other sites More sharing options...
TMS Posted September 8, 2013 Share Posted September 8, 2013 Having some trouble here. Trying to get to grips with some basic directions and use of variables while in orbit.Here's my script:clearscreen.set yaw to 0.set pitch to 90.set roll to 0.lock VarDirection to up + R(yaw,pitch,roll).lock steering to VarDirection.print "Heading is Y:"+yaw+" P:"+pitch+" R:"+roll.wait 5.set pitch to -90.print "Heading is Y:"+yaw+" P:"+pitch+" R:"+roll.wait 5.I lock VarDirection to the directional variables of yaw pitch and roll. I then lock steering to VarDirection and that command is honoured.When I change the pitch variable, the steering doesn't alter, yet the printouts acknowledge that the pitch variable has changed.What am I doing wrong? Link to comment Share on other sites More sharing options...
KevinLaity Posted September 8, 2013 Author Share Posted September 8, 2013 Is it just me, or can you only use only 11 lines when using "position"?print "hello" at (0,10)A fix for this bug will be in the next update Link to comment Share on other sites More sharing options...
Recommended Posts