danielboro Posted November 1, 2017 Share Posted November 1, 2017 28 minutes ago, scimas said: Is this a bug or intended behaviour? The resource values for a stage (STAGE:RESOURCES) are all zero unless the next stage has a decoupler. I'm running into a problem because of this. The context is this: I'm placing a satellite in orbit. The stages are as follows (0 - upper engine, 1 - stack decoupler, 2 - fairings, 3 - lower engine). When I perform a 'STAGE' command on launch pad, the resources in the current stage are detected as zero . And yes, I am waiting a full second before I check for the resource values. My script is basically staging once (current stage 3) and then staging again (current stage 2) because of this. Could someone confirm this either as bug or intended (and if its intended, I would appreciate if you tell me the reason too)? Thanks! last time i cheeked stage i got -1 was this bug fixed? i dont know if it got fixed as i dont use it in my scripts Quote Link to comment Share on other sites More sharing options...
ElWanderer Posted November 1, 2017 Share Posted November 1, 2017 58 minutes ago, scimas said: Is this a bug or intended behaviour? The resource values for a stage (STAGE:RESOURCES) are all zero unless the next stage has a decoupler. I'm running into a problem because of this. The context is this: I'm placing a satellite in orbit. The stages are as follows (0 - upper engine, 1 - stack decoupler, 2 - fairings, 3 - lower engine). When I perform a 'STAGE' command on launch pad, the resources in the current stage are detected as zero . And yes, I am waiting a full second before I check for the resource values. My script is basically staging once (current stage 3) and then staging again (current stage 2) because of this. Could someone confirm this either as bug or intended (and if its intended, I would appreciate if you tell me the reason too)? Thanks! KSP itself has a habit of showing 0 stage resources under certain conditions. If kOS agrees with what KSP displays (toggle the "stage view" in the resources tab), then this isn't a bug in kOS. It is frustrating, though. I had to switch from using STAGE:RESOURCES to something more complicated to calculate current stage delta-v. Quote Link to comment Share on other sites More sharing options...
scimas Posted November 1, 2017 Share Posted November 1, 2017 1 hour ago, ElWanderer said: KSP itself has a habit of showing 0 stage resources under certain conditions. If kOS agrees with what KSP displays (toggle the "stage view" in the resources tab), then this isn't a bug in kOS. It is frustrating, though. I had to switch from using STAGE:RESOURCES to something more complicated to calculate current stage delta-v. Yeah, I checked, KSP does shows zero resources in the stage.. that's super weird. Guess I have to figure out other variables to write staging logic. kOS devs, please take 'fixing' this as a feature request if you can! Quote Link to comment Share on other sites More sharing options...
ElWanderer Posted November 1, 2017 Share Posted November 1, 2017 10 minutes ago, scimas said: Yeah, I checked, KSP does shows zero resources in the stage.. that's super weird. Guess I have to figure out other variables to write staging logic. kOS devs, please take 'fixing' this as a feature request if you can! I think it was deliberately changed to be consistent with what KSP displays, in an effort to solve various problems, so it's unlikely to get changed back to be inconsistent again (unless KSP itself changes!) There is at least one issue requesting a change to the current behaviour on the kOS github: https://github.com/KSP-KOS/KOS/issues/1908 Quote Link to comment Share on other sites More sharing options...
Pand5461 Posted November 1, 2017 Share Posted November 1, 2017 @scimas I have zero resources in stage in some of my designs but KSP shows zero in those cases as well (curiously, Alternate Resource Panel sometimes does not). I currently use engine status to check whether I need to stage: function startnextstage { local allengactive to { list engines in el. for e in el if e:flameout return False. return True. }. until ship:availablethrust > 0 and allengactive() { lock steering to srfprograde. wait 1. stage. } } Quote Link to comment Share on other sites More sharing options...
Nightside Posted November 2, 2017 Share Posted November 2, 2017 Can anyone recommend a syntax enhancer for kerboscript compatible with Notepad ++? I tried the two on github but both failed to load into Notepad++. Quote Link to comment Share on other sites More sharing options...
scimas Posted November 3, 2017 Share Posted November 3, 2017 On 02/11/2017 at 2:45 AM, Pand5461 said: @scimas I have zero resources in stage in some of my designs but KSP shows zero in those cases as well (curiously, Alternate Resource Panel sometimes does not). I currently use engine status to check whether I need to stage: function startnextstage { local allengactive to { list engines in el. for e in el if e:flameout return False. return True. }. until ship:availablethrust > 0 and allengactive() { lock steering to srfprograde. wait 1. stage. } } Thanks for the 'flameout' idea, I'm using something very similar to this code now! Though I didn't understand what you meant by Alternate Resource Panel, is that a mod or another structure in kOS? Quote Link to comment Share on other sites More sharing options...
ebigunso Posted November 4, 2017 Share Posted November 4, 2017 I remember hearing somewhere that I can write script in other languages, that I can then use on kOS, but I can't find any website that explains how to do this. Is this actually doable, and if so how? @scimas ARP is a mod. It makes your resource panels look fancy, and organized. Quote Link to comment Share on other sites More sharing options...
ElWanderer Posted November 4, 2017 Share Posted November 4, 2017 1 hour ago, ebigunso said: I remember hearing somewhere that I can write script in other languages, that I can then use on kOS, but I can't find any website that explains how to do this. Is this actually doable, and if so how? @scimas (Unrelated quote. I can't get rid of the reference above though) That sounds more like kRPC than kOS. Quote Link to comment Share on other sites More sharing options...
ebigunso Posted November 4, 2017 Share Posted November 4, 2017 @ElWanderer Thanks! I guess that was what I was looking for. Quote Link to comment Share on other sites More sharing options...
Pand5461 Posted November 5, 2017 Share Posted November 5, 2017 On 03.11.2017 at 9:48 PM, scimas said: Though I didn't understand what you meant by Alternate Resource Panel, is that a mod or another structure in kOS? That's a mod. Quote Link to comment Share on other sites More sharing options...
scimas Posted November 5, 2017 Share Posted November 5, 2017 @ebigunso @Pand5461 got it. On 02/11/2017 at 2:45 AM, Pand5461 said: curiously, Alternate Resource Panel sometimes does not Is it more consistent in showing correct values? And from ARP page "API for information reading and alarm acknowledgement." I think it isn't implemented in kOS though, is it? At least the Addon section of the wiki doesn't list it. Quote Link to comment Share on other sites More sharing options...
Alpha_Mike_741 Posted November 7, 2017 Share Posted November 7, 2017 (edited) Sounds like changing the boot file in terminal (or in a script) doesn't actually do anything. //1:/something.ks print "THIS WON'T RUN". //hello.ks print core:bootfilename. set core:bootfilename to "1:/something.ks". //core:bootfilename changes but it has no effect. reboot. What am I doing wrong? Edited November 7, 2017 by Alpha_Mike_741 Quote Link to comment Share on other sites More sharing options...
danielboro Posted November 7, 2017 Share Posted November 7, 2017 4 hours ago, Alpha_Mike_741 said: Sounds like changing the boot file in terminal (or in a script) doesn't actually do anything. //1:/something.ks print "THIS WON'T RUN". //hello.ks print core:bootfilename. set core:bootfilename to "1:/something.ks". //core:bootfilename changes but it has no effect. reboot. What am I doing wrong? i need to look at my scripts to be sure but AFAIR you cant use 1:/ and the boot script has to be in /boot/ Quote Link to comment Share on other sites More sharing options...
Dunbaratu Posted November 7, 2017 Author Share Posted November 7, 2017 2 hours ago, danielboro said: i need to look at my scripts to be sure but AFAIR you cant use 1:/ and the boot script has to be in /boot/ That's not true. It has to be in /boot/ in order to be seen in the list of choices in the VAB. It doesn't have to be in /boot/ if you manually select the boot file with commands like in the example. I don't know what's wrong here, but I've never seen this problem before. It's hard to tell what's wrong here because I can't diagnose a problem that never happens to anyone else. What's going on, I don't know. 6 hours ago, Alpha_Mike_741 said: Sounds like changing the boot file in terminal (or in a script) doesn't actually do anything. //1:/something.ks print "THIS WON'T RUN". //hello.ks print core:bootfilename. set core:bootfilename to "1:/something.ks". //core:bootfilename changes but it has no effect. reboot. What am I doing wrong? I don't know. This works when I do it. Do you have a log file? Quote Link to comment Share on other sites More sharing options...
windystig Posted November 7, 2017 Share Posted November 7, 2017 Hey. Trying to get something to happen when my apoapsis reaches 300000m. All i want to do is wait for that apoapsis then set throttle to zero but whatever language i use it never shuts the throttle off. For this particular command i am using a WAIT UNTIL command. I have tried all of the below but it never does what i want when the apoapsis reaches the desired altitude. WAIT UNTIL APOAPSIS = 300000. WAIT UNTIL SHIP:APOAPSIS = 300000. WAIT UNTIL ORBIT:APOAPSIS =300000. WAIT UNTIL SHIP:ORBIT:APOAPSIS = 300000. as well as other permeatations. Is the issue the language i am using or the following line, which is LOCK THROTTLE TO 0.? This lines seems painfully straight forward so can't think it is that. Or, as i earlier locked the throttle to 1, do i need to unlock the throttle first? I figured a new lock throttle command would just override the previous one. Quote Link to comment Share on other sites More sharing options...
ElWanderer Posted November 7, 2017 Share Posted November 7, 2017 (edited) Apoapsis is a floating point number. Chances are it will never equal 300000. Also, the games proceeds at a certain number of ticks/updates per second. Your apoapsis could easily be under 300000m one update, then over 300000m a split second later. Better to use a greater than check. WAIT UNTIL APOAPSIS > 300000. Edited November 7, 2017 by ElWanderer Quote Link to comment Share on other sites More sharing options...
Drew Kerman Posted November 7, 2017 Share Posted November 7, 2017 2 hours ago, ElWanderer said: Apoapsis is a floating point number. Chances are it will never equal 300000. Also, the games proceeds at a certain number of ticks/updates per second. Your apoapsis could easily be under 300000m one update, then over 300000m a split second later. Better to use a greater than check. WAIT UNTIL APOAPSIS > 300000. I'd like to further suggest using >= as I personally use it to remind myself later on that I'm actually expecting this statement to evaluate at that specific value, whereas in places I'm just using > I expect the statement to evaluate for a number that can be anything larger. It does actually help when chasing down logic bugs Quote Link to comment Share on other sites More sharing options...
danielboro Posted November 7, 2017 Share Posted November 7, 2017 7 hours ago, Steven Mading said: I don't know. This works when I do it. Do you have a log file? 14 hours ago, Alpha_Mike_741 said: What am I doing wrong? personal expirance set core:bootfilename to "/boot/"+bootf+".ks". works set core:bootfilename to "1:/boot/"+bootf+".ks". dos not work Quote Link to comment Share on other sites More sharing options...
Dunbaratu Posted November 7, 2017 Author Share Posted November 7, 2017 2 hours ago, danielboro said: personal expirance set core:bootfilename to "/boot/"+bootf+".ks". works set core:bootfilename to "1:/boot/"+bootf+".ks". dos not work Ah that's not quite what you said before. Before you said it was being in the boot folder that was the issue, not the explicit mention of the volume number. It could be that it changes depending on your "start on volume" setting. That gives me something else to look for. Quote Link to comment Share on other sites More sharing options...
danielboro Posted November 8, 2017 Share Posted November 8, 2017 13 hours ago, Steven Mading said: Ah that's not quite what you said before. Before you said it was being in the boot folder that was the issue, not the explicit mention of the volume number. It could be that it changes depending on your "start on volume" setting. That gives me something else to look for. my original post was not worded correctly the second sentence was a problem i had (certainty)and i tried to point that you cant use the volume number in the path the therd line was an impression i got from the wiki and my way of doing things Quote Link to comment Share on other sites More sharing options...
Dunbaratu Posted November 9, 2017 Author Share Posted November 9, 2017 @Alpha_Mike_741 and @danielboro : I just made an issue for the problem. You can track the issue here: https://github.com/KSP-KOS/KOS/issues/2165 Quote Link to comment Share on other sites More sharing options...
windystig Posted November 17, 2017 Share Posted November 17, 2017 Hey I am using the example of the executable node script from the kOS guide to run my own nodes but it keeps failing and i can figure out why. The line that causes the failure is: wait until abs(NP:pitch - facing:pitch) < 0.15 and abs(NP:yaw - facing:yaw) < 0.15. The error i get is Get suffix 'PITCH' not found on object V( then gives the vectors). An attempt was made to get a suffix called 'PITCH' from an object of type 'VECTOR' when that object does not have that suffix usable in that way. I copied the script from the guide on the page 'Execute Node Script'. i have not tinkered with it so not sure what i'm doing wrong. Any ideas? Daniel Quote Link to comment Share on other sites More sharing options...
Dunbaratu Posted November 17, 2017 Author Share Posted November 17, 2017 5 hours ago, windystig said: Hey I am using the example of the executable node script from the kOS guide to run my own nodes but it keeps failing and i can figure out why. The line that causes the failure is: wait until abs(NP:pitch - facing:pitch) < 0.15 and abs(NP:yaw - facing:yaw) < 0.15. The error i get is Get suffix 'PITCH' not found on object V( then gives the vectors). An attempt was made to get a suffix called 'PITCH' from an object of type 'VECTOR' when that object does not have that suffix usable in that way. I copied the script from the guide on the page 'Execute Node Script'. i have not tinkered with it so not sure what i'm doing wrong. Any ideas? Daniel After reading your post I just made this issue: https://github.com/KSP-KOS/KOS/issues/2173 Quote Link to comment Share on other sites More sharing options...
ElWanderer Posted November 17, 2017 Share Posted November 17, 2017 3 hours ago, Steven Mading said: After reading your post I just made this issue: https://github.com/KSP-KOS/KOS/issues/2173 I think that's a duplicate of this: https://github.com/KSP-KOS/KOS/issues/1905 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.