Overview
Scripts are pre-defined sections of code that can create a wide variety of functionality within a scenario, such as adding alternate victory conditions, creating new game modes, and triggering scripted events.
The script menu contains tools and commands for working with, organizing, and importing scripts inside your scenario.
Script Menu Functions
Menu Item |
Description |
Open File in Project... |
Shows all your script files. Serves as a shortcut for finding and opening scripts in your mod. |
Find In Files | Opens a find function for the scenario for scripts. |
Replace in Files | Opens a find/replace command for the scripts in your scenario. |
Go To... |
Go-to command for your currently open script. Does not function unless a script is open. |
Bookmarks | Opens a secondary sub-menu with commands relating to script bookmarks. See Bookmarks below. |
Breakpoints | Opens a secondary sub-menu with a list of breakpoints for use in debugging. See Breakpoints below. |
Debugging | Opens a secondary sub-menu with commands relating to debugging scripts. See Debugging below. |
Attach | Attaches an editor to game to perform debugging. |
Detach | Detaches the editor from game to stop debugging. |
Run | If execution is paused at a breakpoint, this command resumes execution and runs the currently-selected script. |
Step Into | If an obstruction pointer is on a line with a function it will break within that function. |
Step Out | If execution is paused/broken within a fuction, this moves to the first instruction outisde of that function. |
Step Over | Skips a function. |
Show Line Numbers | Toggle visibility of line numbers in script editor. |
Documentation | Opens the official documentation for working with scripts. |
Bookmarks Sub-Menu
Menu Item |
Description |
Bookmarks | Opens the Bookmarks panel. |
Toggle bookmarks | Shows or hides the bookmark your cursor is currently over. |
Toggle All Bookmarks |
Shows or hides all bookmarks. |
Previous Bookmark | Goes to the previous bookmark in your master library. |
Next Bookmark | Goes to the next bookmark in your master library. |
Clear Bookmarks | Clears all bookmarks. |
Previous Bookmark in Document | Goes to the previous bookmark in your current scenario. |
Next Bookmark in Document | Goes to the next bookmark in your current scenario. |
Breakpoints Sub-Menu
Menu Item |
Description |
Breakpoints | Opens the Breakpoints panel. |
Toggle Breakpoint | Toggles a single breakpoint on/off. Breakpoints that are toggled off will cause execution to no longer pause on that breakpoint. |
Toggle All Breakpoints | Toggles all breakpoints on/off. Breakpoints that are toggled off will cause execution to no longer pause on that breakpoint. |
Clear Breakpoints | Clears all breakpoints in breakpoint list. |
Debugging Sub Menu
Menu Item |
Description |
Call Stack |
Opens the Call Stack panel. If you have a script open, this will show the call stack of all the currently executing functions as a stack. |
Globals |
Opens the Globals panel. This requires you to have a script open. Not declared with local prefix in LUA. |
Locals |
Opens the Locals panel. Declared with local prefix in LUA. |