Jump to content

Space Computer. Brought to you by kOS and hopefully many nerds.


Payload

Recommended Posts

The antenna range calculations changed in 0.65 so it's not QUITE as bad as it was before, but it's still going to require a few. What would be great would be if it was directional. If the dish antenna is aimed at kerbin you get better range than if it isn't. But before that can be a possibility we have to have the ability to get data on objects more than 2.4 Km away, and on objects that don't have their own SCS on them.

Right now the way the data gathering about your target's stats works is that the target must be a vessel and must be loaded into the full simulation system (not on rails). This makes getting data on planets impossible unless that system is handled differently.

Heck if we could just query the universe time (as opposed to just the mission time), we could devise our own equations to work out where planets and moons have to be using our own homebrewed "on rails" calculations.

You're telling me that if I made a program that I manually target the mun and have the program set that when the distance to target is at x ( a very bastardized version of phase angling I was going to attempt) the program would fall flat on its face? If so you saved me from having my hair go white trying to get that to work. Since I use this program along with mission controller ( plus some realism mods since I like my games hard) and I was getting to the point of needing to send craft to the mun that was my original idea to get it to work. Looks like my backup plan of just waiting till the mun is at the right point and launching straight at it no circularization burn. Will make minmus and duna missions a pain in the rear however.

Link to comment
Share on other sites

  • 2 weeks later...
[...]

We both have used the ON ... command wrong.

That way it causes a memory leak, causes the event handler are keeping pilling up.

See:

Link to comment
Share on other sites

As far as I am concerned I am not using it wrong. There is no right or wrong way to use something that isn't documented. That is the issue with this mod. Always has been. Absolutely zero documentation. My error is thinking this is a scripting language. It is reported to be but it isn't. It is a super verbose lower level language that reinvents the wheel yet again. I would prefer a compiler if I am to be doing everything in such deep level. I would prefer consistent code base that works from one version to another. I should have gone with my first instinct of thinking that this would never really work correctly. It wont. It's too much work for the author to actually make it useable as a scripting language.

I see what the issue is with the ON operator. It requires nothing more than a simple IF statement to halt until next input.

Essentially making it a run once operation that is flagged when a new input poll is required.

It wasn't added at the time because the speed of kOS was much lower. It didn't have time to stack up.

It just wasn't an issue then and it only causes a bit of stutter for me even now. Only when I run in windowed mode.

It doesn't have to be that way. It just so happens that it is. The fact that it stacks up on itself is not an error of it's usage in a script.

It's an error of how it is parsed. It should not be up to the script writer to ensure that the command doesn't set duplicate triggers.

If I wanted to be bothered with those sort of things I would use a much lower level API with proper documentation and a compiler.

Yup kOS broke space computer again attempting to run same program i have been since .60 and get an unrecognized term 'eta' now.

I haven't tried it. There is supposed to be v0.82 out according to Kevin. I haven't looked into it.

I have been spending my time writing a landing script since no one else wants to help.

Every one is a critic but no one wants to put rubber to pavement.

To tell you the truth I am starting to lose interest in this project.

I had hoped other people would join in but they seem more interested in mocking than actually doing anything.

Apparently the peanut gallery is restless. I have been staying low key for a while and just trying to grind on with the work.

But with the latest update jacking my programs up yet again on top of being insulted in a github bug report of all things, it is coming to a head.

I just don't enjoy using kOS anymore. I still do feel like it is important to continue.

Others want to turn this into yet another way to feel superior to fellow humans and are holding their cards close to their chest.

It seems everyday they insist on making operations ever more complicated rather than ensuring that a larger number of people who enjoy KSP have a chance to enjoy this mod as well.

Enough crybaby from me. I'll get to work on fixing the action group polling script. I can't see that taking more than a few minutes.

Now that I know that there is a problem with it setting the trigger over and over it's a simple fix.

I think I am currently using version 0.71. I will hold off on the update until the parsing issues calm down.

Kevin seems to be in the process of changing how the parsing is done. It really needs it also. It was beginning to cause other problems.

Once again I wish to say what I have said many times already in this thread and I'm sure I will have to say it again many more times.

I do not claim that these examples are bug free in anyway. I make no claims other than It appears to work. For the time being.

If you know of a better way of doing something, I would appreciate if you would make some attempt to contact me in this thread with a concise explanation.

I prefer to get my bug reports here rather than having to read them on KOS guthub with nasty statements attached.

I don't think that is too much to ask.

Edited by Payload
Link to comment
Share on other sites

[...]

I was just (super) saiyajin 320px-Son_Goku_direkt_nach_seiner_ersten_Verwandlung_zum_Super_Saiyajin.jpg

... erm ... saying

So that you know it.

Btw I still want include that into the wiki. Not just link like now, but full blown. With file download (file will be hosted on the wiki) and everything.

edit: I should read my notifications.

Link to comment
Share on other sites

I did test it with .82 program ill attach a screenshot of the exact error kos is reporting here in a few minutes. And incase my report sounded snooty I apoligize alot of the reasons you posted are why I've taken a hiatus from this myself and put off coming up with a transfer script to add to this. As soon as I find the time and can get my damn epilepsy under control I'll be helping out.

2F5D171E85782A6FB914453CEC1CB6B62C11FC2D


clearscreen.
sas off. // Ensures SAS is OFF.

//**User Set variables.

set tOrbit to 200000. // Sets Default Target Orbit.
set tHeading to 90. // Sets your launch heading. Usage:0-360. 0=North.
set rpAlt to 1000. // Sets the altitude at which to preform an initial roll.
set rProgram to -90. // Sets the roll target. Engages at rpAlt. Usage:0-360. 180=VAB default.

set throttleLimit to 1. // Engages throttle limits below turn1.
set tTWR to 1.25. // Sets the max TWR while throttle limited.

set Count to 0. // Sets the number of asparagus stages.
set aspFuel to 0. // Sets the amount of fuel in one aparagus stage.


//**Internal variables.

set yaw to 90 + tHeading. // Internal var to match heading to NavBall
set pitch to 90. // Sets your inital pitch via heading. Usage:0-360 90=Up.
set roll to 180. // Sets your inital roll. Usage:0-360. 180=VAB Default.
set x to 0. // Internal var for angle calculation.
set y to 0. // Internal var for angle calculation.
set z to 0. // Internal var for angle calculation.
set tThr to 1. // Sets throttle at lift off.
lock steering to up + R(0,0,roll) + V(x,y,z). // Locks steering to calculated vector plus roll.
lock throttle to tThr. // Locks throttle to var tThr.
set orbit to 0. // Sets the main loop close condition.
set hAtmo to 69500. // Sets the altitude of atmosohere of Kerbin. Unit:Meters.
set turn1 to 9999. // Sets the altitude of the first down range turn. Unit:Meters
set turn2 to 14999. // " " Unit:Meters
set turn3 to 19999. // " " Unit:Meters
set turn4 to 24999. // " " Unit:Meters
set turn5 to 49999. // " " Unit:Meters

//**Values based on UI.

set xAlt to tOrbit - 100. // Primary M.E.C.O. Condition. Usage:xAlt=tOrbit-Meters.
set xOrbit to tOrbit + 5000. // Secondary M.E.C.O. Condition. Usage:xOrbit=tOrbit+Meters.
set cAlt to tOrbit - (tOrbit*.05). // Internal var for near MECO throttle limit. Usage:cAlt=tOrbit-5%.
set hAlt to tOrbit - 5. // Internal var for apoaps hold. Usage:hAlt=tOrbit-Meters.


//**Begin Countdown.

clearscreen.
print "Orbit altitude set to " + tOrbit + "m".
print "3". wait 1.
print "2". wait 1.
print "1". toggle ag1. wait 1.
clearscreen.
print "Lift Off! Target Heading set to " + tHeading + "Deg". stage.

set StartFuel to <liquidfuel>. // Internal var for initial Total Liquid Fuel.


