New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for external calls to execute code #103
Comments
Another important thing to be able to do is go the other way - allow kosscript to call other mods' APIs. I remember Nivekk had the beginnings of that, that had been used in a demo where a kos script commanded infernal robotics to rotate a hinged part. But I never saw how it was implemented. |
True, but this will have to be a totally separate effort. We have started that work with RemoteTech but it needs to get much better. In fact i would like each other mod's api calls to be split out into their own dll, this will require some dependency inversion but that shouldnt be too hard. I wish remotetech was a little healthier as a project and i could work with someone over there to figure this out. I have a few pull requests i need to send over to them. |
For the separate DLL, are you envisioning that we still are responsible for installing it on the end user's machine (It's part of our ZIP file, and the other mod should leave it out of their ZIP file?), and we're only giving a copy of it to them so their c# compiler can reference it? (And thus the other mod has to be written to be tolerant of the kos API dll being missing, since their mod can be installed on a user's machine that doesn't have KOS, and they're not installing the API DLL as part of their package ZIP.) I'm a bit concerned about actually having the other mod include our API DLL in their ZIP because of possible fighting over which one KSP ends up loading when more than one mod are installed using it on the same user's machine. If one is out of date compared to the other that could be messy. |
I imagine they would include it and we would have to make sure to always rev the DLL version, both dlls load in different paths. It is something to try out and see what works best I guess |
Is the code that utilizes the sendmessage not on Kevin's github? I know I probably still have the dll and most likey the code that implements kOS calling external methods in other dlls. It worked really well I was just no able to implement it in my end due to how IR was written. |
Hi, |
I'm currently working on an implementation for at least part of this feature. My idea is to essentially make it possible for an external dll to map a binding, an update handler, or modify/add suffixes. I think we would only require a reference to kOS.Safe (with kOS itself an option if you need to interact with KSP specific features), but I'm contemplating a separate API dll. |
We have had a request for an API to invoke a script from another module. For the first version of this feature I am going to propose a very small subset of features.
Limits:
The API might only have a few calls
bool:IsActive(<Vessel.Id>)
bool:ExecuteProgram(<Vessel.Id>,)
This might not work for everything we want to do long term but I believe getting something very simple working and going from there is a prudent course.
As far as packaging this up for consumption, Would you rather We
The text was updated successfully, but these errors were encountered: