Scripts

From the CreationKit Wiki
Revision as of 14:49, 11 July 2015 by imported>Bug64 (Created a page on the Script management dialogues, mostly to serve as a placeholder for usages notes.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

When a script can be attached to a game element you will see a tab or portion of a tab with a window similar to the one shown below.

ScriptManagement.jpg

  • If a script has no properties or its properties have not been given values, its name will be prefixed with a "+" (as shown above)
  • After the script's properties are set, it's icon changes to a combination pencil and "+" (ScriptPropertiesSetIcon.jpg).
  • Since most scripts have properties that must be set before the script will function properly, these icons help to remind the user when the properties haven't been set.


Add

Used to create a new script or add a previously created scripted.

AddScript.jpg

  • Filter: Text entered into this field will limit the list of scripts displayed to those whose name contains the given text
  • [New Script]: Appears at the top of the list of scripts and is used to create a script from scratch. See below for more details.
  • Show Hidden Scripts: Shows scripts that have been marked as hidden.


  • If you create a script outside of the tool, it will not appear in the list of scripts.

Add New Script

Prompts the user for basic information used to create the script header. With the exception of the name, any of this information can be changed later by directly editing the script's source.

AddNewScript.jpg

  • Name: The name of the new script. This name will be used to refer to the script from elsewhere and is used as the name of the script's source file.
  • Extends: The name of parent script from which this script will be derived. Creation Kit will usually set this to a reasonable default.
  • Hidden: Adds the hidden flag to the script's definition.
  • Conditional: Adds the conditional flag to the script's definition.
  • Documentation String: Documentation explaining the script's purpose.

Remove

Removes the currently selected script from the list of scripts. The source file is not deleted.

Properties

Used to add properties to a script and set their values. After a property has been added, it must be removed by deleting it from the script's source. PropertiesDialogue.jpg

  • Add Property: Adds a new property to the script.
    • The property will appear at the bottom of the script.
    • If you mark the property hidden, it's still added to the script but will not appear in this window
  • Auto-Fill All: TBD
  • Edit Value: Allows you to set the initial value of this property. The area to the left of the button will provide one or more input fields to be populated, depending on the property's type.
  • Revert: TBD
  • Auto-Fill: Like "Auto-Fill All" but only fills the selected property


  • It is possible to create illegal properties using this dialog (such as using an invalid name for a property). This will be reported as a compilation error after clicking the OK button on the Add Property dialog. When the compilation error dialog is dismissed, the bad property will not appear in the list of properties even though it is still in the script. You must edit the script's source to resolve the issue.