//**G-turn Section.

when altitude > rpAlt then set roll to rProgram.
when altitude > turn1 then set pitch to 65.
when altitude > turn2 then set pitch to 50.
when altitude > turn3 then set pitch to 30.
when altitude > turn4 then set pitch to 15.
when apoapsis > turn5 then set pitch to 0.


//**Orbit Injection control. Alter at your own risk.

when apoapsis > tOrbit then
{
set tThr to 0.
set Gk to 3.5316000*10^12.
set Radius to 600000 + apoapsis.
set iRadius to 600000 + ((apoapsis+periapsis)/2).
set tVel to (Gk/Radius)^0.5.
set iVel to (Gk/iRadius)^0.5.
set reqdV to (iVel-tVel).
set acceleration to (maxthrust/mass).
set burnTime to (reqdV/acceleration).
set tTime to (burnTime/2).

until altitude > hAtmo
{
if apoapsis < hAlt { set tThr to .1. }.
if apoapsis > tOrbit { set tThr to 0. }.
}.
when altitude > 70000 then stage.
when altitude > 70200 then set warp to 3.
when eta:apoapsis < 120 + tTime then set warp to 2.
when eta:apoapsis < 60 + tTime then
{
set warp to 0. wait 1. lock steering to prograde.
}.
when eta:apoapsis < tTime then set tThr to 1.
}.

when periapsis > cAlt then set tThr to .1.
when periapsis > xAlt OR apoapsis > xOrbit then
{
set tThr to 0.
clearscreen.
print "You Are Now In Orbit".
set orbit to 1.
}.


//**Main Control loop. Alter at your own risk.

until orbit = 1
{
set x to cos(yaw) * cos(pitch).
set y to sin(yaw) * cos(pitch).
set z to sin(pitch).
set StageSolid to stage:solidfuel.
set StageLiquid to stage:liquidfuel.
set Lfuel to <liquidfuel>.
set TWR to maxthrust / (mass*9.81).
set cTWR to TWR * tThr.
set dTWR to cTWR - tTWR.
print "Heading " + heading at (0,3).
print "Max Surface TWR " + TWR at (0,5).
print "Current TWR " + cTWR at (0,7).
print "ETA:Apoapsis " + eta:apoapsis at (0,9).

if throttleLimit = 1
{
if cTWR > tTWR { set tThr to tThr - (dTWR*.1). }.
if cTWR < (tTWR - (tTWR*.1)) { set tThr to tThr + .05. }.
if tThr > 1 { set tThr to 1. }.
if tThr < 0 { set tThr to 0. }.
when altitude > turn2 then
{ set throttleLimit to 0. set tThr to 1. }.
}.

if Lfuel < StartFuel - aspFuel AND Count > 0
{ stage. set StartFuel to Lfuel. set Count to Count - 1. }.

if StageSolid > 0 AND StageSolid < 5
{ stage. }.

if StageLiquid = 0 AND StageSolid = 0
{ if Lfuel > 0 { stage. wait 1. }. }.
}.


//**End program orbital condition print out. Extend solar pannels on AG1.

lock throttle to 0.
wait 1.
print " ".
print "Apoapsis is " + apoapsis + "m".
print " ".
print "Periapsis is " + periapsis + "m".
print " ".
print "Orbital Eccentricity is " +
(((apoapsis + 600000)-(periapsis + 600000))/((apoapsis + 600000)+(periapsis + 600000))).
print " ".

wait until orbit = 1.
wait 5.
run plrelease.

same program I've ran forever just a slightly modified space computer with the starting ui cut out for space and the twr cap left on for longer.

Edited by Kalista
Link to comment
Share on other sites

I did test it with .82 program ill attach a screenshot of the exact error kos is reporting here in a few minutes. And incase my report sounded snooty I apoligize alot of the reasons you posted are why I've taken a hiatus from this myself and put off coming up with a transfer script to add to this. As soon as I find the time and can get my damn epilepsy under control I'll be helping out.

