Jump to content

[1.3] kOS Scriptable Autopilot System v1.1.3.0


erendrake

Recommended Posts

@Wuwuk

Ok so you are staging in the same physics tick as you lock the throttle to 0. If you add a "wait 0.1." between lock throttle to 0 and stage then it will work. The reason you cant shut it down is because it is no longer part of the ship.

Thanks.

Link to comment
Share on other sites

Dunbaratu:

Can you assist to demo how to make a 3D array?

I want to extend this array to add a dimension for mod lists for each tagged part.

Is there a better way to state the size of the array than adding lists one at a time?

SET TAGS TO LIST(). // Empty list.

TAGS:ADD( LIST() ).//0

TAGS:ADD( LIST() ).//1

TAGS:ADD( LIST() ).//2

TAGS:ADD( LIST() ).//3

TAGS:ADD( LIST() ).//4

TAGS:ADD( LIST() ).//5

TAGS[0]:ADD( "FR ROTATRON" ).//0,0 front right leg hip, and 1,2,3 knees

TAGS[0]:ADD( "FR FOLDATRON1" ).//0,1

TAGS[0]:ADD( "FR FOLDATRON2" ).//0,2

TAGS[0]:ADD( "FR FOLDATRON3" ).//0,3

TAGS[1]:ADD( "FL ROTATRON" ).//1,0 front left leg hip, and 1,2,3 knees

TAGS[1]:ADD( "FL FOLDATRON1" ).//1,1

TAGS[1]:ADD( "FL FOLDATRON2" ).//1,2

TAGS[1]:ADD( "FL FOLDATRON3" ).//1,3

TAGS[2]:ADD( "MR ROTATRON" ).//2,0 mid right leg hip, and 1,2,3 knees

TAGS[2]:ADD( "MR FOLDATRON1" ).//2,1

TAGS[2]:ADD( "MR FOLDATRON2" ).//2,2

TAGS[2]:ADD( "MR FOLDATRON3" ).//2,3

TAGS[3]:ADD( "ML ROTATRON" ).//3,0 mid left leg hip, and 1,2,3 knees

TAGS[3]:ADD( "ML FOLDATRON1" ).//3,1

TAGS[3]:ADD( "ML FOLDATRON2" ).//3,2

TAGS[3]:ADD( "ML FOLDATRON3" ).//3,3

TAGS[4]:ADD( "RR ROTATRON" ).//4,0 rear right leg hip, and 1,2,3 knees

TAGS[4]:ADD( "RR FOLDATRON1" ).//4,1

TAGS[4]:ADD( "RR FOLDATRON2" ).//4,2

TAGS[4]:ADD( "RR FOLDATRON3" ).//4,3

TAGS[5]:ADD( "RL ROTATRON" ).//5,0 rear left leg hip, and 1,2,3 knees

TAGS[5]:ADD( "RL FOLDATRON1" ).//5,1

TAGS[5]:ADD( "RL FOLDATRON2" ).//5,2

TAGS[5]:ADD( "RL FOLDATRON3" ).//5,3

//thirdsegs are required at most times to be perpendicular to the terrain.

//firstsegs and secondsegs are at most times required to mirror each other.

//when walking, only first segment raises, second segment stays put, or is

//proportional.

//walking requires two set of tripods in mirrored motion.

//other walk profiles are quite elegant to watch and should be programmed.

//"wave" and "ripple" gaits are possible. But tripod is fastest.

Link to comment
Share on other sites

Dunbaratu:

Can you assist to demo how to make a 3D array?

I want to extend this array to add a dimension for mod lists for each tagged part.

Is there a better way to state the size of the array than adding lists one at a time?

At the moment there is not. Two things I'd like to see are:

1 - A way to say "Return me a list of N things that are all copies of blarg": i.e. SET fiveAs TO LIST(5,"A"). // 5 things, each one is "A".

2 - A way to say "Make me a list of the things in this tuple": i.e. SET fiveAs TO { "A", "A", "A", "A", "A" }.

