KCT API - Looking for suggestions/thoughts #33
Comments
Off the top of my head, I would like to see events for PreStart/PostStart and PreEnd/PostEnd of simulations. |
Also maybe a way of getting at the rates, like the build rates, the R&D rates, etc, as well as being able to query the amount of BP something takes? |
How about events when something is added to the build list? And I don't just mean vessels, I mean techs, parts, etc. Anything programmed to take time. |
So I'll probably start adding in some basic things next major release (so, not in the update for KSP 1.0 next week). Based on feedback so far I'll definitely add:
I'm planning on a pseudo-reflection based method (maybe a full reflection based method), so your mods will include a "wrapper" style file where you can call functions which either directly call the KCT functions or call them through reflection. It won't be that pretty, since my experience is limited, but you can take a look at the StageRecovery API (wrapper class, internal API manager) since it will work in a similar way. Do you want each function to gracefully fail if you call it without KCT installed (ie, the function checks for KCT first) or do you want to HAVE to manually check for KCT first and be forced not to call any functions if KCT isn't there. Basically, do you want me to make each function check or should I rely on you all being smart? ;) E: Events will likely operate under the method that StageRecovery uses. In that, you just pass a function of your own that you want triggered when the event fires. See the StageRecoverySuccessEvent in the KCT_Events class, line 145 (maybe Github lets you link directly?) |
Also an event for when a simulation is restarted please. I need a way to know when the sim is restarted so I can reset any data gained in that sim. As for how the API works, I am not all that partial. I went overboard to make TestFlights API easy to use an robust, but I don't necessarily expect the same from others, I was just anal that way lol. In my case I will mostly just be responding to events, so a way to register a callback function is perfect. |
I posted a poll a few days ago on what the community wants me to work on next, the API is currently in the lead, so it'll be the focus of next update. Regarding simulatons, @fingerboxes is going to be releasing a mod called HoloDeck within the next few weeks that will be replacing KCT's simulations. I'm sure he'll provide an API for that as well, which TestFlight can integrate into. If, for whatever reason, HoloDeck isn't in a working state around the time that I finish the API, I'll include simulation related events in the KCT API. I too want the KCT API to be easy to use, but I might not provide quite as many ways of working with it as Test Flight :P |
Updating all my open issues and just wanted to pop in and check on this stuff. |
I'm going to implement presets probably this weekend, then afterward start work on the API. Simulations will be moving out of KCT into HoloDeck once that gets to a good enough point. With simulations being moved out of the core KCT, is there anything you still want access to? I'll likely have to release the API in stages, so if there's anything you want done first let me know. School just finished for me (but I still have work) and I believe a similar situation is true for enneract, but I expect development will kick up a bit more for both of us soon. |
I have a heavy workload at work as well :) I am actually refactoring my projects on GitHub to move to a weekend based sprint model, with major releases every two weekends if possible. We'll see how it goes. A little structure never killed anyone :) I missed the public announcement of HoloDeck so I shall go there and catch up and see if anything is missing. Thanks! |
Did anything happen with this? I'd really like to be able to figure out sim start/end events so that I can make my mod play nice with simulations. |
Simulations are being deprecated in favor of using KRASH for simulations. On Sep 10, 2016 17:22, "Sean Hederman" notifications@github.com wrote:
|
Okay, cool. Hmmm, longer term I had some plans to integrate a bit more fully, having "improvement points" which could be used to, among other things, speed up construction time in KCT. If, when I get there (which may well be never), would you be amenable to accepting a Pull Request to enable that integration? |
Sure! I really want to just rewrite KCT now that I have a better idea of On Sep 10, 2016 5:36 PM, "Sean Hederman" notifications@github.com wrote:
|
I think it's about time KCT got an API, but I don't know what people would want out of it.
This currently isn't a high priority as I don't know of anyone who needs it yet, but it should be considered while I move forward along other development paths.
Some ideas of things that should be exposed/available:
Also, should it be a separate .dll, a wrapper class, or require a hard dependency of KCT? Or a combination, with some features available in a wrapper and the majority of the features in a separate .dll that can be bundled (with KCT or with your mod?)
What do you all think should be exposed, and especially if there's anyone out there considering integration with KCT, what do you want or need exposed?
The text was updated successfully, but these errors were encountered: