Jump to content

Kotagi

Members
  • Posts

    212
  • Joined

  • Last visited

Reputation

453 Excellent

1 Follower

Profile Information

  • Location
    Seattle, WA

Recent Profile Visitors

2,027 profile views
  1. Ive built a hoverslam script on python 3.9.1 and it works perfectly on my laptop. I copied all of my files over for a friend to try it. Its an exact identical game and mods. It has a while statement that passes while the altitude is below a certain number. When he runs the script he overshoots it like it is hanging, but there doesnt seem to be any loss of function its all just way too delayed. When I add a print statement in the loop to verify the altitude it works perfectly everytime. I cant find anything about a function only working with a print statement in it. He is running python 3.9.7 so maybe that could cause it? Would anyone else have any ideas? Me and a friend of mine moved away from eachother and we learned to code(barely) by playing this but its impossible to work together online if the scripts react different on different pc's. Kind of raining on our parade. Ive included the script. We are also playing on 1.11.1. Thank you! import math import time import krpc #shortcuts conn = krpc.connect(name='VSpeed') vessel = conn.space_center.active_vessel flight = vessel.flight control = vessel.control celestial_body = conn.space_center.bodies kerbin = celestial_body['Kerbin'] srf_frame = vessel.orbit.body.reference_frame mj = conn.mech_jeb smartass = mj.smart_ass interface = smartass.interface_mode autopilot = smartass.autopilot_mode srf_frame = vessel.orbit.body.reference_frame #constants g = 6.67300 * 10 ** -11 radar_offset = flight().surface_altitude #global variables burn_prepare_flag = 0 burn_start_flag = 0 burn_complete_flag = 0 #streams ut = conn.add_stream(getattr, conn.space_center, 'ut') altitude = conn.add_stream(getattr, vessel.flight(), 'surface_altitude') apoapsis = conn.add_stream(getattr, vessel.orbit, 'apoapsis') vertical_speed = conn.add_stream(getattr, vessel.flight(srf_frame), 'vertical_speed') gravity = g * kerbin.mass / kerbin.equatorial_radius ** 2 #main class Vessel: def launch_autopilot(self, num): # Pre-launch setup control.sas = False control.rcs = False smartass.interface_mode = smartass.interface_mode.surface smartass.autopilot_mode = smartass.autopilot_mode.surface smartass.force_pitch = True smartass.force_roll = True smartass.surface_pitch = 90 smartass.surface_roll = 0 smartass.update(False) # Countdown... print('3...') time.sleep(1) print('2...') time.sleep(1) print('1...') time.sleep(1) print('Launch!') #Activate first stage control.throttle = 1.0 control.activate_next_stage() control.toggle_action_group(4) while altitude() < num: pass vessel.control.throttle = 0 vessel.control.rcs = True print('Throttle Down') while vertical_speed() > 50: pass print('Belly Flop Manuever') smartass.surface_pitch = 0 smartass.update(False) def landing_autopilot(self): while True: global burn_prepare_flag global burn_start_flag global burn_complete_flag true_radar = altitude() - radar_offset + .1 max_decel = (vessel.available_thrust/vessel.mass) - gravity stop_dist = vertical_speed() **2 / (2* max_decel) ideal_throttle = stop_dist / true_radar impact_time = true_radar / abs(vertical_speed()) #print('Altitude ' + str(true_radar)) #print('Max Decel ' + str(max_decel)) #print('Stop Distance ' + str(stop_dist)) #print('Impact Time ' + str(impact_time)) #print('Vertical Speed: ' + str(vertical_speed())) smartass.force_pitch = True smartass.force_roll = True if burn_prepare_flag == 1: pass else: if vertical_speed() < -1 and true_radar < (stop_dist + 100): print('Preparing for Suicide Burn') control.rcs = True burn_prepare_flag = 1 else: if vertical_speed() < -1 and true_radar < (stop_dist + 300): smartass.autopilot_mode = smartass.autopilot_mode.surface_retrograde smartass.surface_roll = 0 smartass.update(False) control.toggle_action_group(5) if burn_start_flag == 1 and burn_complete_flag != 1: control.throttle = ideal_throttle elif burn_start_flag == 0 and burn_prepare_flag ==1: if true_radar < stop_dist: print('Performing Suicide Burn') burn_start_flag = 1 else: pass if altitude() < 500 and burn_start_flag == 1: smartass.autopilot_mode = smartass.autopilot_mode.surface smartass.surface_pitch = 90 smartass.surface_roll = 0 smartass.update(False) control.toggle_action_group(6) if burn_complete_flag == 1: break else: if vertical_speed() > -.01 and burn_start_flag == 1 and true_radar < 2: print('Burn Complete') control.throttle = 0 smartass.autopilot_mode = smartass.autopilot_mode.kill_rot smartass.update(False) control.toggle_action_group(2) burn_complete_flag = 1 time.sleep(3) control.rcs = False time.sleep(.01) def reset_flags(self): global burn_prepare_flag global burn_start_flag global burn_complete_flag burn_prepare_flag = 0 burn_start_flag = 0 burn_complete_flag = 0 starship = Vessel() starship.launch_autopilot(1800) starship.landing_autopilot() starship.reset_flags() starship.launch_autopilot(8000) starship.landing_autopilot() starship.reset_flags() starship.launch_autopilot(15000) starship.landing_autopilot() print('Systems Shutting Down')
  2. Thanks. Its taking alot longer than expected. Unfortunately it doesnt look like I will be able to finish this project. Hopefully I will find someone local to finish it. Im going to put it up for sale. Thank you for all the help and support while building this. If anything, I learned alot.
  3. Working on the housing for the throttle. This is the prototype right now. I am going to make it again because I didnt put enough tabs on the cut so I had some movement. But I like the design so far. I am going to sandwich some leather in between the top 2 layers and cut a slit for the throttle to pop through. Im going to paint it light grey. Im going to 2 tone the greys throughout the sim. I started with a darker grey on the panels and the accessories and bezels will all be light grey. Hopefully, everything is subject to change if I have a better idea later I also got a cover for the screens so that no light comes through and it makes a world of a difference. I was playing PUBG yesterday in it and it was pretty sweet. I adjusted the brackets on the screen and now it is a perfect fit. I also had an idea on how to maintain the ability to use a mouse and keyboard normally without having to swap components or build something that doesnt look nice just to have a flat surface. I decided Im going to use the last 2 window slots that dont have screens as hideaway tables. I will build retractable tables with hinges so that I have fold them down when I want to play normal games and fold them up with its time to use the sims controls. So I think that is the perfect solution. My cousin thought of that honestly have to give him the credit. lol
  4. Ok my shoulder is starting to get movement back and I finally got the cnc finished. Here are some pics. This is going to help drastically. Im still learning how to use it but its coming along well. Im going to cut out a throttle shroud and then wire up the joystick and throttle. So progress is starting again finally, but will be slow for awhile.
  5. I would like to right click on a part and say maybe "open stats" or "display info" or something to that effect, and have it open a full window displaying every module and what it does. Some of these mods are really hard to learn as it is, and I have found that non stock parts sometimes wont freeze their menu when right clicking, disabling my ability to scroll, making it impossible to look at the functions of that part. I hope they get something like that worked out, or a mod that will do the same thing. That would be amazing, as this is driving me crazy having to google mod parts functions every time I forget something. Thanks, let me know if anyone has ran into this problem, as I havent been able to find many complaining about this.
  6. Hey everyone, I have a question. When I right click these parts in the vab so see what they do, the menu disappears and the part selects rather than make the menu stationary so I can scroll. It seems to be only these parts. Anyone else ran into that?
  7. Was using the ip my router assigned instead of external ip. That fixed it. Thank you!
  8. This is one of my favorite mods. This tool really helped me transfer planets with any success for the first time. I hope this gets updated soon. Its like missing a hammer from your toolbox.
  9. I cannot for the life of me get this working on a different computer from the host. I subbed my local ip for the 127.0.0.1 but i get a message saying the page cannot be reached. Any ideas?
  10. @richfilesthese are taken from 2 angles with an iphone 4. 60.8 degrees horizontal by 47.5 degrees vertical Also which angle looks better? Top down or straight on? Probably wont be able to tell till i get a wide angle lens in there
  11. lol I guess that was confusing
  12. I only need 3 more meters now!
×
×
  • Create New...