Quest Editor

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

Quest Editor

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

A WIP integration of Template script language with Visual Studio Code. Syntax highlighting and a few other features are also available for Notepad++.

VS Code
Visual Studio Code is a powerful open source and cross-platform text editor. Daggerfall Unity quest scripts can be created and edited with the help of an extension, which is available here. A preview of features can be seen on this gallery.

Image

Installation
  1. Download the latest version (.vsix) from Releases on github (you can find the changelog here).
  2. Click on Extensions button, open the dropdown menu and choose Install from VSIX.
  3. 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.
These are the main settings:
  • Centered Messages
    dftemplate.format.centeredMessages: Messages with <ce> tag are horizontally centered, otherwise they are aligned to the left.
  • Diagnostics
    Diagnostics are enabled by default but they are still quite crude so if you want you can disable them with dftemplate.diagnostics.enabled. When enabled, they can run only when a file is opened or saved, or being refreshed as you type (dftemplate.diagnostics.live). If you reduce dftemplate.diagnostics.delay they will run more often so there is also more going on in background.
  • Modules
    There is no reason to change this settings at this time, but if a mod adds new actions to the quest engine, quest writers can import signatures for autocomplete and diagnostics adding a json file path to dftemplate.modules.
Start typing dftemplate to show all available setttings.

Contributions
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.

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 16 times
dftemplate_settings.7z
(635 Bytes) Downloaded 14 times
Last edited by TheLacus on Fri Dec 07, 2018 5:58 pm, edited 17 times in total.

User avatar
Deepfighter
Posts: 57
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: 1668
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.
Try over 120 all-new quests in the first Daggerfall Unity Quest Pack.

User avatar
Interkarma
Posts: 3619
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: 693
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: 693
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: 1668
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
Try over 120 all-new quests in the first Daggerfall Unity Quest Pack.

User avatar
TheLacus
Posts: 693
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: 938
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: 1668
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!
Try over 120 all-new quests in the first Daggerfall Unity Quest Pack.

Post Reply