With Daneel, I often needed to copy several large scripts from their .lua file over to CraftStudio and it took several seconds per script every times. I really needed a way to do that automatically.
So I created an application that can basically convert Script assets from CrafStudio (.csscript files) to regular Lua scripts (.lua) and vice-versa.
The app can read a CraftStudio project and create a .lua version of all of the project’s scripts. The opposite is also possible : read a bunch of .lua scripts and overwrite the corresponding Script assets in a CraftStudio project.
The use case is very specific and it’s not super practical as you need to stop the local server to write in a CS project, but that’s what I share here.
The app is created with Unity3D, so it should works on Mac and Linux too. You can download the app and get the source on GitHub.
If you planned to create such external application that deal with CraftStudio files, you may be interested by the ProjectFileHandler class that reads the Projet.dat file and extract data about the project, the game controls and especially the assets (id, type, name, revisions names).
The ScriptFileHandler class deals with a particular Script asset and its revisions. This is where the conversion from .csscript to .lua and vice-versa happens.