Jump to content

Kotagi

Members
  • Posts

    212
  • Joined

  • Last visited

Everything posted by Kotagi

  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!
  13. I also ordered everything for the ox cnc machine. The parts are coming from literally all over the world so its going to take awhile to get everything. I will update once I have some progress of that as well. Lastly..a good fried of mine loves Warhammer. He has all of the super expensive model sets that look out of this world. But ive seen them when he gets them, and they are just halved gray plastic shapes basically. The paint he puts on these things are epic. unfortunately he lives 2000 miles away.Anyways, getting side tracked, I thought about going to a warhammer tourney and seeing of anyone would want to help me paint the interior of the sim in exchange for a good smoke session and bbq or something. I will feature them on here if anyone helps, but I was just thinking if I can get that level of detail painting inside this, It will really bring it all together. Like dirt, wear and tear, imperfections, and all the little things. I consider the paint of the sim now as a primer. So anyway. I need to stop typing now
  14. So the reason I havent posted anything is that i had pretty major surgery of my shoulder and using my arm is almost impossible for right now. It will take 2-8 months to recover, barring any setbacks. Luckily most of the major work is done(in the front 2 sections) Ive broke the electronics down into 3 separate categories, each with 2 phases that need implementing. The 3 categories are: 1- Meters- PWM Output(https://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overview) 2-Buttons/Switches - GPIO IN (https://www.abelectronics.co.uk/p/54/IO-Pi-Plus) 3-Segment Displays/Indicator Lights- PWM Output(The reason I am using a pwm board instead of a gpio board is that the pwm boards can be chained together to give a total of 992 outputs. The gpio boards cannot be chained so I went with the pwm board) When I said that there are 2 phases per category, they are as follows Phase 1- Verify functionality of circuit/ Establish total room for expansion Phase 2- Scale circuit to desired scale(Basically replicating) Typing is painful and takes forever so I apologiize now if it takes time to reply As of now, I have completed phase 1 of the meters. Im wating of some circuit boards to come in the mail to start phase 1 on the other 2. I wont start phase 2 until phase 1 is totaly complete, So i dont run into capacity problems
  15. Ya those definitely look like they can work
  16. Any suggestions for helmet/third person webcam? I want to helmet cam to resemble my vision(go pro maybe?), and the third person to be just a regular view. Not sure what angle I want them to be at though. It would be cool if I could get one wide enough to get both pilot seats in one shot, but Im not sure that will happen.
  17. http://www.openbuilds.com/threads/ox-metal-cnc-router-mill.7218/ Im in the process of ordering all the parts for this. Im going to try to use this to make the rest of the panels
  18. That really sucks man. I hope you get that figured out
  19. I used the windows screen alignment. I figured out that only rule is that each screen must be touching another screen. When I was trying with just 3 flight screens, I couldnt add the bezel without breaking that rule. When I added the 2 bottom dash screens, I placed them in between and below the top flight screens, which allows me to use them as a sort of chain link. I hope that made sense. Next time I have it all setup I will take a screenshot if I remember
  20. Well I figured out how to add space for the bezel without third party software. I have 3 screens on top and 2 on bottom so I used a chain method with just the regular multi-monitor setup windows comes with. It seems the only rules are that the screen has to be touching another screen. So I used my bottom screens as links. It worked perfect. Here is a video of the final product. Thank you for trying to test it. https://vid.me/mH8D
  21. So here is a video of the screen after I compensated for the bezel. This is the final product. I dont believe I can get any better than this.. https://vid.me/mH8D
×
×
  • Create New...