Difference between revisions of "Script editor"
m (Link category) |
|||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
==Description== | ==Description== | ||
− | The Script Editor allows you to create and edit scripts. You can also use it to [[script_debugger|debug scripts]]. | + | The Script Editor allows you to create and edit [[Scripting|behaviour scripts]]. You can also use it to [[script_debugger|debug scripts]]. |
== Using the Script Editor == | == Using the Script Editor == | ||
[[File:ScriptEditor_StepByStep.png|none]] | [[File:ScriptEditor_StepByStep.png|none]] | ||
− | <sub>The Script Editor with each component numbered</sub> | + | <sub>The Script Editor with each component numbered and an absurd amount of errors to illustrate a stressful situation</sub> |
<br /> | <br /> | ||
Line 17: | Line 17: | ||
===Menu=== | ===Menu=== | ||
====File==== | ====File==== | ||
+ | [[File:ScriptEditor_Menu_File.PNG|none]] | ||
<sub>A closeup of the File menu</sub> | <sub>A closeup of the File menu</sub> | ||
+ | |||
The File menu allows you to create, save, open, or reload script files. It also allows you to exit the editor. | The File menu allows you to create, save, open, or reload script files. It also allows you to exit the editor. | ||
====Edit==== | ====Edit==== | ||
+ | [[File:ScriptEditor_Menu_Edit.PNG|none]] | ||
<sub>A closeup of the Edit menu</sub> | <sub>A closeup of the Edit menu</sub> | ||
+ | |||
The Edit menu allows you to undo or redo, cut/copy/paste, select all, or find within scripts. | The Edit menu allows you to undo or redo, cut/copy/paste, select all, or find within scripts. | ||
====View==== | ====View==== | ||
+ | [[File:ScriptEditor_Menu_View.PNG|none]] | ||
<sub>A closeup of the View menu</sub> | <sub>A closeup of the View menu</sub> | ||
+ | |||
The View menu allows you to show the Solution Panel, the Errors Panel, the Watch Panel, and the Output Panel. | The View menu allows you to show the Solution Panel, the Errors Panel, the Watch Panel, and the Output Panel. | ||
====Build==== | ====Build==== | ||
+ | [[File:ScriptEditor_Menu_Build.PNG|none]] | ||
<sub>A closeup of the Build menu</sub> | <sub>A closeup of the Build menu</sub> | ||
+ | |||
The Build menu allows you to build the current file, build all files, rebuild all files, and reload the object lists. | The Build menu allows you to build the current file, build all files, rebuild all files, and reload the object lists. | ||
====Debug==== | ====Debug==== | ||
+ | [[File:ScriptEditor_Menu_Debug.PNG|none]] | ||
<sub>A closeup of the Debug menu</sub> | <sub>A closeup of the Debug menu</sub> | ||
+ | |||
The Debug menu allows you to pause, continue, and step when debugging. These are not available while editing scripts. More information can be found [[script_debugger|here]]. | The Debug menu allows you to pause, continue, and step when debugging. These are not available while editing scripts. More information can be found [[script_debugger|here]]. | ||
Line 52: | Line 62: | ||
<br /> | <br /> | ||
===Solution Explorer=== | ===Solution Explorer=== | ||
+ | [[File:ScriptEditor_Solution_Panel.PNG|none]] | ||
+ | <sub>The solution explorer</sub> | ||
+ | |||
+ | The solution explorer shows the scripts in their respective project and folder as they appear in the Data folder. You can filter by typing in the filter textbox at the bottom and quickly clear the filter by pressing the X next to the filter. The Solution Explorer will only show files with the extensions .charScript, .itemScript, and .gameScript. | ||
<br /> | <br /> | ||
===Script Editor=== | ===Script Editor=== | ||
+ | [[File:ScriptEditor_Script_Editor.PNG|none]] | ||
+ | <sub>The script editor</sub> | ||
+ | |||
+ | The script editor is a simple text editor, which also correctly color codes the script. It allows you to expand or collapse regions that are automatically created for each section (INIT, BEHAVIOUR, STORY, and EVENTS) and for each REACTION, EVENT, and SCRIPTFRAME. The status at the top of the script editor shows you whether the file has been built succesfully (meaning without any errors). A file can only be built when it is linked to a script resource. | ||
<br /> | <br /> | ||
===Debug Panel=== | ===Debug Panel=== | ||
+ | [[File:ScriptEditor_Debug_Panel.PNG|none]] | ||
+ | <sub>The debug panel, containing the error panel, watch panel, and output panel</sub> | ||
+ | |||
+ | The debug panel contains three panels: error panel, watch panel, and output panel. The watch panel and output panel are explained in detail on the [[script_debugger|script debugger]] page. The error panel contains both errors and warnings that occured during the latest build (could be a single script or a full build of all scripts). It will show you the error/warning, the file, the line, and -if applicable- the template. Double clicking the error will automatically open the relevant script at the correct line and show the error/warning with a red/yellow highlight. If an error description is preceded by [Instantiating] it will open the affected character or item. Instantation errors usually mean that an EXTERN variable has been filled in incorrectly on a character or item. | ||
<br /> | <br /> | ||
===Find Panel=== | ===Find Panel=== | ||
+ | [[File:ScriptEditor_Find_Panel.PNG|none]] | ||
+ | <sub>The find panel</sub> | ||
+ | |||
+ | The find panel (CTRL+F) allows you to search in the current script or in all scripts, with the options to match case or match the whole word. | ||
+ | |||
+ | [[Category:Behaviour_Scripts]] |
Latest revision as of 22:04, 3 December 2017
Contents
Description
The Script Editor allows you to create and edit behaviour scripts. You can also use it to debug scripts.
Using the Script Editor
The Script Editor with each component numbered and an absurd amount of errors to illustrate a stressful situation
The Script Editor consists of the following components:
Menu
File
A closeup of the File menu
The File menu allows you to create, save, open, or reload script files. It also allows you to exit the editor.
Edit
A closeup of the Edit menu
The Edit menu allows you to undo or redo, cut/copy/paste, select all, or find within scripts.
View
A closeup of the View menu
The View menu allows you to show the Solution Panel, the Errors Panel, the Watch Panel, and the Output Panel.
Build
A closeup of the Build menu
The Build menu allows you to build the current file, build all files, rebuild all files, and reload the object lists.
Debug
A closeup of the Debug menu
The Debug menu allows you to pause, continue, and step when debugging. These are not available while editing scripts. More information can be found here.
Quick Menu
The Quick Menu contains the most used options from the Menu and a couple more. All debugging related options on the Quick Menu are explained in detail on the debug scripts page. From left to right the Quick Menu buttons do the following:
- Create a new script file
- Open a script file
- Save a script file
- Save all script files
- Cut selected text
- Copy selected text
- Paste text
- Build the current script
- Build all scripts
- Rebuild all scripts
- Reload the object lists
- Collapse all regions by one level in the current script
- Expand all regions by one level in the current script
Solution Explorer
The solution explorer
The solution explorer shows the scripts in their respective project and folder as they appear in the Data folder. You can filter by typing in the filter textbox at the bottom and quickly clear the filter by pressing the X next to the filter. The Solution Explorer will only show files with the extensions .charScript, .itemScript, and .gameScript.
Script Editor
The script editor
The script editor is a simple text editor, which also correctly color codes the script. It allows you to expand or collapse regions that are automatically created for each section (INIT, BEHAVIOUR, STORY, and EVENTS) and for each REACTION, EVENT, and SCRIPTFRAME. The status at the top of the script editor shows you whether the file has been built succesfully (meaning without any errors). A file can only be built when it is linked to a script resource.
Debug Panel
The debug panel, containing the error panel, watch panel, and output panel
The debug panel contains three panels: error panel, watch panel, and output panel. The watch panel and output panel are explained in detail on the script debugger page. The error panel contains both errors and warnings that occured during the latest build (could be a single script or a full build of all scripts). It will show you the error/warning, the file, the line, and -if applicable- the template. Double clicking the error will automatically open the relevant script at the correct line and show the error/warning with a red/yellow highlight. If an error description is preceded by [Instantiating] it will open the affected character or item. Instantation errors usually mean that an EXTERN variable has been filled in incorrectly on a character or item.
Find Panel
The find panel
The find panel (CTRL+F) allows you to search in the current script or in all scripts, with the options to match case or match the whole word.