Quest Editor

For all talk about quests. Creating, testing, bugs, and development progress.
User avatar
TheLacus
Posts: 799
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Quest Editor

Post by TheLacus » Fri Jun 15, 2018 6:36 pm

Daggerfall Template for VS Code
A Visual Studio Code extension that brings support for Tipton's Template scripting language for Daggerfall. Visual Studio Code is a powerful open source and cross-platform text editor.

This extension implements features for Daggerfall Unity quest language such as go to definition, find references, rename symbols, diagnostics and others. It is built with modularity in mind to allow integration with custom actions provided by game mods. A preview of features can be seen in this gallery.

Syntax highlighting and a few other features are also available for Notepad++.

Image

Installation
  1. Download VS Code if you don't have it already.
  2. Download the latest version (.vsix) from Releases on github (you can find the changelog here).
  3. Click on Extensions button, open the dropdown menu and choose Install from VSIX.
  4. Follow the Quick Start points to setup a folder or workspace for Daggerfall Unity.
Settings
Change settings from Open File>Preferences>Settings>Workspace Settings or User settings. Workspace settings consist of a file added to local folder which overrides user settings.

Start typing dftemplate to show all available setttings.

Roadmap and Contributions
At this time I'm reaching the point of a stable and feature-complete 1.0 release.

For a possible version 2.0 I'm interested in implementing the Language Server Protocol to improve performance (which is already fine because quests are pretty small files) and potentially port the core of the extension to other text editors, such as Atom, with relative ease.

I appreciate all issue reports and feedback.
If you want to contribute to development, open cloned folder in editor and run npm install to install dependencies.

Notepad++
Notepad++ is a powerful but light text editor available in 32 and 64 bit versions. All the tools here work for both. Unfortunately is only available for Windows, but it works fine with Wine.
Spoiler!
The following installation instructions refers to two paths: %AppData% and %InstallationPath%. By default the latter is \Program Files\Notepad++ for 64 bit or \Program Files (x86)\Notepad++ for 32 bit. If you use the portable version (shipped without installer) AppData is not used; instead, you'll find all the files inside the extracted folder.

All files for can be found here.

Syntax Highlighting
Recognizes and highlights known keywords, comments and vars with different color

Image

Installation:
  1. Move the file userDefineLang.xml inside %AppData%\Roaming\Notepad++\. If you had already installed a custom language in the past, you'll need to merge the content with the existing file (just put one <UserLang> after the other).
  2. Quests file have .txt extension so we can't make an automatic association. When you open a quest file with notepad++, you have to manually select Language > DfTemplate.
  3. I tested colors on Default (light theme), Obsidian and Bespin (dark themes). If you use a different theme and want to change colors, you can use the UI offered by Notepad++ at Language > Define your language. Right click on background color to set it transparent.
Known issues:
  • Punctuation following a keyword is seen as part of the keyword itself. (ex. [...] __foo_, [...]).
Regions
This is a feature offered with highlighting which is not part of official language syntax. It allows to fold a group of code lines and focus on the parts of code you're working on without scrolling.

Code: Select all

--- @region Name

--- @end
Image


Auto-Complete
Suggest completion from a list of known words.

Image

Installation:
Move the file DfTemplate.xml inside %InstallationPath%\plugins\APIs\.

Task list
List all tasks in a quest file.

Image

Installation:
  1. Open %AppData%\Roaming\Notepad++\functionList.xml.
  2. Open dfTemplate_functionList.xml from the downloaded files.
  3. Copy xml code from this file to functionList.xml following instructions provided in the file itself.
  4. Use the Function List button to toggle tasks panel.
Attachments
quests.code-workspace.zip
(284 Bytes) Downloaded 34 times
dftemplate_settings.7z
(635 Bytes) Downloaded 32 times
Last edited by TheLacus on Wed Mar 20, 2019 4:26 pm, edited 23 times in total.

