Jump to content

rhoark

Members
  • Posts

    526
  • Joined

  • Last visited

Posts posted by rhoark

  1. I once made a probe core survive landing on the Mun with no engines fired after deorbiting from a 5km equatorial orbit. Basically, it was surrounded with a huge crumple structure made of struts and landing legs. It didn't stay landed, though. The probe core and a big cloud of debris bounced out to a high elliptical Kerbin orbit.

  2. Information about this seems to be in bits and scraps, and it would be really nice to have the options spelled out. I don't see any core temperature variable documented on Part, so is it up to a PartModule to store that state? Is there an internal counterpart to AddThermalFlux(..)? Or do I set part.thermalInternalFlux directly? Is part.thermalInternalFluxPrevious a way to read the influence of the environment on the core? Or do those interactions simply not happen outside PartModule logic?

  3. Thanks Starwaster (et al). What would you think about supporting multiple skins on a part (eg, dorsal/ventral)?

    I figure this could be done with multiple instances of ModuleAeroReentry on a part. It would just need each instance to carry a vector and maximum deflection to check against in _GetBodyArea and _GetSunArea and a new _GetAirstreamArea in similar fashion. Also scale part.exposedArea and part.radiativeArea by maxDeflection/360.

  4. Getting closer - I now have a landed kerbal. However, it doesn't seem to actually initialize gender, trait, or personality from the provided ProtoCrewMember.

    Here's what I'm doing:

    uint LetThereBeKerbal(ProtoCrewMember protocrew) {
    var body = vessel.mainBody;
    var flight = ShipConstruction.GetUniqueFlightID(HighLogic.CurrentGame.flightState);
    var crew = new ProtoCrewMember[1];
    crew[0] = protocrew;
    var parts = new ConfigNode[1];
    parts[0] = ProtoVessel.CreatePartNode("kerbalEVA", flight, crew);
    var extra = new ConfigNode[0];
    var orbit = Orbit.CreateRandomOrbitAround(body);
    var vesselConfig = ProtoVessel.CreateVesselNode(protocrew.name, VesselType.EVA, orbit, 0, parts, extra);
    var position = part.transform.position;
    position += (position-body.position).normalized * 5.0;
    vesselConfig.SetValue("sit", Vessel.Situations.LANDED.ToString());
    vesselConfig.SetValue("landed", true.ToString());
    vesselConfig.SetValue("lat", (body.GetLatitude(position)).ToString());
    vesselConfig.SetValue("lon", (body.GetLongitude(position)).ToString());
    vesselConfig.SetValue("alt", (body.GetAltitude(position)).ToString());
    var protoVessel = HighLogic.CurrentGame.AddVessel(vesselConfig);
    return flight;
    }

  5. I'm trying to put a kerbal in the world given a ProtoCrewMember. Doing some cargo cult programming looking at what ContractConfigurator does, I came up with this:


    ProtoCrewMember protocrew = [etc...]
    var flight = ShipConstruction.GetUniqueFlightID(HighLogic.CurrentGame.flightState);
    var crew = new ProtoCrewMember[1];
    crew[0] = protocrew;
    var parts = new ConfigNode[1];
    parts[0] = ProtoVessel.CreatePartNode("kerbalEVA", flight, crew);
    var nothing = new ConfigNode[0];
    var orbit = new Orbit(0,0,0,0,0,0,0,vessel.mainBody);
    var position = vessel.GetWorldPos3D();
    orbit.UpdateFromStateVectors(position, vessel.mainBody.getRFrmVel(position), vessel.mainBody, Planetarium.GetUniversalTime());
    var vesselConfig = ProtoVessel.CreateVesselNode(protocrew.name, VesselType.EVA, orbit, 0, parts, nothing);
    var protoVessel = HighLogic.CurrentGame.AddVessel(vesselConfig);

    Trying this from the launchpad, the result is always a message in the log "Vessel Jebediah Kerman crashed through terrain on Kerbin". I'm guessing that means something is wrong with the orbit I'm providing, or the position it is based on, but I don't see how that could be since they're constructed based on a vessel not crashing through terrain.

×
×
  • Create New...