Skip to content

Development Environment Setup

Ruin0x11 edited this page Apr 17, 2020 · 6 revisions

Getting The Code

First, use Git to clone the repository:

git clone https://github.com/Ruin0x11/OpenNefia

Editor Setup

There are two editors currently recommended for editing the source. These editors both have extensions available which allow for things like code hotloading and documentation, which are really important for iterative mod development. If you use neither of them, then VS Code is recommended.

You can also use an editor not listed here, but note that in order to access the extra features you'll have to manually type out the appropriate commands in the REPL instead. (Of course, it's possible to write a new extension for your favorite editor if you wish.)

For more information on how to use the editor extensions, see [Editor Extensions](Extras/Editor Extensions).

The following details each editor's setup.

VS Code

  1. Launch VS Code, then go to File > Preferences > Extensions.
  2. Click the three dots (...) at the top right corner of the extensions menu and select Install from VSIX....
  3. In the repository, navigate to editor/vscode/open-nefia-support-0.0.1.vsix and select it. This should install the extension.

Verify everything is set by opening the palette commands popup (default Ctrl+Shift+P) and searching for OpenNefia, to see if the newly added commands appear.

It's also recommended to install these extensions for Lua support:

Once everything is ready, use File > Open Folder... to open the src folder in the repository.

Emacs

Load the file editor/emacs/open-nefia.el in your init file, like so:

(load "/path/to/OpenNefia/editor/emacs/open-nefia.el")

Launching the Game

If you're using Windows, run the OpenNefia.bat script. If you're using a Unix-like OS, run the OpenNefia script.

These scripts will automatically download the 1.22 assets if necessary. After the startup process finishes, you should see the title screen.

If you're using the VS code extension, you can use the palette command OpenNefia: Launch game (Alt-L) after you've run the above script for the first time to launch the game when the repository (OpenNefia/src) is opened.

Next Steps

Proceed to Getting Familiar With The Code.