Jump to content

xEvilReeperx

Members
  • Posts

    894
  • Joined

  • Last visited

Everything posted by xEvilReeperx

  1. You recognize how hypocritical this is, right? His plugin was released precisely because people have trouble editing config files. And here you are criticizing him for not having a UI in his user-opted-in-so-why-does-it-need-a-ui addon while defending your UI-less, "must edit config to opt out", might-be-unintentionally-installed self-replicating plugin. I don't care if you're planning a UI now after community backlash, until/if it's done is when it counts.
  2. We must not be reading the same posts I think the real cheery on top in there is the anger about the lack of information or UI for the user though. Either trolling or there's quite a lot of anger in that paragraph
  3. Yes, I can add this It could be done but it's a little too close to automation for me. I'm sure something like this exists already though
  4. Yep, been working on it. Today sometime. Figuring out the new toolbar took a little longer than expected and I ran out of time to work on it yesterday
  5. It actually sounds like it's working as intended. If you have SCANsat integration enabled, ScienceAlert won't alert you about biome-dependent experiments if you don't have the experiment area's biome scanned yet. That said, I haven't tested ScienceAlert against SCANsat in 0.24 and I'm still updating (taking the opportunity to refactor a bit) so it's possible something broke. I'll check it out
  6. There isn't any technical reason why it shouldn't. I'm working on a 0.24 release as we speak though (doing a little refactoring) which should be out in a few hours or so
  7. RDNodes are the actual GOs that make up the tech tree. Is that what you're after? They only exist if the R&D window is open. Luckily there's an event that lets you know when that's about to happen, so you can use this: [KSPAddon(KSPAddon.Startup.SpaceCentre, false)] public class UbioCountNodes : MonoBehaviour { void Start() { GameEvents.onGUIRnDComplexSpawn.Add(() => StartCoroutine(CountNodes())); } System.Collections.IEnumerator CountNodes() { yield return null; Debug.Log("Counting RD nodes ..."); var nodes = GameObject.FindObjectsOfType<RDNode>(); if (nodes == null || nodes.Length == 0) { Debug.LogError("No RDnodes found!"); } else Debug.Log("Found " + nodes.Length + " RD nodes!"); } } If you're instead trying to find out what the state of the player's tech tree is, you want to be working with ResearchAndDevelopment.PartTechAvailable/PartModelPurchased etc
  8. Watching that part of the video with you doing the EVA report shuffle is exactly the situation that led to me Alt+F4ing and starting work on ScienceAlert. No exaggeration. If you don't mind mods, it will at least make science less tedious and frustrating, although not more engaging.
  9. No, it returns the right value. There are a couple of less obvious things to watch out for. First, are you getting the subject correctly? If you're using just ScienceUtil.GetExperimentBiome to get the biome, that won't work if the vessel is landed on a static object like the launchpad, sph, runway, or other non-biomes that still qualify as valid locations. Second, when are you testing the value? I say this because I spent at least 10 minutes trying to figure out why the values printed in my Start (or Awake? I forget which now) method were wrong while on the launchpad when first writing ScienceAlert. If the vessel hasn't been placed to pad yet, you might get a bogus result. Here is a snippet you can test. In a game without a crewReport recovered yet, launch a command pod. Check value while on launchpad var vessel = FlightGlobals.ActiveVessel; var situation = ScienceUtil.GetExperimentSituation(vessel); var experiment = ResearchAndDevelopment.GetExperiment("crewReport"); string biome = string.Empty; if (experiment.BiomeIsRelevantWhile(situation)) biome = vessel.landedAt != string.Empty ? vessel.landedAt : ScienceUtil.GetExperimentBiome(vessel.mainBody, vessel.latitude, vessel.longitude); var subject = ResearchAndDevelopment.GetExperimentSubject(experiment, situation, vessel.mainBody, biome); float scienceValue = ResearchAndDevelopment.GetScienceValue(experiment.baseValue * experiment.dataScale, subject); Log.Write("Science Value of crewReport: {0}", scienceValue); I get this: Now recover the pod. Launch another pod check results again. I get this: If you just want to see if the player has gathered any science for that experiment + situation + biome combination at all, it's just a simple subject.science > 0 check
  10. I tried both a raycast method and the (what sounded like to me) crazy move-the-collider-under-you method. I had a hard time getting the right amount of force with the first method but the second method turned out surprisingly well... public class OceanTest : MonoBehaviour { void Start() { FlightGlobals.ActiveVessel.rootPart.AddModule("ModuleWaterSlider"); } } public class ModuleWaterSlider : PartModule { GameObject _collider = new GameObject("ModuleWaterSlider.Collider", typeof(BoxCollider), typeof(Rigidbody)); float triggerDistance = 50f; // avoid moving every frame void Start() { Log.Write("WaterSlider start"); var box = _collider.collider as BoxCollider; box.size = new Vector3(200f, 5f, 200f); // probably should encapsulate other colliders in real code var rb = _collider.rigidbody; rb.isKinematic = true; _collider.SetActive(true); var visible = GameObject.CreatePrimitive(PrimitiveType.Cube); visible.transform.parent = _collider.transform; visible.transform.localScale = box.size; visible.renderer.enabled = false; // enable to see collider // Debug stuff Action<Vector3, Color> createAxis = delegate(Vector3 axis, Color c) { var go = new GameObject(); go.transform.parent = _collider.transform; go.transform.position = _collider.transform.position + axis * 25f; var line = DebugVisualizer.Line(new List<Transform> { go.transform, _collider.transform }, 0.2f, 0.1f); line.renderer.material = ResourceUtil.LocateMaterial("DebugTools.XrayShader.shader", "Particles/Additive"); line.renderer.material.color = c; }; createAxis(Vector3.up, Color.red); createAxis(Vector3.right, Color.blue); createAxis(Vector3.forward, Color.green); UpdatePosition(); } void UpdatePosition() { Log.Write("Moving plane"); var oceanNormal = part.vessel.mainBody.GetSurfaceNVector(vessel.latitude, vessel.longitude); _collider.rigidbody.position = (vessel.ReferenceTransform.position - oceanNormal * (FlightGlobals.getAltitudeAtPos(vessel.ReferenceTransform.position) + 2.6f)); _collider.rigidbody.rotation = Quaternion.LookRotation(oceanNormal) * Quaternion.AngleAxis(90f, Vector3.right); } void FixedUpdate() { if (Vector3.Distance(_collider.transform.position, vessel.ReferenceTransform.position) > triggerDistance) UpdatePosition(); } }[KSPAddon(KSPAddon.Startup.Flight, false)] So it could be made to work
  11. This might help you, then (post with fbx download) (post with obj download)
  12. I meant that you can access the mesh data with a plugin. The problem is that it's probably not permissible to distribute it if you do export it to disk.
  13. There is (with a plugin) but it's probably against the EULA to just tear out the model and post it online. You could model your own or have a plugin swap in the model for you at runtime
  14. ScienceAlert uses the following (experiment being a simple ResearchAndDevelopment.GetExperiment(expid)): float CalculateNextReportValue(ScienceSubject subject, List<ScienceData> stored) { if (stored.Count == 0) return ResearchAndDevelopment.GetScienceValue(experiment.baseValue * experiment.dataScale, subject); float experimentValue = ResearchAndDevelopment.GetNextScienceValue(experiment.baseValue * experiment.dataScale, subject); if (stored.Count == 1) return experimentValue; // for two or more, we'll have to estimate. Presumably there's some // kind of interpolation going on. I've found that just dividing the previous // value by four is a good estimate. return experimentValue / Mathf.Pow(4f, stored.Count - 1); } As to the second question, I think a couple of DMagic's experiments change the results dialog callbacks and do the dialog display on their own. That'd be a great place to start
  15. You've seen ScienceAlert, right? If you don't mind mods, it takes a lot of frustration out of the game (in my opinion). ScienceAlert now has this option if you have SCANsat installed
  16. Is that with the recently released version (1.6)? What's the full stack trace? Vessel storage should never be null unless something broke in initialization. Are there any messages or exceptions that occur right after a scene change into flight related to ScienceAlert?
  17. Hi, thanks for your feedback. As you've discovered, showing the current state of every experiment takes up a lot of real estate. If you have a vision of what you'd like to see, I'd gladly consider it. Thanks for checking out the mod
  18. Your plugin is never loaded because it uses System.Diagnostics.Process, which is blacklisted (could be used for evil). Unity has the Application.LoadURL method that you can use instead
  19. Which alert? Chances are good you're missing an EVA report from the LaunchPad. When your vessel is ready to be launched, it's considered "landed" but when you first hop out on EVA and are holding onto a ladder, the Kerbal looks as if it's flying instead which is a different set of conditions. Go for a walk on the launchpad and see if the alert reappears. If it does, do the eva report and then recover your Kerbal. You should no longer be alerted for that particular combination after that. If that doesn't work, post back and we'll track it down
  20. Are you absolutely certain? Could you have a older export in the zip? Here's what I get with a little debug test: var pT = DebugVisualizer.Point(part.transform, 0.25f); var modelT = DebugVisualizer.Point(part.transform.FindChild("model"), 0.25f); var cylT = DebugVisualizer.Point(part.FindModelTransform("Cylinder_002"), 0.25f); pT.renderer.material = modelT.renderer.material = cylT.renderer.material = ResourceTools.ResourceUtil.LocateMaterial("DebugTools.XrayShader.shader"); pT.renderer.material.color = Color.red; modelT.renderer.material.color = Color.blue; cylT.renderer.material.color = Color.green; Log.Write("Finished adding debug spheres");Part part = FlightGlobals.ActiveVessel.parts.Find(p => p.partInfo.name == "GundamBeamSaber"); So, Part top-level GameObject in red, model transform in blue, and the point my previous snippet will find in green: No question that in the model provided in the zip the MeshRenderers and MeshColliders are displaced. Maybe you intended it to export this way? But then why make it radial-attachable if you only want it to attach at a single point? Hmmm
  21. Your Unity GameObject seems to be displaced slightly from the actual meshes. Make sure you zero out its position (and center the meshes again) before you export it. It looks like philotical was on the right track to figuring it out though: swordTransform = this.part.transform; //swordTransform = this.part.transform.Find("Cylinder.002"); //swordTransform = this.part.transform.Find("GundamBeamSaber"); So close It should work with the existing model with this little change: swordTransform = part.FindModelTransform("Cylinder_002");
  22. Yes, I hope so. I was never able to reproduce it myself though so I can't be certain. If it stops reporting again at any point, let me know
  23. 1.6 is now out, with optional SCANsat support! Let me know if anything breaks.
×
×
  • Create New...