Difference between revisions of "Key"

From ADRIFT 5 Manual Wiki
Jump to: navigation, search
m (links)
(Links/general functions)
Line 27: Line 27:
 
Keys are most often used with Functions, either in a [[Text_Boxes|text box]] or an [[Expressions|expression]].
 
Keys are most often used with Functions, either in a [[Text_Boxes|text box]] or an [[Expressions|expression]].
  
If you use the [[object-oriented_functions]], you only need to type the key of a Character, Object or Location followed by a full-stp and ADRIFT will popup a list with the names of all of the relevant properties and functions to choose from.
+
If you use the [[Item_functions]], you only need to type the key of a Character, Object or Location followed by a full-stp and ADRIFT will popup a list with the names of all of the relevant properties and functions to choose from.
  
 
An easy way to insert these functions in your text is to [[Text_Boxes#Drag_and_Drop|Drag-and-Drop]] a character, object or location to the point in the text where you want it inserted, then select the wanted function from the menu that appears.  
 
An easy way to insert these functions in your text is to [[Text_Boxes#Drag_and_Drop|Drag-and-Drop]] a character, object or location to the point in the text where you want it inserted, then select the wanted function from the menu that appears.  
  
If you need to use old-style %[[Functions]]% that have a key as a parameter, then you will need to lookup the keys yourself and type them in.
+
If you need to use [[General Functions]] that have a key as a parameter, then you will need to lookup the keys yourself and type them in.
  
  
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[Windows Executables|<<< Windows Executables]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Main Page]]</TD><TD ALIGN=CENTER>[[Object-oriented functions|Object-oriented functions >>>]]</TD></TABLE>
+
<TABLE ALIGN=CENTER BORDER=1 WIDTH="50%"><TD WIDTH="33%" ALIGN=CENTER>[[Functions|<<< Functions]]</TD><TD WIDTH="34%" ALIGN=CENTER>[[Main Page]]</TD><TD ALIGN=CENTER>[[Item functions|Item functions >>>]]</TD></TABLE>

Revision as of 06:02, 4 March 2013

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 Item_functions, you only need to type the key of a Character, Object or Location followed by a full-stp and ADRIFT will popup a list with the names of all of the relevant properties and functions to choose from.

An easy way to insert these functions in your text is to Drag-and-Drop a character, object or location to the point in the text where you want it inserted, then select the wanted function from the menu that appears.

If you need to use General Functions that have a key as a parameter, then you will need to lookup the keys yourself and type them in.


<<< FunctionsMain PageItem functions >>>