Installation
To get started with Ravenscript you will need the following:
Ravenfield
Get a copy of Ravenfield from either Steam or the Humble Store. More details can be found on the Ravenfield website.
Ravenfield Tools Pack
The Ravenfield Tools Pack contains essential assets and scripts necessary to build and publish mods. Follow the instructions on the Ravenfield website.
Visual Studio Code
Visual Studio Code is a text editor from Microsoft.
There are a couple of reasons we recommend Visual Studio Code:
Built-in support in Unity
Debugger support for Lua
Syntax highlighting for Lua-files with .txt extension
It is possible to use Ravenscript with any text-editor. Vim, Sublime Text, Notepad++, whichever you like. But this documentation will assume that your are using Visual Studio Code.
Henceforth Visual Studio Code will be known as VSCode.
Unity ❤ Visual Studio Code
Unity will default to MonoEdit or a version of Visual Studio. But we can configure Unity to use VSCode instead:
Open the Ravenfield Tools Pack project in Unity.
Open Unity preferences (Edit > Preferences)
Click External Tools
Select Browse from the External Script Editor drop-down
Browse to
%localappdata%/Programs/Microsoft VS Code/
and selectCode.exe
Visual Studio Code should now be selected as your External Script Editor
Close the preferences
Open a new VSCode window (without a workspace)
Open the Ravenfield Tools Pack folder (File > Open Folder)
Done
Extensions
VSCode is high customizable through extensions. There are extensions for Lua, C#, and debugging support.
Open VSCode
Open the extensions tab (View > Extensions)
Search for
vscode-lua
in the top-left search barSelect the first result
Press the green Install button
Repeat for
C#
(unless already installed)Repeat for
EditorConfig for VS Code
Done
Syntax highlighting
Note
Syntax highlighting should work out-of-the-box with the latest Ravenfield Tools Pack if you have followed the above instructions.
Ravenscript files use the .txt file extensions. They are bundled into Unity Asset Bundles as Text Assets hence the file extensions requirement.
VSCode should treat all .txt files within the Ravenfield Tools Pack folder as Lua code. If you followed the above steps it should already work as expected. However, if it does not, keep reading.
VSCode does not apply syntax highlighting to .txt files out of the box. We must convince VSCode to apply Lua syntax highlighting to all .txt files within the Ravenfield Tools Pack folder.
Browse to the Ravenfield Tools Pack folder
Open the
.vscode
directory (it may be hidden)Open the
settings.json
fileMake sure it includes:
{ "files.associations": { "*.txt": "lua", } }