Quest Editor

For all talk about quests. Creating, testing, bugs, and development progress.
Post Reply
User avatar
TheLacus
Posts: 887
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.

Image

Image

Imgur gallery (some screenshots are from older versions)

Installation
  1. Install Visual Studio Code, available at code.visualstudio.com.
  2. Install TEMPLATE for Visual Studio Code, available at github.com/TheLacus/vscode-dftemplate.
Legacy Tools
Spoiler!
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.

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.
Last edited by TheLacus on Tue Jun 25, 2019 2:48 pm, edited 25 times in total.

User avatar
Deepfighter
Posts: 90
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: 2538
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.
See the Daggerfall Unity Wiki on the UESP.
Progress on fixing classic quests here.

User avatar
Interkarma
Posts: 4729
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: 887
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: 887
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: 2538
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.
See the Daggerfall Unity Wiki on the UESP.
Progress on fixing classic quests here.

User avatar
TheLacus
Posts: 887
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: 1389
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: 2538
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.
See the Daggerfall Unity Wiki on the UESP.
Progress on fixing classic quests here.

Post Reply