Key

From ADRIFT 5 Manual Wiki
Revision as of 06:42, 23 October 2012 by Saabie (Talk | contribs)

Jump to: navigation, search

Every location, object, task, character, event, variable, group, property, text override, hint and folder in ADRIFT has a unique KEY.

A key is just a name that can consist of letters, numbers, and the underline character "_", but it cannot contain any spaces.

ADRIFT uses the key to identify each item so that, when you change the name of an item, every reference to it from other parts of the game will still point to the same item.

When you choose the name of an item from one of the drop-down lists, ADRIFT actually stores the key instead of the name. If you change the name of the item and then look at a restriction or action that uses it, you will see the new name of the item because ADRIFT used the stored key to find the item and then displayed its current name.

To display the key of every item on its title bar, open the Settings dialog box (from the main menu) and tick the box marked "Show keys on edit forms".

You can see the keys of every item in a folder by clicking on the funnel icon next to the close button at the top of the folder window:

FolderDetailsMenu.jpg

  • The funnel icon will not be there if you have changed the "View" of the window - you will need to change it back to "Details" view first.

Select the "Key" option to display the item keys in a separate column.

Here is a folder window with all 5 of the optional columns selected:

PropertyListDetails.jpg

The keys shown here are the name of the item with the spaces removed, which is typical of the standard library, but items you create yourself will normally consist of the type of item followed by a number, eg. Character2, Object4, Location426 etc.

  • If you have set a Key Prefix in the advanced options then it will be prepended to the key of any items created from then on.

Using Keys

Keys are most often used with Functions, either in a text box or an expression.

If you use the object-oriented_functions then ADRIFT will popup a list with the names of all of the relevant properties to choose from, but note that it is the KEY of the selected property that is then written into the text box.

If you need to use the %Functions% then you can either lookup the keys yourself and type them in, or use the following technique:

  1. Open the edit form you wish to place a function on.
  2. Move the mouse to the folder window containing the item you wish to use in the function.
  3. Position the mouse over the item and hold down the left button and "Drag" it to the text box.
  4. If the edit window disapears (which it usually does if its on top of the ADRIFT main window) then just:
    1. Drag the item down to the button on the windows taskbar that represents the edit window.
      • If the edit window does NOT have a taskbar button, then open the Settings form and tick the "Show all open windows in taskbar" option.
    2. Wait a moment until the edit window appears again (keeping the mouse button held down).
    3. Continue dragging the item to the edit window.
  5. Drag the item to the position in the text that you want to insert the function.
  6. Release the mouse button.


If we drag a character to a text box, seven choices will be shown in a menu:

DragCharacter.jpg

Menu Selection Inserted Text
Character Name Character1.Name
Character Key Character1
Character description Character1.Description
List objects held by Character Character1.Held.List(Indefinite)
List objects worn by Character Character1.Worn.List(Indefinite)
Location of Character Character1.CharacterLocation
Parent of Character

IconWarning.png "Parent of Character" does not insert anything in 5.0.26


If we drag an object to a text box, seven choices will be shown in the menu:

DragObject.jpg

Menu Selection Inserted Text
Object name Object1.Name
Object Key Object1
Object Description Object1.Description
List objects on Object1.Children(On)
List objects inside Object1.Contents
List objects on and inside Object1.Children
Parent of object Object1.Parent


If we drag a location to a text box, five choices will be shown in the menu:

DragLocation.jpg

Menu Selection Inserted Text
Location name Location1.Name
Location Key Location1
Display Location Location1.LongLocationDescription
Exits from Location Location1.Exits.List
Objects at Location Location1.Objects.List(Indefinite)