The Witcher Script Studio application is part of the REDkit toolkit. It is an Integrated Development Environment (IDE) for creating, editing, debugging and profiling scripts for use in the REDkit: World Editor and The Witcher 2 game. These scripts are used add custom functionality and are written in a bespoke language developed by CD Projekt RED known as Witcher Script.
The IDE consists of a menu bar, a toolbar, a solution explorer, various tabbed panels and an editor pane which can display one or more tabbed documents. The following sections will define each of these options in turn.
This article outlines the various features of the Witcher Script Studio. For information about how to use or make the most of these features or for tutorials on developing scripts refer to the See Also section at the end of this article.
The Solution Explorer displays all the directories and script files in the solution, i.e. that are available to use in the REDkit: World Editor and/or The Witcher 2 game. The directories and files are displayed in a tree structure relative to the solution's root path. For a normal installation this is [The Witcher 2 Root]\bin\scripts\.
It is possible to add directories and add or remove files through the Solution Explorer or through the file system (using the Rescan function) however it is only possible to remove directories from the solution through the file system.
Right clicking on the Solution node or a directory node displays the following context menu options:
Right clicking on a file (i.e. script) node displays the following context menu options:
The IDE consists of a menu bar, a toolbar, a solution explorer, various tabbed panels and an editor pane which can display one or more tabbed documents. The following sections will define each of these options in turn.
This article outlines the various features of the Witcher Script Studio. For information about how to use or make the most of these features or for tutorials on developing scripts refer to the See Also section at the end of this article.
Table of contents
Menu Bar
The Menu Bar consists of five menus:- File Menu
- Edit Menu
- Debug Menu
- Tools Menu
- Window Menu
File Menu
- Open Solution File: Displays a list of all solution files, i.e. scripts, and allows the user to select one and open it. The scripts are listed alphabetically according to their path within the solution, for example game\gameplay\traps.ws. The list can be filtered using a keyword which can appear anywhere in the scripts name or path.
- Save: Saves the current script.
- Save All: Saves all open scripts.
- Properties: TBC
Edit Menu
- Undo: Reverses the last edit action.
- Redo: Reverses the last undo action.
- Copy: Copies the selected text to the clipboard.
- Cut: Cuts the selected text from the document after copying it to the clipboard.
- Paste: Inserts the contents of the clipboard into the current document at the insertion point. Any selected text will be replaced.
- Find: Displays the Find & Replace form and preselects the Current document option in the Files to check section. Any text that was selected in the current document will be used to populate the Find what field.
- Find all: Displays the Find & Replace form and preselects the All files in solution option in the Files to check section. Any text that was selected in the current document will be used to populate the Find what field.
- Find next: Highlights the next occurrence of the text being sought matching the criteria. An alert is displayed if there are nor more occurrences.
- Find previous: Highlights the previous occurrence of the text being sought matching the criteria. An alert is displayed if there are nor more occurrences.
- Go To: Displays the Go To Line form and jumps to the line number entered by the user. An alert is displayed if the user enters a bad line number.
- Bookmarks: Opens the Bookmarks submenu:
- Toggle Bookmark: Adds a new bookmark to or removes an existing bookmark from the current line.
- Next Bookmark: Navigates to the next bookmark based on the order in which they were created. See the Bookmarks panel (below).
- Previous Bookmark: Navigates to the previous bookmark based on the order in which they were created. See the Bookmarks panel (below).
- Clear All Bookmarks: Removes all bookmarks from all documents.
Debug Menu
- Reload Scripts: Recompiles (TBC) and reloads all the scripts in the solution into the current game.
- Continue:
- Step Over:
- Step Into:
- Step Out:
- Toggle Breakpoint:
Tools Menu
- Find Symbol: Displays a list of all symbols (classes, enums, functions, fields and methods) and their signature in the solution files. The symbols are listed alphabetically according to their identifier. The list can be filtered using a keyword which can appear anywhere in the symbol's name.
Windows Menu
- Close All Documents: Closes all open docoments. If a document has been edited since it was opened or previously saved the user will be given the opportunity to save it before it is closed.
Toolbar
Save | Saves the current script | |
Save All | Saves all open scripts | |
View History | TBC | |
Undo | Reverses the last edit action | |
Redo | Reverses the last undo action | |
Cut | Cuts the selected text from the document and copies it to the clipboard | |
Copy | Copies the selected text to the clipboard | |
Paste | Inserts the contents of the clipboard into the current document at the insertion point. Any selected text will be replaced. | |
Find | Displays the Find & Replace form and preselects the Current document option in the Files to check section. Any text that was selected in the current document will be used to populate the Find what field. | |
Reload Scripts | TODO | |
Continue | Continue execution of the game | |
Step Over | Step over the current statement | |
Step Into | Step into the current function | |
Step Out | Step out of the current function | |
Connect To Game | Connect to the game or REDkit: World Editor | |
Connect To Game Host | Connect to a defined host or define a new host. | |
Profile Function Calls | TODO | |
Profile Function Calls (Continuous Mode) | TODO | |
Properties | Shows the unfiltered properites in the Locals panel |
Solution Explorer
The Solution Explorer displays all the directories and script files in the solution, i.e. that are available to use in the REDkit: World Editor and/or The Witcher 2 game. The directories and files are displayed in a tree structure relative to the solution's root path. For a normal installation this is [The Witcher 2 Root]\bin\scripts\.
It is possible to add directories and add or remove files through the Solution Explorer or through the file system (using the Rescan function) however it is only possible to remove directories from the solution through the file system.
Right clicking on the Solution node or a directory node displays the following context menu options:
- Add File: TODO
- Add Directory: TODO
- Rescan: TODO
Right clicking on a file (i.e. script) node displays the following context menu options:
- Delete: TODO
Panels
Bookmarks
- TODO: displays a list of bookmarks in the current solution; double clicking on an entry will display that script (opening if necessary) and scroll to the appropriate line. Bookmarks are not saved.
Breakpoints
- TODO: displays a list of breakpoints in the current solution; double clicking on an entry will display that script (opening if necessary) and scroll to the appropriate line. Breakpoints are not saved.
Callstack
- TODO: once I have debugging working!
Console
- TODO: cls works!
Find results
- TODO: displays the results of a "Find All" (see above), double clicking on an entry will display that script (opening if necessary) and scroll to the appropriate line.
Locals
- TODO: once I have debugging working!
Ouput
- TODO: displays a greeting message when started; displays output from "Reload all Scripts"; is there a script function debug.writeline or println or log etc.?
Editor Pane
- TODO: information about editor pane and tabbed documents; both scripts and profilers are displayed in this pane. Context menu "Close all but this".