Jump to content

Krazy1

Members
  • Posts

    957
  • Joined

  • Last visited

Everything posted by Krazy1

  1. Nice. It sounds like I found the same function "partListSorter.ClickButton" (didn't check your code). I've been fumbling around with it... I'm doing it a bit different though. I wasn't going to have any GUI or options. It will just save the setting directly. There are a few other settings I want it to store too.
  2. The guide was clear about using config nodes in ScenarioModule. Gee, I didn't think about using both KSPAddon and ScenarioModule. One very minor issue with data saved in the savegame: if you remove the mod, say to debug mod interactions , the KSP.log will show new errors because there is data left in the savegame and there's nothing using it. Anyway, I have better options than what I was doing before. Yes - it's great. I have a ship going to Moho. Just aimed for the bullseye and I was lined up for an intercept. Your code has comments! So many comments. Wow.
  3. Thanks again. Very helpful. Yeah, that's the idea. I'm not too surprised it worked like you described. I wish I had a better way to test it. Maybe command line builds would help in some cases. It's slow loading/ exiting KSP every iteration. OK - parsing data isn't much fun. Maybe I'll come back to learn how to do it myself but right now I'd much prefer to have it working. Can I still use the Unity hook KSPAddon? The Getting Started thread says: "Note: There is no integrated save/loading of data in the KSPAddon hook, you must do that manually." I inferred that "manually" meant there was no built-in method at all.
  4. OK so I got the basic function working in the game to sort parts by something other than "name". It just mimics pressing the button like you would do with the mouse. I can't get to read the state but that's a problem for later. Now I'm trying read the setting from a text file. I'm just trying to read this tiny file it's not been easy so far: partListSortAsc, True partListSortIndex, 1 And the .cs (sorry about all the comments) And excerpt from the KSP log: [LOG 18:20:12.474] ------------------- initializing editor mode... ------------------ [LOG 18:20:12.474] editor started [LOG 18:20:12.485] Loading Depletion Nodes [LOG 18:20:12.485] DepNodeCount: 0 [LOG 18:20:12.485] Loading Biome Nodes [LOG 18:20:12.485] BiomeNodeCount: 0 [LOG 18:20:12.485] Loading Planet Nodes [LOG 18:20:12.485] PlanetNodeCount: 0 [LOG 18:20:12.487] [ScenarioDestructibles]: Loading... 0 objects registered [LOG 18:20:12.487] [ScenarioUpgradeableFacilities]: Loading... 0 objects registered [LOG 18:20:12.598] RememEditor Start 6202.018 [LOG 18:20:12.598] RememEditor Start File Path: C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\_Local\Rememberer.txt [LOG 18:20:12.599] RememEditor Start dict System.Collections.Generic.Dictionary`2[System.String,System.String] [EXC 18:20:12.603] KeyNotFoundException: The given key was not present in the dictionary. System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <ad04dee02e7e4a85a1299c7ee81c79f6>:0) Rememberer.RememEditor.Start () (at <c2786458e8db4538ba8ce3cf296b4868>:0) It has the right file path but the data for "dict" is garbage. I got the lambda function part here (without really understanding it): https://stackoverflow.com/questions/11581101/c-sharp-convert-liststring-to-dictionarystring-string
  5. IFAIK the only stock resource container that has a "jettison" button on the PAW are on the ore tanks. I can't "jettison" EC. This feature predates Squad making the drain valve a stock part. So now the jettison button on the ore tank is redundant (could use a drain valve) but they left in the game just to give you a headache now. I guess it uses a completely different method to jettison vs. drain the ore resource.
  6. I'm not using a drain valve. I used the "Jettison Tank Contents" in the tank PAW.
  7. However... with Recall 0.0.7.7 when jettisoning ore from a stock ore tank, it does jettison "refunding". screenshot
  8. Thanks @HebaruSan That worked. I didn't notice you removed the "new" but I figured that out because it's a Static. So next task is to write new values but I'm afraid that won't work because the constructor (?) has no "set" public static EditorPartList Instance { get; } But it's not Readonly. I'm not sure. I'll try it.
  9. So I got the "hello world" code working and the next step seems like a brick wall right now. I'm trying to learn more C# ("this" and constructors and delegates and why use a Class instead of a Struct). The KSP API documentation is nothing but a list - no explanation of what anything does. I'm trying to read the state of the editor part list sorter: name/ mass/ cost/ size. This compiles but gives NREs. using UnityEngine; namespace Rememberer { [KSPAddon(KSPAddon.Startup.EditorAny, false)] public class RememEditor : MonoBehaviour { public void Start() { //Debug.Log("Editor Start " + Time.realtimeSinceStartup); bool partListSortAscStart = new KSP.UI.Screens.EditorPartList().partListSorter.startSortingAsc; Debug.Log("Editor Start: Part List Sort Asc = " + partListSortAscStart); int partListSortIndexStart = new KSP.UI.Screens.EditorPartList().partListSorter.StartSortingIndex; Debug.Log("Editor Start: Part List Sort Index = " + partListSortIndexStart); } public void OnDisable() { //Debug.Log("Editor OnDisable " + Time.realtimeSinceStartup); bool partListSortAscOnDisable = new KSP.UI.Screens.EditorPartList().partListSorter.startSortingAsc; Debug.Log("Editor Disable: Part List Sort Asc = " + partListSortAscOnDisable); int partListSortIndexOnDisable = new KSP.UI.Screens.EditorPartList().partListSorter.StartSortingIndex; Debug.Log("Editor Disable: Part List Sort Index = " + partListSortIndexOnDisable); } } } Note that this part: ".EditorPartList().partListSorter." without the "()" gives an editor error - partListSorter is not a part of EditorPartList. I don't really understand that. Any help appreciated!
  10. Yes, since 1.11.1. In the lower left when in construction mode (press "i") it shows the mass limit depending on gravity and number of kerbals helping. But parts you're able to manipulate is always limited to smaller parts, even in space.
  11. Sorry, I was lazy and waited for the CKAN 0.0.7.7 release. I removed the MM patch for 0.0.7.5 BTW. I got about 200 NREs on parts on the first load. I just went to the main menu and exited. Example: I didn't see a pattern of why some parts had this error and some did not. I tried again and it did the same thing. KSP log It passed the sanity check... UPDATE: I just ignored the errors and everything seems OK. vOv
  12. Thanks for all the good info. Wow. Is this a game or a virus? I work in aerospace IRL and devs have to meet DO-178 standard. I doubt they'd let this fly.
  13. So I'm trying to get started here. I took CS101 with C++ >20 years ago so bare with me. Maybe this will help someone else too. I got VS Community 2019 installed... figured out I need dotnet workload, not just C# alone. I also installed the Unity plugin. I got passed that. I'm trying to follow this guide. I realize it's outdated and I'm targeting the default dotnet 4.7.2 which should work for KSP 1.8+ according to 1.8 modder notes First issue was I needed to reference UnityEngine.CoreModule.dll because the editor told me MonoBehaviour moved there. I did that. Looks like this now. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; namespace HelloWorld { [KSPAddon(KSPAddon.Startup.MainMenu, false)] public class Hello : MonoBehaviour { public void Update() { Debug.Log("Hello world! " + Time.realtimeSinceStartup); } } } I didn't try it yet - I want to understand it first... Why does it need "using UnityEngine" to define MonoBehaviour? Why doesn't "using UnityEngine.CoreModule" work? There's no CoreModule in UnityEngine namespace - OK. I need to reference UnityEngine.CoreModule.dll but don't need UnityEngine.dll. Why aren't the "using" and DLL references simply the same? How does KSPAddon know what to run? Well, it's not a function - it's an attribute... need to study that. Also, there's no explicit call to Update() so why does it run? and why would it run repeatedly? I don't see the flow control. I'm looking for something like: while(KSPAddon.Startup.MainMenu()) { Hello.Update(); }
  14. Right - that was me. And the patch you provided was and is still working. I figured out the issue I saw - no problem. The long story- I saved a craft with 2 Ant engines in cargo not stacked, then later applied the MM patch, then reloaded the craft and tried to stack those 2 Ants... that didn't work. So I just removed them and replaced with "fresh" Ants and they do stack. Makes sense now.
  15. That's a relief. One craft had "refund" 171 times Well, I was having problems with stackable parts not stacking in cargo storage again. I'll try to see why the patch wasn't working now.
  16. Just removed 0.0.7.5 and then loaded a ship in VAB and it's spamming the KSP log: I'm manually removing dozens of these in a few recent .craft files: Hope that fixes them.
  17. Intro The KSP Administration has decided to save money by eliminating all spaceship construction. They fired all the VAB and SPH workers and tried to outsource all manufacturing. Unfortunately, every other space agency did the same thing. That didn't stop our intrepid kerbonauts. They got access to the part storage facility and Bill will use his EVA construction skills to build everything right on the launch pad. General The main goal is to perform the challenges with minimum total packed cargo volume. You can brag about cost, mass, parts count, doing extra stuff but that’s secondary. Use KSP 1.11.2+ because 1.11.0/1 are horrendously buggy in EVAC. Any game mode is OK but suggest Sandbox with “show ground crew” turned off for realism. No mods. You won't miss them much for this. Stock + DLC only. Pack the required cargo containers (varies with specific challenge) with parts you will use to build the ship. Attach (4) EAS-1 seats to the containers to bring the (4) kerbals to the KSC launch pad. Using the Kerbals’ 2 cargo slots is acceptable but parts must be included in the packed volume sum. The 4 EAS-1 seats do NOT count in total volume. The seats may be moved and used on the ship. You may launch from on top of the storage containers, not stacked more than 3 high, or directly on the pad. If you use a decoupler to launch, it must be in a container when brought to the pad and counted in the total packed volume. You must be able to use EVA construction to build your ship, but you can do it last if you prefer. Let me explain. Designing a ship and test launching can take several iterations and it is much more difficult to make changes in EVAC because it requires removing/ installing one part at a time. That’s not fun. So you can build the ship in the VAB, launch and complete the mission and then go back to the pad to build it the same way to prove it is possible. But be careful! You must be able to build it in every detail, like: 1. Parts must all be able to be lifted by 4 Kerbals at 1 Gee (unless more kerbals are allowed in the specific challenge). 2. Parts must be in EVAC range, including necessary helpers to lift. 3. Kerbal must be able to get to their seat for launch. 4. If you need to climb the side of the ship that’s OK but explain how you do it and include any ladders used in the cargo volume. 5. The ship must not tip over or break at any step in the build process. Remember you can only place 1 part at a time in EVAC. Bronze Pack one SEQ-24 with parts. Build an unmanned rocket and launch it into orbit (PE >= 70 km) and land it safely (at least touch down under 10 m/s and the probe core must survive). I have done this. Silver Pack two SEQ-24 containers. Get a Kerbal to orbit and land him/her safely (at least alive and touch down under 10 m/s). I did it but it took several attempts. Gold Pack any quantity of the 4 SEQ-xx cargo containers. Get 2 Kerbals to orbit, build a satellite and land the Kerbals safely. Satellite must have a probe core, battery, solar panel, HG-5 relay antenna and a magnetometer. All of the satellite parts must be in SEQ container(s) on the ship when it launches off the pad. I have not attempted this. Science Jr. Pack any quantity of the 4 SEQ-xx cargo containers. Get 3 Kerbals to orbit, build a satellite and land the Kerbals safely. Satellite must have a probe core, battery, solar panel, any antenna and a SC-9001 Science Jr. All of the satellite parts must be in SEQ container(s) on the ship when it launches off the pad. I have not attempted this. SSTO Pack any quantity of the 4 SEQ-xx cargo containers. Launch 4 kerbals to orbit and land everything together - no parts lost. You may bring as many helper Kerbals to the pad as you like. I have not attempted this. SSTO - Ghost Pack any quantity of the 4 SEQ-xx cargo containers but choose wisely… you must take them with you! Launch 4 kerbals with all of the cargo containers into orbit and land everything together. You may bring as many helper Kerbals to the pad as you like. You’ll need a bus or something for the helpers. This one is probably impossible. Things to consider: Those big Kerbal heads have very high drag at transonic speed and can cause your ship to become unstable. Kerbals explode at only 800 deg. K. If the pilot is not facing forward, SAS won’t aim correctly. There’s no “control point up” for a command seat. If you forget you're in EVAC instead of the VAB and drop a fuel tank, it will explode. Save often! This is my first challenge - I won't have badges unless someone wants to make them.
  18. IMO turning off the contract penalty is not cheating; it's a bug workaround. I'm annoyed by all the Eve contracts I'm getting. I've got 84% rep doing Kerbin SOI stuff and unlocked the tech tree, now ALL of the interplanetary missions are to Eve. Why? In the last 30 contracts offered I probably got 8 to Eve and the rest around Kerbin. I'm nowhere close to an Eve launch window. I would be OK with completely random contracts to all locations.
  19. Excuse me, but it seems the moderator has condoned breaking the rules of this challenge which do not allow any type of heat shields.
  20. Sorry I missed your reply. Well, I haven't had any more issues (I recall) and changed to 1.11.2. Seems moot now. \/O\/ thanks anyway. Off topic...physics warp help:
  21. Works for me in 1.11.2. Much better than stock. Also recommend AFBW for joystick calibration.
  22. It's working for me now in 1.11.2. Thanks! It's like 20x faster than stock opening the menu.
  23. I have a few ideas for mods but I suppose I should just figure out how to do some easier ones myself. I'm annoyed by the default alphabetical arrangement of parts in the editor. I always change it to mass ascending order. So I want it to default to that. Or remember the last setting. That's it! Gotta start somewhere. Would this actually be easy?
  24. Sorry to bother but what compatibility level? I have "compatible game versions" set to 1.7 to 1.11. I only see the old [x]science! version 5.26.
  25. I suppose. I skimmed the change logs for 1.9, 1.10 and 1.11 and didn't see anything about this.
×
×
  • Create New...