None of these exist yet, but they probably could with some work.

Link to comment
Share on other sites

My only criticism is that you can't paste code into the kos window.

You can paste it into the editor sub-window, though.

I have no idea how you would go about reading the cut buffer from inside Unity, but Unity's own text editing widget knows how.

Link to comment
Share on other sites

This would be one of my favorite mods, except that LOCK STEERING doesn't work at all. It doesn't utilize engine gimbaling (the primary means of steering on launch in Realism Overhaul), and even when it doesn't require that, trying to lock onto a heading causes even very simple rockets to wobble all over the nav ball, kind of centering around the heading. Until LOCK STEERING works, the mod is kind of unusuable.

Link to comment
Share on other sites

This would be one of my favorite mods, except that LOCK STEERING doesn't work at all. It doesn't utilize engine gimbaling (the primary means of steering on launch in Realism Overhaul), and even when it doesn't require that, trying to lock onto a heading causes even very simple rockets to wobble all over the nav ball, kind of centering around the heading. Until LOCK STEERING works, the mod is kind of unusuable.

Does RO change the way engine gimballing work from stock, cause kOS will utilise the engine gimbals in stock as long as they unlocked, and it is possible to make steering code yourself to lock to a heading should you find lock steering unhelpful for the rockets you're launching.

Link to comment
Share on other sites

@Avi

I was having this exact issue today. My FAR launcher wobbled like a demon, turned out the gimbal was actually at fault.

LOCK STEERING does use the engine gimbal, the wobbling all over the navball you are seeing is probably actually a result of the gimbal trying to hold its course. I locked my mainstage gimbal in the VAB, which forces kOS to use the control surfaces and you get smooth flight. Once in vacuum i prefer torque/rcs for attitude control anyway, big thrusty engines tend to produce this wobbling as they hunt for the lock point. As a player without kOS you would be hitting 'CAPS' at this point, but I cant find anyway to invoke that. This I see most on wobbly rockets, check your torque distribution, could be that kind of 'circling'. (the middle of the rocket aims true, the nose and tail describe opposite circles. Less common with KerbalJointReinforcement)

edit: Also, how new are you to RO? I hope you are aware that many engines do not have a gimbal with that setup. If you have RP-0 especially then you have a good number of gimbal-less early engines. A second possibility is that you have toggled SAS, which kills kOS ability to control entirely and that what you are seeing is actually SAS hunting the hold point not kOS.

@Kamik

You lock the steering outside the until apoapsis loop. You need to move that line down into the loop body so that it is constantly re-called for it to follow your curve. The fix should literally be as simple as placing that steering lock directly below the until, before your massive tree of IFs... Which hurt my eyes buddy, but I see what you are doing. I prefer nesting WHEN triggers for less strain on the processor. The way you have it then at the top of the climb every loop is checking all of the IF blocks and passing through them then setting the current angle wanted again and again. Instead use something like

WHEN ALTITUDE > 500 THEN {
SET TV TO 105. SET PT TO 85. WHEN ALTITUDE > 1000 THEN {
SET TV TO 110. SET PT TO 80. WHEN......}}

. You can extend this as far as possible, only the next sequential trigger exists at any moment since it is set up by the last one and each trigger fires once and once only to set the current values and queue its successor. This is perfect for ascent/descent and timewarp management. Just make sure these are out of the loop, my turnshape and throttle settings for launch are the first thing I call with a tree of WHEN triggers like this.)

Basically, its back to front, you constantly set the angle you want but only lock steering once. You want to constantly lock steering and only set the angles once. Constantly setting both works but is needlessly heavy code, you really want to keep the amount of logic (if) going on inside the loops to a minimum. (it will always happen, just be as smart as possible about it and think carefully about how each loop iteration will go, trace the code)

My turn!

Speaking of WHEN triggers. Whats their scope? I want to declare a trigger in this fashion in 1 script and then have the script end, be deleted and another program run. Do all the WHENs it sets up expire with it or are they still active?