Oh no. It in no way sounded snooty. I was referring to other issues that aren't important. I didn't update once I heard of the parsing errors in .80. For now I hope you kept your .70. DL around. It is what we will have to use until this gets sorted. I really wish that the menu would work too. It seems that having programs run reliably when executed by another is not a top priority.

I fixed the recursive ON statements here in my working copy and it had no effect on the stuttering so something tells me that isn't the whole issue. I also have a better way of locking TWR that is much faster and isn't loop controlled. I will roll those updates out once I have had a chance to test them some more. Probably tomorrow. Today is my birthday so I am going to take some time off video game things and spend some with my wife. I will update the first post to notify that we need kOS .70.

Link to comment
Share on other sites

Space computer far as i know doesn't display the eta, its using it to time the circularization burn and somethin changed with .82 thats making kos reject that line in space computer. And without that line circularization becomes very hairy.

Link to comment
Share on other sites

0.83 space computer STILL broken same error on eta going to go make a stink bout it in main thread in hopes its finally resolved. So for the time being guys stick with 0.71.

Well the funny thing is: I wrote a program with only three commands, and 4 lines.

if eta:apopapsis > 10 {print "if ok".}.
wait 1.
when eta:apopapsis > 10 {print "when ok".}.
wait 50.

When sitting on ground and entered on the command line both if and when are fired.

When sitting on ground and in program only when is fired.

When flying both are fired.

294e231c-3002-11e3-914e-06e1fed267ad.png

295c4316-3002-11e3-8497-66d0b1da16ab.png

sorry no screeny of the flying version.

But if I use orbit.txt (from space computer) which btw worked perfectly fine 0.7 then I get the unrecognized eta: term.

I checked the code over and over again. I can't find an error.

On the other hand I just proved that eta:apoapsis works .. on command line or programs...

Edited by Bizz Keryear
Link to comment
Share on other sites

Well the funny thing is: I wrote a program with only three commands, and 4 lines.

if eta:apopapsis > 10 {print "if ok".}.
wait 1.
when eta:apopapsis > 10 {print "when ok".}.
wait 50.

When sitting on ground and entered on the command line both if and when are fired.

When sitting on ground and in program only when is fired.

When flying both are fired.

sorry no screeny of the flying version.

But if I use orbit.txt (from space computer) which btw worked perfectly fine 0.7 then I get the unrecognized eta: term.

I checked the code over and over again. I can't find an error.

On the other hand I just proved that eta:apoapsis works .. on command line or programs...

Bizz have you tried it with math? Space computer uses eta:apoapsis in a math statement.


when eta:apoapsis < 120 + tTime then { do something. }.

Maybe try.


when eta:apoapsis < (120 + tTime) then { do something. }.

That might fix it.

I also just noticed that I am using THEN I am not sure if that is still required in when statements. Honestly I am not sure why it ever was.

If doesn't use it. Seems like it isn't required but I haven't tested it. I have enough trouble already without sabotaging my self.

Good news.

I wish to announce that Space Computer can now officially launch to orbit and then preform a transfer and then preform a powered landing on Kerbin... All from the menu!

The recursive ON statements where what was breaking the whole lot. Once I fixed that, everything worked as it should have.

I will probably switch to hosting the scripts on pastebin to clean up the front page. There will be a lot more coming.

I am not so sure that I like the menu system now that it is working. I am looking at being able to setup mission packs that will execute based on settings in the mission pack file.

You tell it to "run Mymission" and it will carry out your mission as described in the file. Probably a thousand different ways to do that. I shall have to think about it and try some things.

I have still yet to remove a ton of constants to be replaced with variables based on SOI, set parameters, Etc.

I see the mods for the mods have popped up to allow you to poll sensor information. I probably won't bother with that too much. I expect Kevin will add that functionality directly to kOS.

Edited by Payload
Link to comment
Share on other sites

Bizz have you tried it with math? Space computer uses eta:apoapsis in a math statement.


when eta:apoapsis < 120 + tTime then { do something. }.

