Library Editor - UA-ScriptEase/scriptease GitHub Wiki

Unlike ScriptEase, the Library Editor can be dangerous to use if you have no idea what you are doing. There is a chance that you will destroy a library when you use the Library Editor. Thus, you should take care and follow these instructions before attempting anything.

#General The Library Editor is run by going to "Tools>Library Editor>Translator", where Translator is the name of the Translator whose Library you wish to edit. The Library Editor will load up as a tab.

The Library Editor can be saved by going to "File>Save" or pressing Ctrl+S.

Stories saved on different versions of a Library may not work with a new Library. They might not load properly, or parts may be removed. If you are working on a Library, do not expect old stories to work.

Sometimes a component may not update correctly when another component is adjusted. Update it by clicking on the Story Component again in the Library Pane.

#Adding a New Story Component A new story component can be added by going to "File>New>Story Component", where Story Component is the new Story Component. It will appear in the appropriate category. Right now, only new Causes and Effects may be added.

New Causes will start with a default CodeBlock added, with a default Subject and Slot. A new Effect will have nothing attached to it.

#Deleting a Story Component Click on a Story Component and either use Edit > Delete, or hit the Delete key on your keyboard.

#Editing a Story Component When any Component is clicked, the Component Descriptors will update. They perform the following functions:

Visible Deselecting this will make the component not show up in the Library Pane when editing a story. This is especially useful for creating descriptions because they use effects; the effects are usually not used as actual effects, so they can then be hidden.It would also be useful to hide components that do not currently work correctly without completely deleting them.

Name This is the name of the Story Component. To create a parameter binding, write the parameter name in . This will cause the binding to show up as a red box in the finished panel, and allow the user to drag in parameters.

To create an implicit, write the implicit name in just like parameters. This will cause the implicit to show up as a green tube, which can be used by the user.

Labels Labels show up beside the story component panel. Commonly used labels for effects are "NOW" or "TODO". Multiple labels can be added by separating them with commas.

Add CodeBlock Causes and Effects have an additional button: the Add CodeBlock button. This will add a CodeBlock to the Story Component. Since Causes can only have one CodeBlock, adding another one will turn it into an Effect.

###Editing a CodeBlock Causes and Effects have CodeBlocks. Here are its fields:

Delete CodeBlock If there is more than one CodeBlock, we can delete a CodeBlock from the editor.

Subject This sets the subject for the CodeBlock. Subjects in the list come from parameters whose types have slots.

Slot This allows the user to set slots for the code block. These come from the subject selected. Subjects with multiple types will show only the slots in common.

Implicits Implicits for the slot show up beside implicits. These cannot be edited yet, and when they can be edited they will be edited in a different editor. They are listed so the user knows which ones can be displayed in the name.

Includes Includes are names of include files necessary for a CodeBlock. This is a simple string, so make sure you get it right.

Types The return type of the code block. For most Causes and Effects, this should be set to Void. Note that "Void" is not the same as not selecting anything! However, some CodeBlocks can return other objects, such as for Effects used in Descriptions. The return type must be set correctly here.

####Editing Parameters CodeBlocks may have multiple parameters. These are created and edited in the Parameters Panel.

+ Adds a parameter to the CodeBlock.

- Removes the parameter from the CodeBlock.

Name Sets the name of the parameter. Note that this will not update the name anywhere else, such as in the name of the Story Component or anywhere that the Parameter is mentioned in the Code Editor Panel.

Types The possible types that the Parameter can be.

Default Type The default type. This matters mostly for the default binding.

Default Binding For default types that allow a default binding, it can be set here.

###Editing Code The Code Editor is where the majority of CodeBlock functionality is implemented. This is where the actual code goes. But since code needs to adhere to strict rules, the Code Editor is no mere text editor; it allows the user to edit code graphically.

There are a few different types of fragments that may be added using the top toolbar. They are either containers which may contain other fragments, or individual fragments that may not contain other fragments.

Type Description
Line Container. All fragments added inside of the line fragment will appear on a new line in code generation.
Indent Container. All fragments added inside of the indent fragment will appear indented in code generation. It is possible to add multiple line fragments inside of one indent fragment in order to have all lines indented.
Scope Container.
Series Container.
Simple Individual.
Literal Individual. Inserts the literal string into code.
Reference Individual.
Delete Deletes the selected fragment.
Up Moves the fragment either up or left depending on which way the parent container is oriented.
Down Moves the fragment either down or right depending on which way the parent container is oriented.

#Description Graphs Description graphs are a group of similar descriptions. Every description graph path acts similarly to a single description, with its corresponding effect.

To create a description graph, start by creating a new Description in the File -> New menu. Then you make the paths you want by using the graph editor menu, similar to story points. Make sure the return type is the same as the effects that you will be using.

Select the path you want to correspond to your specific effect using the selection tool. Drag the effect into the effect box above the description graph. It should now appear in the box. Repeat these steps for all other possible paths.