Bizz Keryear Posted October 19, 2013 Share Posted October 19, 2013 I think kOS should start as soon as there are drone cores.In my opinion that is also what drone cores should be, programmable computers. Link to comment Share on other sites More sharing options...
Nostromo Posted October 19, 2013 Share Posted October 19, 2013 Does kOS use power when executing scripts, etc? Link to comment Share on other sites More sharing options...
Bizz Keryear Posted October 19, 2013 Share Posted October 19, 2013 Does kOS use power when executing scripts, etc?It uses power when turned on. Link to comment Share on other sites More sharing options...
Bizz Keryear Posted October 20, 2013 Share Posted October 20, 2013 Something new for kOS:[...]The source code is linked in the OP. Please feel free to make it your own or use bits of it [...]So how to use pieces of that for producing sounds with kOS? Link to comment Share on other sites More sharing options...
Payload Posted October 20, 2013 Share Posted October 20, 2013 (edited) Something new for kOS:So how to use pieces of that for producing sounds with kOS?Bizz I think you might be able to just mod a part to play a sound when it is activated by action group.The sound playing function of KSP is a little weird right now requiring a very strange and specific directory structure to get it to work properly.Check this out.http://forum.kerbalspaceprogram.com/threads/53982-0-22-New-SRB-soundsThere is a full explanation of how to add custom sounds to KSP in the first post.I tried to do this about a month ago but I didn't have that information available at the time.I haven't tried this method but it is reported to work by lots of people for KSP .22.Note: You may or may not have to configure the part as an engine with no thrust. Edited October 20, 2013 by Payload Link to comment Share on other sites More sharing options...
Bizz Keryear Posted October 21, 2013 Share Posted October 21, 2013 Bizz I think you might be able to just mod a part to play a sound when it is activated by action group.The sound playing function of KSP is a little weird right now requiring a very strange and specific directory structure to get it to work properly.Check this out.http://forum.kerbalspaceprogram.com/threads/53982-0-22-New-SRB-soundsThere is a full explanation of how to add custom sounds to KSP in the first post.I tried to do this about a month ago but I didn't have that information available at the time.I haven't tried this method but it is reported to work by lots of people for KSP .22.Note: You may or may not have to configure the part as an engine with no thrust.Not true! Simply not true.This code is from chatterer and those sounds are in <KSP Folder>\GameData\RBR\SoundsWell actually he sorted it up in the last version to chatterer, probe and sstv, but never the less its just for sorting them. It may be different if you use the KSP internal function that might be useful if you create a part and don't want to use a dll, hey wait don't we use already one? Link to comment Share on other sites More sharing options...
Lyinginbedmon Posted October 21, 2013 Share Posted October 21, 2013 I've perused the wiki but I'm having trouble finding an answer.When a craft unloads, the code its running ceases to function and does not restart with the computer when it is reloaded later on. Is there any way to modify or replace that startup functionality to have codes run when the craft loads? Such as to ensure a space station remains properly oriented to its parent planet or to keep a long-range missile on target. Link to comment Share on other sites More sharing options...
Payload Posted October 21, 2013 Share Posted October 21, 2013 Not true! Simply not true.This code is from chatterer and those sounds are in <KSP Folder>\GameData\RBR\SoundsWell actually he sorted it up in the last version to chatterer, probe and sstv, but never the less its just for sorting them. It may be different if you use the KSP internal function that might be useful if you create a part and don't want to use a dll, hey wait don't we use already one?What is not true? That you don't need a plugin to play custom sounds? Because you don't. I'm sorry I fail to see what is not true about what I posted. Who cares what chatterer does? It isn't required so why use it? You can create a part that plays custom sounds. You don't need a plugin to do it. Link to comment Share on other sites More sharing options...
Nostromo Posted October 21, 2013 Share Posted October 21, 2013 It would be interesting if it consumed more power as the script/program becomes more intricate and complex or as many lines get added. Link to comment Share on other sites More sharing options...
Dunbaratu Posted October 21, 2013 Share Posted October 21, 2013 It would be interesting if it consumed more power as the script/program becomes more intricate and complex or as many lines get added.Having peeked at the github code it looks like there is a calculation that makes electrical drain depend on clock speed. The faster the clock rate the faster the electrical drain. But you don't notice that this calculation is taking place because currently there's only one kind of CPU with one hardcoded clock speed. It seems as if the groundwork is there to be able to support multiple different speeds of CPU in the future. Link to comment Share on other sites More sharing options...
Dunbaratu Posted October 21, 2013 Share Posted October 21, 2013 I've perused the wiki but I'm having trouble finding an answer.When a craft unloads, the code its running ceases to function and does not restart with the computer when it is reloaded later on. Is there any way to modify or replace that startup functionality to have codes run when the craft loads? Such as to ensure a space station remains properly oriented to its parent planet or to keep a long-range missile on target.There appears to be code in the github source that deals with saving and restoring the program state when the craft goes on/off of rails. But I've had a lot of trouble getting it to behave right so I'm not sure that part works right yet. For example, I have one program that runs just fine as long as it stays within 2.2 km, but the moment I send a craft away form it and leave the 2.2 km distance and then turn around and come back to it, the entire KSP game bogs down as soon as it re-loads, dropping to a frame rate of less than 1/sec. I'm not sure what's happening but I assume something about the re-loading code isn't working right. Link to comment Share on other sites More sharing options...
erbmur Posted October 22, 2013 Share Posted October 22, 2013 I have a coding question.I have the following:SET tVal TO 1.LOCK THROTTLE TO tVal.LOCK tVal TO (MASS * 13)/MAXTHRUST.STAGE.When staged, both the launch clamp and engine are ignited, however the engine appears to lock into full throttle and doesn't alter based on the equation tVal is locked to.Can anybody give me any insight as to why? Link to comment Share on other sites More sharing options...
AbeS Posted October 22, 2013 Share Posted October 22, 2013 Are you using KOS 0.84? it has problems with locking variables to variables, at least for me.Instead of:lock vel to velocity:orbit.It does this:set vel to velocity:orbit.So it isn't adapting as it should, it just stays with the initial value.Try using your code in a loop, and maybe it will work? Link to comment Share on other sites More sharing options...
erbmur Posted October 22, 2013 Share Posted October 22, 2013 Yup 0.84.Took your advice.Did this instead and it works a treat.SET tVal TO 1.LOCK THROTTLE TO tVal.STAGE.UNTIL ALTITUDE > 10000 {SET tVal TO (MASS * 13)/MAXTHRUST.}.Thanks for the help. Link to comment Share on other sites More sharing options...
KvickFlygarn87 Posted October 23, 2013 Share Posted October 23, 2013 Kevin, how's updating to .22 going? Link to comment Share on other sites More sharing options...
AbeS Posted October 23, 2013 Share Posted October 23, 2013 Kevin, how's updating to .22 going?And fixing all the bugs Link to comment Share on other sites More sharing options...
BahamutoD Posted October 23, 2013 Share Posted October 23, 2013 (edited) I just installed the latest version and lock throttle to 1. isn't working for me... Anyone know what might be wrong?Edit: I read some more and it looks like this is happening in .84. I'll try .7. Edited October 23, 2013 by BahamutoD Link to comment Share on other sites More sharing options...
erbmur Posted October 23, 2013 Share Posted October 23, 2013 I just installed the latest version and isn't working for me... Anyone know what might be wrong?Edit: I read some more and it looks like this is happening in .84. I'll try .7.Is that the only line of code you have? Maybe there is an issue happening elsewhere in the program? Because that line by itself should work fine. Link to comment Share on other sites More sharing options...
BahamutoD Posted October 23, 2013 Share Posted October 23, 2013 Is that the only line of code you have? Maybe there is an issue happening elsewhere in the program? Because that line by itself should work fine.Yeah, just with that line, nothing happens. And a print of the throttle value returns 0.Everything I've tried so far seems to work in 0.7 though, and this thing is sweet! I can't wait to show off what I'm making when its done haha. Link to comment Share on other sites More sharing options...
check Posted October 24, 2013 Share Posted October 24, 2013 In case anyone's missed it, 0.85 is out now: http://kerbalspaceprogram.com/kos/http://kosdev.blogspot.ca/ Link to comment Share on other sites More sharing options...
Space_Nomad Posted October 24, 2013 Share Posted October 24, 2013 This mod could save me so much stupdity with just one line of code.Program name: UponVacWHEN ALTITUDE > 69999 THEN TOGGLE AG10. // Open solar panels, because I forgot. Again.or evenWHEN STATUS = "ORBITING" THEN TOGGLE AG10.I run either of these and it just says program ended. I bet I am missing a parentheses somewhere. Altitude is ~68, status is prelaunch. What am I missing?I would like to request two more parts, a TRS-80 Model 100 (my first laptop) [3.2k of storage and slower cpu] and a TRS-80 Pocket Computer (my first palmtop) [<1k of storage and snail-crawling cpu]. Because hauling the original to run one line of code sucks. You could have upgrades in the tech tree, for a decent laptop and a HP200 palmtop (man, I had so much fun with that thing). I would send you a TRS-80 Model 100 if you did this (yep, still have it and it still works.)If each computer has to have 10k of room fill up the extra with a read-only file, maybe same interesting reading? Link to comment Share on other sites More sharing options...
razark Posted October 24, 2013 Share Posted October 24, 2013 Program name: UponVacWHEN ALTITUDE > 69999 THEN TOGGLE AG10. // Open solar panels, because I forgot. Again.or evenWHEN STATUS = "ORBITING" THEN TOGGLE AG10.I run either of these and it just says program ended. I bet I am missing a parentheses somewhere. Altitude is ~68, status is prelaunch. What am I missing?Both of these set up a trigger that will be executed when the condition is met.Then the program ends, and the triggers it set up are wiped out.You can run either of these lines outside of a program, and they should work. Or, you can set up a program such as:WAIT UNTIL ALTITUDE > 69999.TOGGLE AG10.This sets up a waiting condition, and execution of the program will wait until that condition is true before stepping to the next line. (Of course, this means that your program will not do anything else until then. There are other ways to set it up, too.) Link to comment Share on other sites More sharing options...
Rokker Posted October 24, 2013 Share Posted October 24, 2013 It would be interesting if it consumed more power as the script/program becomes more intricate and complex or as many lines get added.I feel like the change in power usage would be so minimal it wouldn't make much of a difference. Link to comment Share on other sites More sharing options...
Payload Posted October 24, 2013 Share Posted October 24, 2013 (edited) No go on v0.85. Syntax Error on line 2.Line 2 is a blank line.Program runs fine in 0.71.Also programs that would run just fine on 0.84 now exhibit the same behavior.syntax error on random line number.Shy of inserting a print statement after every line, there is no way to debug this.EDIT: That wont work either. I set line 0 to...print "passed".I still get the same error and it never prints passed. Edited October 24, 2013 by Payload Link to comment Share on other sites More sharing options...
theSpeare Posted October 24, 2013 Share Posted October 24, 2013 Some questions please:1. How do I target bodies?2. How do I lock my steering to node? "lock steering to node" doesn't work, as it doesn't seem to recognize "node". Link to comment Share on other sites More sharing options...
Recommended Posts