### Character Scripting

Non-player characters (NPCs) can be used to develop a story in your hold by assigning them a list of things to do and say. When an NPC is placed in a room, a dialog box will appear for customizing the NPC's appearance and behavior. On this dialog, a list box displays the character's script, which is initially empty. The script tells the NPC what to do when the player enters the room.

Graphic - Select what your NPC will look like from the list of available actors. Selecting "None" (the default) indicates this NPC is used for scripting events but will not appear as a visible character in the room. Hint: With the "None" setting, a character cannot be made visible.

Character Management - Click "Characters" to pop up the Character Management dialog. Here, you may create custom actors for use anywhere in the hold being edited. Type a name and click "Add Character" to create a new actor for this hold. Next, select what the actor will look like from the Graphic list box. Click "Custom avatar" to import a custom face from an image file (130x164 pixels) on disk into your hold. When this actor speaks, this image will be shown in the game screen's face box. Click "Custom Tiles" to import a custom tileset for this character. The tileset may be from a 1x1 to a 9x4 grid of 22x22 pixel tiles. Each column stores tiles for a certain orientation, starting from northward and progressing clockwise at 45 degree increments. The ninth column stores the central orientation (i.e. no direction). If an orientation to display is not included, the northward image is used by default. The second row may be included to display a second animation frame, displayed at random time intervals. The third row, if included, stores custom sword images for character types wielding swords. The fourth row, when included, stores custom images for a sword-wielding character when they are not currently wielding a sword. If the third and fourth rows are not included, then tiles from the first row are displayed in their place. If the type set is an entity without a sword, the third and fourth rows are ignored. Click "Default" to reset the actor's avatar or tileset to the default for this character type. Click "Delete" to permanently remove the selected actor from your hold.

Visible - If checked, the NPC will be visible when the player enters the room. Otherwise, it will be invisible. When an NPC is invisible, its script continues to play but it otherwise behaves as if it were not in the room. Hint: making a character with a "None" graphic visible will set it to the "Citizen" type.

Add Command - Click to add another command to the script.

Delete Command - Deletes the selected commands from the script. Also performed by pressing the <Delete> key.

Reordering commands - During play, commands are performed in the order they are placed in the script. Hold down the mouse button on a command and drag it to reposition it in the script.

Cut-copy-paste commands - With one or more commands selected, press <Ctrl-X> to cut the commands from the script and place them in the script clipboard. Press <Ctrl-C> to make a copy of the selected script commands and place them in the script clipboard. Press <Ctrl-V> to paste the script commands in the script clipboard after the selected script command. The script clipboard is only valid while editing the current NPC.

Importing and exporting commands - Script commands may be imported from and exported to the operating system clipboard. Press <Ctrl-B> to export the currently highlighted script commands. Then you may paste these commands as text into a text editor. Press <Ctrl-Shift-B> to import a text selection from the OS clipboard. Command syntax must match that of exported commands in order for text to be imported correctly.

Click "Okay" to finish customizing the NPC.

You may click on the character in the room at any time to revise its appearance or script. With the character monster selected in the edit menu, click on the NPC again to change its initial orientation. Click and drag a character to reposition it in the room.

Command list. Read what script commands do and how to use them.

Room Editor
Level Editor
Contents