Jump to content

[KSP 1.12.x] kOS v1.4.0.0: kOS Scriptable Autopilot System


Dunbaratu

Recommended Posts

9 hours ago, infinite_monkey said:

I have a problem with multimode engines. It seems to think that the Kingfisher engine cluster from Tundra Exploration has only a single engine mode, while the GUI correctly allows me to switch mode.

Let me see... Nothing too special about  the part config in question... what about RAPIER? Yup, broken, too.

Let's see the source... great, it has been refactored several times over. Oh wait, where did that come from?

https://github.com/KSP-KOS/KOS/commit/567820cbbaebb71092bcd4eb4c0ba6a34f176776#diff-8f94cb2f0d2ce25080591180a75f3360R38

Yes, somebody replaced == with !=. Of course it misfires :huh:

Edited by Alchemist
Link to comment
Share on other sites

On 1/19/2019 at 8:01 PM, Kartoffelkuchen said:

 

Two airplanes simultaneously doing a fully autonomous landing at Cape Hook Global Airport, using my self-written airplane autopilot.

Just thought it was  a badass moment, so thought I'd share :)

 

Hi. Do You think I could get a copy of the script please?

Link to comment
Share on other sites

On 2/25/2019 at 9:29 AM, Alchemist said:

Let me see... Nothing too special about  the part config in question... what about RAPIER? Yup, broken, too.

Let's see the source... great, it has been refactored several times over. Oh wait, where did that come from?

https://github.com/KSP-KOS/KOS/commit/567820cbbaebb71092bcd4eb4c0ba6a34f176776#diff-8f94cb2f0d2ce25080591180a75f3360R38

Yes, somebody replaced == with !=. Of course it misfires :huh:

Should I file a bug report on GitHub?

Link to comment
Share on other sites

32 minutes ago, infinite_monkey said:

Should I file a bug report on GitHub?

I passed on a notice about it to the other dev who works in that area of the code, however he has very little free time these days so I might end up having to dig through that code and understand it.

Link to comment
Share on other sites

That line is a rather obvious error, however the file might need a bit more investigation. For example, I have some suspicions about what happens if the engine modules are declared in opposite order than they are listed in multimode engine module (namely, secondary engine declared in the part file before primary) - kOS interpretation may give opposite results than actual stock behavior resulting in quite a mess.

Link to comment
Share on other sites

4 hours ago, infinite_monkey said:

From the documentation I was thinking that LOCK is basically the same as a function. But it doesn't seem to be. When calling an external script via run once, all the functions are available to the calling program, but the locked variables are not. Is that intentional?

try using parethesis () to hint the compiler that that its a function.

Link to comment
Share on other sites

A follow-up to the purple icon problem: yesterday i had some problems with an update of Blizzy's toolbar, so the toolbar wasn't shown, and the kOS icon appeared on the stock toolbar. It looked like it had the wrong resolution or something, but at least it was there... Now Blizzy's toolbar is working again, and I have the purple icon back. Is there a way to show the kOS icon on both toolbars to see if they render it differently at the same time?

 

Link to comment
Share on other sites

Can anyone explain what's going wrong here?  I'm trying to warp on Rails until a point relatively close to my manoeuvre, and then Physics warp the rest of the way so I can manoeuvre and hit the burn node facing the right way.

	warpto (warptime).
	wait 1.
	wait until Warp = 0 and kuniverse:timewarp:issettled.
	print "waiting".
	wait 3.
	SET kuniverse:timewarp:mode TO "PHYSICS".
	wait 0.1.
	print kuniverse:timewarp:mode.	

I'm in Rails mode to start with, drops out of warp and prints "Waiting" when I'd expect, but prints out that it's in Rails mode still.

 

On 3/2/2019 at 5:48 AM, chapstickelk said:

I'm just going to drop a thank you to the devs for keeping this mod going.  I love love love KoS.

I'll second that, great mod!

Link to comment
Share on other sites

3 hours ago, RizzoTheRat said:

I'm in Rails mode to start with, drops out of warp and prints "Waiting" when I'd expect, but prints out that it's in Rails mode still

try to set warp to 2 and if its phis or rail

maybe the kuniverse:timewarp:mode only gets updated after using set

Link to comment
Share on other sites

4 hours ago, danielboro said:

@Steven Mading i fixed the purple button by copying launcher-button.png from an old install to the new install

it was missing

wrong file name in the new DDS version?

After reading this, I checked for that problem and yes, there is a mistake similar to the one you describe that I see in the code, but the mistake I see doesn't match your description quite exactly, so I'd like to ask for a clarification to see if it's really the same thing.

Question: When you quoted the filename in question as being "launcher-button.png" did you *actually* mean "launcher-button-blizzy.png"?  Because if so, then what I see in the code would match your description perfectly.  But if you did literally mean the relevant file was "launcher-button.png" (no "-blizzy" in the filename) as you wrote, then what I see wouldn't quite be the same as the problem you describe so I'd still have to look further to find the problem.

