Closed ForLoveOfCats closed 5 years ago
This is now becoming a high priority as 0.1 has shipped.
Please comment suggestions and requests below as to what features are wished from the mod api.
A few things I'd like to see/work on:
Yes I was meaning to mention that I need to add a JS type for structures. Save and load should be easy, however the custom functions to the console will be tricky. I have pondered it before and the main issue is that the console engine is never and should never be restarted as that would clear all user defined variables and functions. However when a mod is unloaded all functions it created in the console must be removed.
One way this could be achieved is by storing a list of all functions that the current gamemode has exposed to the console and setting them all to undefined
when the gamemode is unloaded. (One cannot delete functions in JS)
We need a system to execute JS code in the target engine when exposing a type to said engine. Some features the these types must be implemented directly in JS itself (like overriding .toString
) so this would allow for that.
So the new plan is unsandboxed IronPython scripts with explicit manual installation instead of autodownload from server and execute.
Work has begun in the IronPython branch https://github.com/ForLoveOfCats/SkyOfSteel/tree/IronPython
Exposing custom functions to the console will be possible now with IronPython as when the gamemode is unloaded we can delete the functions it exposed to the console. (Python allows deleting functions whereas JS does not)
Closing this as the game's entire internal API is now exposed with the new C# gamemode scripting
The core modding API systems are in place and all current ingame actions are piped to the mod scripts. However the function list needs great expanding.