Jump to content

[WIP] Selene - Lua based autopilot & general purpose scripting layer for KSP


BlackNecro

Recommended Posts

Ah ok. Thanks.

So I could use Remote Tech 2's API methods like this: ?


RTech = luanet.import_type('RemoteTech.API')
local guid = myVessel.getGuid() // No idea how to get guid yet
local x = RTech.HasFlightComputer(guid)
// ...

I'm away from home so I can't actually start playing around with it yet otherwise I'd try before asking.

I'd assume so, I haven't tried interfacing with any mods. You might have to import the mod or namespace into your code e.g. http://penlight.luaforge.net/project-pages/penlight/packages/LuaInterface/

Link to comment
Share on other sites

Hi, I tried to test Selene. So I downloaded the ZIP of the testing and in-dev branch and extracted them into the GameData directory. The result is, that I'm able to add the unit to my craft and the Toolbar allows me to make it visible, but it doesn't show up anyway.

Now back at my computer and I too have this problem. In the list of available toolbars Selene has three question marks ??? instead of an icon. No way to access the functionality of the mod.

All the mods that use the toolbar plugin use ToolbarManager.Instance.add - I can't find any reference to Toolbar or ToolbarManager in the Selene source on github.

Edited by OminousPenguin
Link to comment
Share on other sites

  • 2 months later...
Umm... something is still wrong...

Failed to load assembly E:\Kerbal Space Program v0.23\GameData\Selene\KopiLua.dll:
System.Security.SecurityException: Assembly E:\Kerbal Space Program v0.23\GameData\Selene\KopiLua.dll tried to use forbidden type System.Diagnostics.Process!
Allows launching of external processes.

at AssemblyLoader.ScanForBadTypeRefs (System.String file) [0x00000] in <filename unknown>:0

at AssemblyLoader.LoadExternalAssembly (System.String file) [0x00000] in <filename unknown>:0

...
...

Type wasn't correct

Type wasn't Params object.

Type wasn't correct

Type wasn't Params object.

Part seleneStack_4294476404 cannot load module #2. It only has 2 modules defined

I checked the Alt+F12 -> Database -> Assemblies.

There're:

KeraLua, NLua, SeleneCore, SeleneKSP. But I cannot find KopiLua.

Ah the joys of getting WIP stuff up running on any other machine but my own. I tried getting it to work with a vanilla installation, fixed two or three things and it _should_ be working now :D

Redownload Rinse Repeat

How did you fix this? I am writing my own plugin where I use some code that uses System.Diagnostics.Process, and it is giving me the same "tried to use forbidden type System.Diagnostics.Process!" error when trying to load my plugin.

Link to comment
Share on other sites

How did you fix this? I am writing my own plugin where I use some code that uses System.Diagnostics.Process, and it is giving me the same "tried to use forbidden type System.Diagnostics.Process!" error when trying to load my plugin.

No problem to fix there.

The AssemblyLoader is just the plugin loader built into KSP, it scans the installed assemblies, if they contain a class with the KSPAddon attribute, those classes get stored to be launched in the appropriate scene (Editor, flight etc). If they contain a reference to a forbidden namespace, they won't be launched.

If your class contains a reference to another assembly which then uses a forbidden namespace it will still load the class which then proceeds to load the required assemblies which might include forbidden namespaces.

On the behalf of Selene, yep it's still in active development. The current indev seems stable enough for testing and was thus merged to testing.

Almost all of the core lua API is done by now, over the course of the summer I will finish a library of modules that will allow you to quickly get started using Selene as autopilot engine.

Link to comment
Share on other sites

  • 4 months later...

Well it's not dead dead, the core groundwork is done so far, all that's missing now is building a proper standard library and general polishing, both ui and some features.

Depending on the course flight computer takes I might or might not continue working on this myself.

Edit: regarding Lua ksp projects there was one that tried turning kos in a language independent framework and there was a Lua implementation in development. Jebnix if I recall right

Edited by BlackNecro
Link to comment
Share on other sites

  • 4 months later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...