(What I see in the code would imply that the normal stock toolbar button should work just fine, and the bug I see should only affect the Blizzy modded toolbar, not the stock toolbar.)

@infinite_monkey - in your first description of the purple icon, when you said the icon was purple in "the toolbar" did you mean the mod "blizzy's toolbar" rather than just "the toolbar"?   If that's what you meant then it all becomes clear.  I thought you were reporting it being purple in the normal toolbar - the stock one, and I couldn't reproduce the problem at all.  If the stock toolbar was working just fine all along, and only blizzy's toolbar wasn't, then that would fit what I'm seeing.  (They are two different image files - the blizzy icon is a smaller version of the image, in a separate filename, and it was that filename that has the problem.)

Link to comment
Share on other sites

3 hours ago, Steven Mading said:

After reading this, I checked for that problem and yes, there is a mistake similar to the one you describe that I see in the code, but the mistake I see doesn't match your description quite exactly, so I'd like to ask for a clarification to see if it's really the same thing.

Question: When you quoted the filename in question as being "launcher-button.png" did you *actually* mean "launcher-button-blizzy.png"?  Because if so, then what I see in the code would match your description perfectly.  But if you did literally mean the relevant file was "launcher-button.png" (no "-blizzy" in the filename) as you wrote, then what I see wouldn't quite be the same as the problem you describe so I'd still have to look further to find the problem.

(What I see in the code would imply that the normal stock toolbar button should work just fine, and the bug I see should only affect the Blizzy modded toolbar, not the stock toolbar.)

@infinite_monkey - in your first description of the purple icon, when you said the icon was purple in "the toolbar" did you mean the mod "blizzy's toolbar" rather than just "the toolbar"?   If that's what you meant then it all becomes clear.  I thought you were reporting it being purple in the normal toolbar - the stock one, and I couldn't reproduce the problem at all.  If the stock toolbar was working just fine all along, and only blizzy's toolbar wasn't, then that would fit what I'm seeing.  (They are two different image files - the blizzy icon is a smaller version of the image, in a separate filename, and it was that filename that has the problem.)

I copied all file from my 1.4.1 to my 1.6.1 install not over writing existing files

Edit

I did that after seeing the log a kos error of not finding a file

Edited by danielboro
Link to comment
Share on other sites

On 3/8/2019 at 6:23 AM, Steven Mading said:

@infinite_monkey - in your first description of the purple icon, when you said the icon was purple in "the toolbar" did you mean the mod "blizzy's toolbar" rather than just "the toolbar"?   If that's what you meant then it all becomes clear.  I thought you were reporting it being purple in the normal toolbar - the stock one, and I couldn't reproduce the problem at all.  If the stock toolbar was working just fine all along, and only blizzy's toolbar wasn't, then that would fit what I'm seeing.  (They are two different image files - the blizzy icon is a smaller version of the image, in a separate filename, and it was that filename that has the problem.)

Yes, it was indeed just Blizzy's toolbar, as I pointed out later:

Sorry for the confusion... So as I said: the kOS icon was there in the stock toolbar, although with a bad quality. I didn't find a way to use the stock toolbar for kOS when Blizzy's toolbar is installed.

Link to comment
Share on other sites

7 hours ago, Gudlifer said:

Good day! I am not a programmer and I don’t know how to write scripts, you can give a link to ready-made scripts or share the only necessary script for landing Space X steps.

TXH

You could use MechJeb for that. Many landing scripts I've seen (including my own) contain tweaks that depend on the vessel and the mods you're using.

Link to comment
Share on other sites

14 hours ago, infinite_monkey said:

Yes, it was indeed just Blizzy's toolbar, as I pointed out later:

Yeah I see what happened.  It now seems that the purpose of that later post must have been you saying, "Let me follow-up that original post by going back and describing more things about what happened just before that first post."  But it only seems that way now in hindsight.   I took the phrasing about "Followup to the problem" to mean the events being described in your post were a series of events that occurred after the original problem, as part of your follow-up to the problem.

 

That might seem like a minor difference, but getting the order of events swapped around makes all the difference in the world.  i.e. instead of "Blizzy was installed when I first reported the problem, in which only Blizzy's icon was broken and the stock icon was working but fuzzy", it sounded more like "Blizzy was installed after I reported the problem, as part of my follow-up to the problem.  I discovered that Blizzy's icon was broken too, but the weird thing is that after installing it the stock icon got fixed."

Edited by Steven Mading
Link to comment
Share on other sites

I've been having a further play with my Rails/Physics issue, and it seems that it will only change warp modes if the terminal is active.