User avatar
Deepfighter
Posts: 69
Joined: Sun Mar 22, 2015 10:24 am
Location: Iliac-Bay
Contact:

Re: Syntax highlighting

Post by Deepfighter » Fri Jun 15, 2018 7:08 pm

Personally, I think that this change is very helpful and would be probably highly appreciated. At least for translating reasons it's helping a lot. The current quest editor for translating quests has the same and can't imagine it without.

+1 from me :)
Head of the German Daggerfall translation - www.daggerfalldeutsch.de
and German translator for The Elder Scrolls V: Skyrim and Lore-Expert for The Elder Scrolls: Online

User avatar
Jay_H
Posts: 2140
Joined: Tue Aug 25, 2015 1:54 am

Re: Syntax highlighting

Post by Jay_H » Fri Jun 15, 2018 10:05 pm

As a quest writer I am very interested in this.
Come join the Unofficial Daggerfall Unity Discord.
Try the first Daggerfall Unity Quest Pack with roughly 210 all-new quests.
I write quests but have no technical knowledge.

User avatar
Interkarma
Posts: 4287
Joined: Sun Mar 22, 2015 1:51 am

Re: Syntax highlighting

Post by Interkarma » Fri Jun 15, 2018 10:47 pm

This is a smart idea!

User avatar
TheLacus
Posts: 799
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Syntax highlighting

Post by TheLacus » Sat Jun 16, 2018 11:52 am

Thank you for feedback! I've update first post with installation instructions.

@Deepfighter
I'll give a look at translation editor, thank you for pointing that out.
If you are interested in creating mods for Daggerfall Unity you can find the documentation here.

User avatar
TheLacus
Posts: 799
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Syntax highlighting

Post by TheLacus » Mon Jun 18, 2018 7:35 pm

Added highlighting and snippets for Visual Studio Code.
If you are interested in creating mods for Daggerfall Unity you can find the documentation here.

User avatar
Jay_H
Posts: 2140
Joined: Tue Aug 25, 2015 1:54 am

Re: Syntax highlighting

Post by Jay_H » Wed Jun 20, 2018 2:27 am

I installed it, but I don't have any highlighting on my end (except where I highlight some word with the mouse and it repeats the highlighting elsewhere). Is there some missing step?

Image
Come join the Unofficial Daggerfall Unity Discord.
Try the first Daggerfall Unity Quest Pack with roughly 210 all-new quests.
I write quests but have no technical knowledge.

User avatar
TheLacus
Posts: 799
Joined: Wed Sep 14, 2016 6:22 pm
Contact:

Re: Syntax highlighting

Post by TheLacus » Wed Jun 20, 2018 9:59 am

You can change language from the language indicator on the bottom-right corner. Select 'dftemplate'. Extension is .txt so this can't be done automatically (unless you want it for all text files). :)
If you are interested in creating mods for Daggerfall Unity you can find the documentation here.

User avatar
Hazelnut
Posts: 1249
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Syntax highlighting

Post by Hazelnut » Wed Jun 20, 2018 11:30 am

line 35 of dftemplate.tmLanguage has a typo:

Code: Select all

					<key>1</ley>
This is duplicated a few times. Is this correct for the VS code file? Anyway, found it while messing with trying to get an Atom grammar definition by converting yours. They seem to both be TextMate based so the info is same, but Atom wants a json/cson file instead.

I found a converter that turns .tmLanguage into .cson but it doesn't recognise the 'match' key annoyingly, that would be a real easy way to auto generate atom highlighting.

User avatar
Jay_H
Posts: 2140
Joined: Tue Aug 25, 2015 1:54 am

Re: Syntax highlighting

Post by Jay_H » Wed Jun 20, 2018 11:51 am

It's working now, and magnificently. Thank you TheLacus!
Come join the Unofficial Daggerfall Unity Discord.
Try the first Daggerfall Unity Quest Pack with roughly 210 all-new quests.
I write quests but have no technical knowledge.

Post Reply