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
|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 command for your currently open script. Does not function unless a script is open.
|Opens a secondary sub-menu with commands relating to script bookmarks. See Bookmarks below.
|Opens a secondary sub-menu with a list of breakpoints for use in debugging. See Breakpoints below.
|Opens a secondary sub-menu with commands relating to debugging scripts. See Debugging below.
|Attaches an editor to game to perform debugging.
|Detaches the editor from game to stop debugging.
|If execution is paused at a breakpoint, this command resumes execution and runs the currently-selected script.
|If an obstruction pointer is on a line with a function it will break within that function.
|If execution is paused/broken within a fuction, this moves to the first instruction outisde of that function.
|Skips a function.
|Show Line Numbers
|Toggle visibility of line numbers in script editor.
|Opens the official documentation for working with scripts.
|Opens the Bookmarks panel.
|Shows or hides the bookmark your cursor is currently over.
Toggle All Bookmarks
|Shows or hides all bookmarks.
|Goes to the previous bookmark in your master library.
|Goes to the next bookmark in your master library.
|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.
|Opens the Breakpoints panel.
|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.
|Clears all breakpoints in breakpoint list.
Debugging Sub Menu
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.
Opens the Globals panel. This requires you to have a script open. Not declared with local prefix in LUA.
Opens the Locals panel. Declared with local prefix in LUA.