If I run this code, and have clicked out of the terminal window:

	warpto (warptime).
	wait 1.
	wait until Warp = 0 and kuniverse:timewarp:issettled.

	set pcount to 0.
	until kuniverse:timewarp:mode = "PHYSICS" {
		SET kuniverse:timewarp:mode TO "PHYSICS".
		set pcount to pcount +1.
		print "Pcount : " + pcount at (0,20).
		wait 0.1.
	}
	print kuniverse:timewarp:mode.	
	Set Warp to 3.

it will sit there counting away until I click in the terminal window, and then change to Physics and carry on.

Is this supposed to happen?  Is there a way I can focus the terminal window from within code? I tried   core:part:getmodule("kOSProcessor"):activate. and it appears to reset the window. 

Link to comment
Share on other sites

22 hours ago, infinite_monkey said:

Вы можете использовать MechJeb для этого. Многие сценарии посадки, которые я видел (в том числе и мои), содержат твики, которые зависят от судна и модов, которые вы используете.

Thank you, but mechjeb you can create a script only to exit into orbit and further connections with some object, and of obrasheniya of course. But as for the recycle 2 stage Falcon 9 or two acceleration accelerators Falcon Heavy, which during the flight independently detach and sit back on the airfield, I have not found, and I at this time will remain with the main cargo put into orbit and the camera does not overlap. It really is able to do without mechjeb or Kos can't be avoided?

Link to comment
Share on other sites

5 hours ago, RizzoTheRat said:

I've been having a further play with my Rails/Physics issue, and it seems that it will only change warp modes if the terminal is active.

Arrrg dangit.

In order to fix the rotating map problem, I had to lock out a few more input locks in the terminal in the recent updates to kOS. (I am 100% convinced the rotating map problem is because someone at SQUAD used the input locks as an indirect side-effect test that presumed we are not in map view if the locks are set a certain way, and therefore the camera should rotate to match the ship when the target lock is set.)  It makes zero sense that the ability to change target by clicking is the test for being on map view, except it seemed to be doing exactly that.  To stop the map view rotation bug, I had to change how the terminal deals with the input locks.  This may be a side-effect of that because it's possible I ended up locking out the ability to alter time warp too.

Can you write up a good careful description of what triggers the problem (basically what you wrote here in the forum) over on github?  I am away at the moment reading this on my phone so I can't easily do it myself.

26 minutes ago, Gudlifer said:

Thank you, but mechjeb you can create a script only to exit into orbit and further connections with some object, and of obrasheniya of course. But as for the recycle 2 stage Falcon 9 or two acceleration accelerators Falcon Heavy, which during the flight independently detach and sit back on the airfield, I have not found, and I at this time will remain with the main cargo put into orbit and the camera does not overlap. It really is able to do without mechjeb or Kos can't be avoided?

Auto-landing of stages is a very complex operation - one that I don't  think Mechjeb does for you.  kOS *can* do it, but only if you write a program (or have one someone else wrote) for it.  It's not a problem with a simple "out of the box" shrink-wrap solution.

(Any such solution will *also* involve having to install the FMRS mod as well, which is needed to avoid the problem that Kerbal Space Program doesn't work if you try to extend the physics bubble" too large to be able to have the 1st stage and 2nd stage both actively thrusting at the same time while 60km apart from each other.)

I assume Gudlifer is a native Russian speaker, from the cryllic text in the post.  I know there are a few people fluent in both English and Russian in this forum thread.  Can someone do me the favor of making a good translation of what I typed above for Gudlifer?

Edited by Steven Mading
Link to comment
Share on other sites

7 hours ago, Steven Mading said:

Yeah I see what happened.  It now seems that the purpose of that later post must have been you saying, "Let me follow-up that original post by going back and describing more things about what happened just before that first post."  But it only seems that way now in hindsight.   I took the phrasing about "Followup to the problem" to mean the events being described in your post were a series of events that occurred after the original problem, as part of your follow-up to the problem.

 

That might seem like a minor difference, but getting the order of events swapped around makes all the difference in the world.  i.e. instead of "Blizzy was installed when I first reported the problem, in which only Blizzy's icon was broken and the stock icon was working but fuzzy", it sounded more like "Blizzy was installed after I reported the problem, as part of my follow-up to the problem.  I discovered that Blizzy's icon was broken too, but the weird thing is that after installing it the stock icon got fixed."

Sorry again :( Well, things didn't happen before the first post. Only after Blizzy's toolbar was broken I realized that the stock toolbar was working fine. As I mentioned, I didn't find a way to enable the stock icon - there is no setting in kOS and neither in Toolbar Controller.

@Gudlifer MechJeb has a landing function (I never used it though, so I might be wrong about how well it works). I isn't accurate enough for landing on a drone ship, but it should be possible to land somewhere near the KSC. As for your problem with controlling separate stages, that's a different problem. As Steven said, you can use FMRS for that. If you don't care about watching your booster land, you could use the Stage Revocery mod. It checks if your booster has enough fuel to land, and then just returns your money. Scott Manley compared them in this video: 

 

 

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...