Jump to content

asdfCYBER

Members
  • Posts

    225
  • Joined

  • Last visited

Reputation

69 Excellent

Profile Information

  • About me
    Spacecraft Reverse Engineer

Recent Profile Visitors

2,752 profile views
  1. Honestly? Nothing has happened since my last post. Turns out that if universities think students have more time, they'll just give more deadlines... Also modding hasn't exactly been a priority anyway. Maybe I should add another year to that calendar
  2. Quick update: university has cost more time than I originally thought. Now that I have to watch lectures from home however, I have three more hours each day I'd otherwise spend commuting, hopefully that means more modding time. Right now I'm learning how to use Harmony to change stock UI (if at all possible) - the plan B I'd rather not use is simply drawing another UI on top of the old one.
  3. Current progress: I have replaced the experiment UI. The buttons currently don't do anything (except that they all close the window), but the save button will save the data to a storage module based on module priority, and the transmit button will probably require DMagic's Science Relay mod or large sections of it (and have the data value decrease over distance based on antenna properties) in the future. Here's a picture of the old UI and my UI side by side: I will probably change the title and description to the style on the left, but I'm very happy with how it looks (especially since this is the first UI I made for KSP and had to endure a good deal of unity and textmeshpro weirdness - thanks a lot @DMagic for your UI tutorial!). One thing I'm not totally sure of is the transmit icon - I made two versions and am currently using the most stockalike, but the other might blend in better with my other new icons: Please tell me which one y'all like better Edit: there's also a github repo now, and a roadmap.
  4. I'm trying to follow DMagic's UI tutorial, and I am currently trying to get my head around interfaces - and buttons. I can call any public function with OnClick(), but I'm not sure how to send that event to the KSP assembly. What I've thought of are setting some variable to a certain value and checking every once in a while through the interface if that variable has changed, and calling a GameEvent which gets picked up by the other assembly (I'm not sure if that's possible). Would either of these methods work, or is there a better way to do this?
  5. I'd like my name changed from ExtremeTrader to asdfCYBER please, I'm neither extreme nor a trader and I use asdfCYBER everywhere now. Thanks!
  6. I'm having the exact same problem. Before I try to recreate what you did, can you confirm your assets work in KSP? (edit: I'm not making KSPedia entries but GUIs, though if one works I assume the rest does as well)
  7. Yes, I'm planning to use the science lab as a data-to-science converter. There is no need for science-to-data, instead the whole standard science system will be ignored (experiments now collect data). I'm not sure if I want the research to take time, I don't want to add too much of a grind. I might make it optional at a later stage in development, right now I'm trying to get the basis up and running (replacing the techtree will probably be the most difficult, and I need to reinvent multiple GUIs which will be very timeconsuming)
  8. After getting stuck on one very specific bit of the mod, I have now actually started doing things. That makes this mod a WIP now! So far, I implemented a partmodule that intercepts science reports and one that stores the results, next step is to make a GUI for those reports
  9. Hi all, I would like to figure out how much science something returns from a certain location if the experiment was recovered or transmitted using these objects: ScienceData data and ScienceExperiment experiment. I know that data.subjectID gives me a string experimentID@location, and experiment.baseValue and experiment.scienceCap are the base values, but I do not know how to calculate the science at a location with these. Does someone here know? (edit: of course I could test all experiments at all locations and hardcode a solution, but I'm looking for a simple algorithm or api call) edit2: probably solved, just discovered that the ResearchAndDevelopment class has a bunch of science value related methods like ResearchAndDevelopment.GetScienceValue(dataAmount, scienceSubject) edit3: So here's my next question I haven't been able to figure out: I have a confignode CONTAINED_DATA in which an unknown amount of entries (of the form subjectID:dataAmount) are stored, which looks like this: CONTAINED_DATA { atmosphereAnalysis@KerbinFlyingLowShores = 200 atmosphereAnalysis@KerbinSrfLandedLaunchPad = 200 asdf = 42 } I have been trying to get my code to add these entries to a dictionary called containedData by looping over the nodes in CONTAINED_DATA: foreach (ConfigNode dataNodeKey in dataNode.GetNodes()) { string key = dataNodeKey.ToString(); float value = float.Parse(dataNode.GetValue(key)); containedData.Add(key, value); Debug.Log(key + " was added to the dictionary"); } However, nothing gets added to this dictionary and the log mentions nothing about added keys. I have also tried looping over dataNode.nodes and returning a bunch of objects, which all seem to be empty. Here is the log with comments: [LOG 22:28:57.178] OnLoad called //the onload method is called in my partmodule [LOG 22:28:57.178] MODULE //the node is dumped to the log { name = ModuleDataContainer isEnabled = True stagingEnabled = True EVENTS { } ACTIONS { } CONTAINED_DATA //the node (called dataNode in the code) where various entries are stored, which are not known in advance { atmosphereAnalysis@KerbinFlyingLowShores = 200 atmosphereAnalysis@KerbinSrfLandedLaunchPad = 200 asdf = 42 } UPGRADESAPPLIED { } } [LOG 22:28:57.178] GetNodes: ConfigNode[] //dataNode.GetNodes().ToString() returns what seems to be an empty list of confignodes [LOG 22:28:57.178] nodes.tostring: ConfigNode+ConfigNodeList //dataNode.nodes.ToString() returns something I can't decipher [LOG 22:28:57.178] Values: System.String[] //dataNode.GetValues().ToString() returns what seems to be an empty list of strings [LOG 22:28:57.178] This really should work: 200 //directy accessing an entry does work but is not usable when entries are unknown [LOG 22:28:57.178] containedData is empty //nothing got added to the dictionary [LOG 22:28:57.178] OnLoad finished What can I loop over to add the entries to my dictionary and how? edit4: I created a workaround so that key and value are stored separately (which is a lot less practical), but I still hope there is a solution for key = value entries with unknown keys
  10. You can do this using ModuleManager (you already have it installed if you have RO+RSS). If you want to edit engines you can make a new .cfg in your gamedata folder and use this (I haven't tested it): @MODULE[ModuleEngines] { @PROPELLANT[MonoPropellant] { @name = otherMonopropGas } } for RCS, something like this should work: @MODULE[ModuleRCSFX] { @resourceName = otherMonopropGas } Of course, you need to make sure that your otherMonopropGas is actually defined in a resourcedefinition cfg somewhere, but if you change it to one of the real fuels resources you don't need to think about that. I suggest that you practice writing MM patches, they can be very useful. Some syntax explanation can be found here: https://github.com/sarbian/ModuleManager/wiki/Module-Manager-Syntax
  11. That does make sense, but it's not set as out or ref or even optional (https://kerbalspaceprogram.com/api/class_comm_net_1_1_comm_network.html#ab3c35970caed4e281ded1612770acdfe). When I try to use CommNetwork as a type visual studio mostly flips out and breaks control loops for some reason (edit: your code doesn't give errors however, not sure what happened). edit 2: threw your code in a method and found this in the log: [ERR 16:35:03.203] Module ResourceTransceiver threw during OnUpdate: System.NullReferenceException: Object reference not set to an instance of an object at CommNet.CommNetwork.FindPath (CommNet.CommNode start, CommNet.CommPath path, CommNet.CommNode end) [0x00000] in <filename unknown>:0 at ResourceBeamer.ResourceHandler.somemethod (.Vessel vessel1, .Vessel vessel2) [0x00000] in <filename unknown>:0 at ResourceBeamer.ResourceTransceiver.OnUpdate () [0x00000] in <filename unknown>:0 at Part.ModulesOnUpdate () [0x00000] in <filename unknown>:0 I'm pretty sure that's a nullref about the path being null, I don't know how to get a path though
  12. Is there a way to check if there is a CommNet path between two vessels that are not necessarily connected to Home, and get the total distance and signal strength? I can't find anything of use here in the CommNet classes and I wouldn't know how to make this myself. Edit: seems like asking this improved my chances of finding the right thing, because I think override void CommNet.CommNetwork.CreateShortestPathTree(CommNode start, CommNode end) or override bool FindPath(CommNode start, CommPath path, CommNode end) might be what I was looking for, though I don't understand how to use these (getting a path from a pathtree that is not returned? find the best path when I don't have a path? findpath returns bool instead of path?)
  13. Nothing. I feel like [KSPField()] is the way to go, but everything I try ends up in the part not being loaded . When using KSPField, OnLoad and OnSave should not be necessary so I will try removing those. I tried adding [KSPModule("Resource Transceiver")] too, but that did not do anything about the error. Edit: I commented out OnLoad and OnSave, now everything outputs LiquidFuel as it should, and it shows up in the .craft file too. Thanks for the help!
×
×
  • Create New...