giuliodondi / kOS-Shuttle_OPS1

kOS ascent guidance script for the Space Shuttle in KSP Realism Overhaul
9 stars 3 forks source link

Script returns error after SRB Jettison #1

Closed EclipticBanana closed 2 years ago

EclipticBanana commented 2 years ago

I have set up my shuttle according to the instructions. I am using the SpaceODY shuttle. Just after the SRBs jettison the script crashes. Trying to push NaN into stack. I have included an image of the message ingame.

It works with my STS-1 recreation, but it always crashes with my Shuttles for my ISS recreation.

image

Would you be able to offer any help?

giuliodondi commented 2 years ago

I've seen this error before and it was caused by the script not being able to measure the propellant inside the ET. The program expects to find a specifically-named ET part and measures the resources within, so the most likely explanation is that you are not using the Space Shuttle System mod, or you are mixing some parts with other mods

EclipticBanana commented 2 years ago

Thanks for the timely reply. I have solved the issue according to your response. I have added some code to shuttle.ks to allow for different ETs (the script normally only works with the standard weight tank, not the lightweight and super lightweight tanks provided with the RO configs) and engines from RO Engines (I think they look a bit better than the engines from SSS).

for i in ship:parts
{
    if i:name = "ShuttleSSME" or i:name = "ROE-RS25" {global mainEng is i:name.}
    if i:name = "ROE-AJ10-190" or i:name = "ShuttleEngineOMS" {global mainOMS is i:name.}
    if i:name = "ShuttleExtTank" or i:name = "RO.SSS.STS.LWT" or i:name = "RO.SSS.STS.SLWT" {global mainTank is i:name.}
}
giuliodondi commented 2 years ago

Thank you for your input, I hadn't noticed any problems with SpaceODY's parts, perhaps I only ever used the standard weight tank. I'll consider adapting the program to work with different set of parts