Secondly. Timewarp. KSP has some sketchy bugs itself with regards to going back and forth between modes. But what i really want to know is: Is there any way to produce 'physics-warp', that is 1-4x produced via alt-period, in kOS? I can achieve it while in atmosphere by just calling for warp, but is there any way to force that mode in vacuum? (I want to burn under warp, something i regularly do with nukes/ions manually)

Edited by celem
Link to comment
Share on other sites

Does RO change the way engine gimballing work from stock, cause kOS will utilise the engine gimbals in stock as long as they unlocked, and it is possible to make steering code yourself to lock to a heading should you find lock steering unhelpful for the rockets you're launching.

It doesn't use gimbaling in RO or not in RO. I tested with two separate installations, both with the stock universe and with Realism Overhaul, and LOCK STEERING is totally broken. I tried it with and without engine gimballing enabled as well, and tried to use it both when engines were and were not firing. I get the same results no matter what. While it would be possible to use Raw Controls to lock to a heading, that's a million times more cumbersome; LOCK STEERING is basic functionality and if it doesn't work, it's a gamebreaker. I really look forward to when this issue is fixed.

Link to comment
Share on other sites

This is false. When I play stock and lock steering I see the engine exhaust is being aimed back and forth as it steers all the time.

Yeah, it affects engine gimballing, it just doesn't use it to turn. The engines sort of vibrate in place; their movement has no bearing on where you tell it to lock steering. It's not just the gimbaling that's the issue, to clarify: when I try to orient just with reaction wheels in space, the craft spins around in a way that's sort of roughly centered on where I tell it to LOCK STEERING, but it never actually points at the heading direction. There are no circumstances in which LOCK STEERING successfully points the rocket in the direction you tell it to.

EDIT: I think I may have figured out the issue, at least partially. I think it's a MechJeb interaction; the problem is alleviated when I detach MechJeb.

Edited by avi
Link to comment
Share on other sites

THANKS FOR THE FIX!!!!

Next problem: I really love remotetech, and I hoped to use this mod with it... howerer remotetech cuts the throttle when I get out of communications range. even if kOS is controlling the rocket. Workaround?

Thank you!

Link to comment
Share on other sites

Hey guys,

since kOS works now for me, I try to establish a remoteTech network around Kerbin.

But to make my script work entirely like I want it to work, i need the partmodule:doaction phrase... but from the documentary i can't really find the completely right exclamation for it.

Would be nice if someone could give me an example for this phrase.

Greets JD_Tiger

Link to comment
Share on other sites

Hey guys,

since kOS works now for me, I try to establish a remoteTech network around Kerbin.

But to make my script work entirely like I want it to work, i need the partmodule:doaction phrase... but from the documentary i can't really find the completely right exclamation for it.

Would be nice if someone could give me an example for this phrase.

Greets JD_Tiger

Like this?


print "Activating mothership antenna".
set antenna to ship:partstagged("MSOmni")[0]:getmodule("ModuleRTAntenna").
antenna:doevent("activate").

This page may help you

http://ksp-kos.github.io/KOS_DOC/commands/parts.html

Link to comment
Share on other sites

*Facepalm*

Thanks...

Try my script then will edit this

get following error:

Get suffix'DOEVENT' not found on objet LIST of 3 items

Any idea what I can do?

Edited by JD_Tiger
Link to comment
Share on other sites

THANKS FOR THE FIX!!!!

Next problem: I really love remotetech, and I hoped to use this mod with it... howerer remotetech cuts the throttle when I get out of communications range. even if kOS is controlling the rocket. Workaround?

Thank you!

Please enable RT button/light on KOS Panel (like here ee0d90ca-d7b3-11e4-86cc-edc92c629731.png

Link to comment
Share on other sites

I'm having the same problem as Evi - LOCK STEERING causes the craft to oscillate around the target orientation. I don't have mechjeb installed, though.

First check that the root part of your vessel is aligned with vessel's general axis and ideally is the part you are controlling from.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...