Folder configuration #
Adding dfhack-config/scripts folder #
- In VS Codium, go to File > Open Folder.
- Pick folder
...\Dwarf Fortress\dfhack-config\scripts- default full path for a Steam installation should be something likeC:\Program Files (x86)\Steam\steamapps\common\Dwarf Fortress\dfhack-config\scripts. Click on Select Folder.
- Tick the Trust the authors of all files… box and click on Yes, I trust the authors.
- You should now have the following view. You can close the
Welcometab.
- In Explorer pane, click on the
README.mdfile and familiarize yourself with the content. Close it when you’re done.
Adding hack/scripts folder #
- Click on File > Add folder to workspace.
- Navigate to
Dwarf Fortress/hack/scriptsfolder and click Add.
- Confirm that you trust the authors of files in this folder.
- You should now have the following view.
Save workspace file #
- Go to File > Save Workspace As…
- Change the default name to
dfhack.code-workspaceand click Save.
Change folder aliases #
- Open the
dfhack.code-workspacefile by clicking on it twice in the Explorer window.
- Above each
pathattribute add a newnameattribute. Add the values"My Scripts"and"Default Scripts"for the custom DFHack scripts folder and the default DFHack scripts folder respectively. Don’t forget the comma after the attribute value.
- Save the file. You should now have the following view. Note how the folders changed names, so they are now more easily distinguishable.
Forbid editing within hack/scripts folder #
- Within the
dfhack.code-workspacefile, under"settings"add"files.readonlyExclude": {"../../hack/scripts/*.lua": true}.
-
Save the
dfhack.code-workspacefile. All the .lua files withinDefault Scriptsfolder will now be opened in read-only mode to prevent accidentally overwriting them. -
Open the
hello-world.luafile in theDefault Scripts/develsubfolder by clicking on it twice in the Explorer window. -
To indicate the read-only state, there should now be a little padlock to the right of the file name. Try editing the file - a popup appears next to your cursor informing you about the read-only setting.
- Close the
hello-world.luafile.