Maybe try.


when eta:apoapsis < (120 + tTime) then { do something. }.

That might fix it.

I also just noticed that I am using THEN I am not sure if that is still required in when statements. Honestly I am not sure why it ever was.

Sorry that was a typo.. since I was testing it in ksp directly (not using archive) there was a then in the actual script!

If doesn't use it. Seems like it isn't required but I haven't tested it. I have enough trouble already without sabotaging my self.

Good news.

I wish to announce that Space Computer can now officially launch to orbit and then preform a transfer and then preform a powered landing on Kerbin... All from the menu!

As long as you are using a kOS version that is capable of using thrust and steering (my experience was: 0.82 steering working but throttle broken, 0.83 throttle working but steering broken)

The recursive ON statements where what was breaking the whole lot. Once I fixed that, everything worked as it should have.

I will probably switch to hosting the scripts on pastebin to clean up the front page. There will be a lot more coming.

Put it on the wiki, I want to have it there anyway. I give you an example what it will be like:

Need rights? No problem I will give them t you. (wow thats sound desperate)

I don't mean that you should drop this thread here. Its better for communication anyway.

I am not so sure that I like the menu system now that it is working. I am looking at being able to setup mission packs that will execute based on settings in the mission pack file.

You tell it to "run Mymission" and it will carry out your mission as described in the file. Probably a thousand different ways to do that. I shall have to think about it and try some things.

I have still yet to remove a ton of constants to be replaced with variables based on SOI, set parameters, Etc.

I see the mods for the mods have popped up to allow you to poll sensor information. I probably won't bother with that too much. I expect Kevin will add that functionality directly to kOS.

I also think so, but for now (and also cause this mod exists) he will concentrate on other things.

Hopefully bug fixing.

Edit: For some reason I still don't understand eta:apoapsis is still broken in the (old) space computer orbit script. while it was working in my test program.


clearscreen.
set ttime to 10.
lock steering to up + R(0,0,180).
lock throttle to 1.
stage.
when eta:apoapsis > 20 then {print "simple eta works".}.
when eta:apoapsis > 20 + ttime then {print "plus time works".}.
when eta:apoapsis > ( 20 + ttime + ttime ) then {print "brackets work".}.
until <liquidfuel> < 200 {
if stage:liquidfuel = 0 and stage:solidfuel = 0 {
stage.
print "stage compair work".
}.
}.
print "full ressource compair work".

in this program everything is executed.

That also means throttle and steering are working again.

Edited by Bizz Keryear
Link to comment
Share on other sites

Double post cause its important I have found it!

Its an issue with print! So

print "ETA:Apoapsis  " + eta:apoapsis at (0,9). // does not work and throw an error (without reason)
print "ETA:Apoapsis " + (eta:apoapsis) at (0,9). // does work.

Since this workaround is around I dunno when it will get fixed since there are more pressuring bugs.

But something in 0.84 still prevents it from working correctly.

Link to comment
Share on other sites

Just wanted to say thank you for your hard work payload on getting this up and running and well maintained. Heck if you have hit half the bugs I have just today trying to get a working vacuum landing script I have no idea how you haven't pulled your hair out yet. After the 5th ship disappeared from a bug I'm about ready to fire off a random kerbalnaut to be sacrificed to the space kraken daily till these are fixed :huh: .

Link to comment
Share on other sites

Was curious if the primitive landing link and script is meant to be the same as the Hohmann link?

No it isn't. Have a screwed something up?

Yup I sure did. I'll fix it.

Sorry about that sir. It should be correct now.

Link to comment
Share on other sites

Whelp first attempt at 0.85 to see where the hangup would be at gave me an instant result.

Error on line 2 : syntax error. time to play around to see if space computer is launch capible in any 0.8x version with tweeking since the syntax got ninja changed and if the krakken bug is still there ( its the main thing that made me ragequit the mod for the time being).

well no krakken bug yet but still grrrrr ninja syntax changes drive me batty.

Edited by Kalista
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...