Jump to content

churai

Members
  • Posts

    4
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. http://images.akamai.steamusercontent.com/ugc/261587080052112509/41043718AE0DC21A2698F1F55DE606692DD38E8F/ The Sun's model seems to be smaller than it's collision model .. or it's perpetually placed under rockets in the sun atmosphere scene? When my "ship" got close to the surface of the sun my autopilot using krpc seemed to think up was changing a lot... or I was really close to the center to the planet?
  2. Hey guys -- not sure if this is in the right area so appologies in advance if it isn't: Xenon is slow and it consumes all active fuel tanks while running so I thought I'd give krpc a go to asparagus stage my tanks (spaceprobe below). I got the tank removal once they're empty working but since I've disabled all tanks for staging I am now struggling to enable them. Here is the code I am using at the moment: import krpc, operator # generic setup conn = krpc.connect(name='xenondump') vessel = conn.space_center.active_vessel tanks = {} # autopilot pointing prograde ap = vessel.auto_pilot ap.reference_frame = vessel.orbital_reference_frame ap.engage() ap.target_direction = (0,1,0) # gets list of remaining xenon tanks def gettank(): stack = [(vessel.parts.root, 0)] while len(stack) > 0: part,depth = stack.pop() if part.name == 'xenonTankLarge': tanks[part] = depth for child in part.children: stack.append((child, depth+1)) # enable next tank def nexttank(): exiter = 0 for tank in tanks: if tanks[tank] == max(tanks.values()) and exiter == 0: print('enable new tank here') exiter = 1 def removeemptytank(): for decoupler in vessel.parts.decouplers: if decoupler.part.children[0].mass - decoupler.part.children[0].massless == 412.4999940395355: decoupler.decouple() nexttank() # main loop while True: gettank() removeemptytank() ap.wait() At "print('enable new tank here')" I am trying to run something like tank.resources.enabled = True but I have no idea. (https://krpc.github.io/krpc/python/api/space-center/resources.html) Again, sorry if this is in the wrong place -- any hints would be greatly appreciated!
×
×
  • Create New...