12. Constants
Description
At different places in DestinyScript specific numbers are required. But some values are hard to memorize. Hence you should use constants (these are names which represent the specified numbers). If you write the name of the constant instead of the number it represents then the result will be the same.
List of constant groups
Because the most constants belong together they are grouped here.
Description
This constants are very important, because they represent the boolean values.
Constants
| Constant | Value | Description |
| False | 0 | Switch state: OFF |
| True | 1 | Switch state: ON |
Description
This constants define the angle formats. A more specific description can be found at the
Sin method of the
Math object.
Constants
| Constant | Value | Description |
| DEG | 1 | For angles with 360 units in a full circle (= degree) |
| RAD | 2 | For angles with π units in a full circla (= radiant) |
| GRAD | 3 | For angles with π units in a full circle (= grad) |
| RPG | 4 | For angles with 256 units in a full circle (= RPG-Maker specific) |
Description
This constants define string values, which could not be written in DestinyScript.
Constants
| Constant | Value | Description |
| CR | ASCII char no. 13 | CarriageReturn |
| LF | ASCII char no. 10 | LineFeed |
| CRLF | ASCII char 13 and 10 | A line break under windows |
| QUOTE | " | Double quotes |
Description
This constants define the error numbers.
Constants
Description
This constants define the values for keys. (Usually this whould be much more constants, but they are removed because this constants are for very special keyboard layouts)
Constants
| Constant | Value | Description |
| VK_DOWN | 40 | Arrow down key |
| VK_LEFT | 37 | Arrow left key |
| VK_RIGHT | 39 | Arrow right key |
| VK_UP | 38 | Arrow up key |
| VK_CONTROL | 17 | Ctrl key |
| VK_MENU | 18 | Alt key |
| VK_RETURN | 13 | Enter key |
| VK_SHIFT | 16 | Shift key |
| VK_SPACE | 32 | Space |
| VK_LBUTTON | 1 | Left mouse button |
| VK_MBUTTON | 4 | Middle mouse button |
| VK_RBUTTON | 2 | Right mouse button |
| VK_NUMPAD0 | 96 | Numeric pad 0 |
| VK_NUMPAD1 | 97 | Numeric pad 1 |
| VK_NUMPAD2 | 98 | Numeric pad 2 |
| VK_NUMPAD3 | 99 | Numeric pad 3 |
| VK_NUMPAD4 | 100 | Numeric pad 4 |
| VK_NUMPAD5 | 101 | Numeric pad 5 |
| VK_NUMPAD6 | 102 | Numeric pad 6 |
| VK_NUMPAD7 | 103 | Numeric pad 7 |
| VK_NUMPAD8 | 104 | Numeric pad 8 |
| VK_NUMPAD9 | 105 | Numeric pad 9 |
| VK_MULTIPLY | 106 | Numeric pad multiply |
| VK_ADD | 107 | Numeric pad add |
| VK_SUBTRACT | 109 | Numeric pad subtract |
| VK_DECIMAL | 110 | Numeric pad decimal separator |
| VK_DIVIDE | 111 | Numeric pad divide |
| VK_0 | 48 | 0 key |
| VK_1 | 49 | 1 key |
| VK_2 | 50 | 2 key |
| VK_3 | 51 | 3 key |
| VK_4 | 52 | 4 key |
| VK_5 | 53 | 5 key |
| VK_6 | 54 | 6 key |
| VK_7 | 55 | 7 key |
| VK_8 | 56 | 8 key |
| VK_9 | 57 | 9 key |
| VK_A | 65 | A key |
| VK_B | 66 | B key |
| VK_C | 67 | C key |
| VK_D | 68 | D key |
| VK_E | 69 | E key |
| VK_F | 70 | F key |
| VK_G | 71 | G key |
| VK_H | 72 | H key |
| VK_I | 73 | I key |
| VK_J | 74 | J key |
| VK_K | 75 | K key |
| VK_L | 76 | L key |
| VK_M | 77 | M key |
| VK_N | 78 | N key |
| VK_O | 79 | O key |
| VK_P | 80 | P key |
| VK_Q | 81 | Q key |
| VK_R | 82 | R key |
| VK_S | 83 | S key |
| VK_T | 84 | T key |
| VK_U | 85 | U key |
| VK_V | 86 | V key |
| VK_W | 87 | W key |
| VK_X | 88 | X key |
| VK_Y | 89 | Y key |
| VK_Z | 90 | Z key |
| VK_BACK | 8 | Backspace key |
| VK_CAPITAL | 20 | Capslock key |
| VK_NUMLOCK | 144 | Numlock key |
| VK_SCROLL | 145 | Scroll lock key |
| VK_DELETE | 46 | Del key |
| VK_END | 35 | End key |
| VK_ESCAPE | 27 | Escape key |
| VK_HOME | 36 | Home key |
| VK_INSERT | 45 | Ins key |
| VK_PAUSE | 19 | Pause key |
| VK_PGDN | 34 | Page down key |
| VK_PGUP | 33 | Page up key |
| VK_PRINT | 44 | Print key |
| VK_TAB | 9 | Tab key |
| VK_F1 | 112 | F1 key |
| VK_F2 | 113 | F2 key |
| VK_F3 | 114 | F3 key |
| VK_F4 | 115 | F4 key |
| VK_F5 | 116 | F5 key |
| VK_F6 | 117 | F6 key |
| VK_F7 | 118 | F7 key |
| VK_F8 | 119 | F8 key |
| VK_F9 | 120 | F9 key |
| VK_F10 | 121 | F10 key |
| VK_F11 | 122 | F11 key |
| VK_F12 | 123 | F12 key |
Description
This constants are used to specify a key state. This constants can't be used to query a key state!
Constants
| Constant | Value | Description |
| KEYEVENTF_KEYDOWN | 0 | The key is pressed |
| KEYEVENTF_KEYUP | 2 | The key is released |
Description
This constants are used to access special events (hero, boat, ship, airship or the current event) with the Event or Mapevent object.
Constants
| Constant | Value | Description |
| THIS | 10005 | The current event |
| HERO | 10001 | The hero event |
| BOAT | 10002 | The boat event |
| SHIP | 10003 | The ship event |
| AIRSHIP | 10004 | The airship event |
Description
This constants are used to identify the direction of an event.
Constants
| Constant | Value | Description |
| DIR_UP | 0 | Direction: Up |
| DIR_RIGHT | 1 | Direction: Right |
| DIR_DOWN | 2 | Direction: Down |
| DIR_LEFT | 3 | Direction: Left |
Description
This constants are used to identify the action of a picture.
Constants
| Constant | Value | Description |
| ACTION_NONE | 0 | No action |
| ACTION_ROTATION | 1 | Rotation effect |
| ACTION_RIPPLE | 2 | Ripple effect |
Description
This constants are used to identify the state of a socket (client/server).
Constants
| Constant | Value | Description |
| STATE_CLOSED | 0 | The socket is closed |
| STATE_CONNECTED | 1 | The (client) socket is connected |
| STATE_LISTENING | 2 | The (server) socket wait for incoming connections |
| STATE_ERROR | -1 | The socket reports an error |
Description
This constants are used to identify the type of a socket (client/server).
Constants
| Constant | Value | Description |
| SOCK_DESTINY | 0 | The socket is a DestinySocket (hence it uses the DestinyProtocol) |
| SOCK_RAW | 1 | The socket is a RAW socket (hence it uses not a specific protocol) |
Description
This constants are used to specify the data types.
Constants
| Constant | Value | Description |
| TYPE_VARIABLE | 1 | Data type: variable |
| TYPE_SWITCH | 2 | Data type: switch |
| TYPE_DWORD | 3 | Data type: dword |
| TYPE_DOUBLE | 4 | Data type: double |
| TYPE_STRING | 5 | Data type: string |
| TYPE_BYTE | 6 | Data type: byte |
| TYPE_WORD | 7 | Data type: word |
Description
This constant is used to use the next free socket for incoming connections.
Constants
| Constant | Value | Description |
| NEXT_FREE_SOCKET | -1 | The next free socket will be used |
Description
This constants are used to specify the mode for opening files. This constants can be combined using the binary OR operator.
Constants
| Constant | Value | Description |
| FILE_READ | 1 | Data can be read |
| FILE_WRITE | 2 | Data can be written |
| FILE_APPEND | 6 | Data can be written and the file pointer starts at the end of the file |
Description
This constants are used to specify the attributes of a file/directory. This constants can be combined using the binary OR operator.
Constants
| Constant | Value | Description |
| FILE_ATTRIBUTE_ARCHIVE | 32 | A file/directory has the archive flag |
| FILE_ATTRIBUTE_DIRECTORY | 16 | A "e;thing"e; is a directory and not a file |
| FILE_ATTRIBUTE_HIDDEN | 2 | A file/directory is hidden |
| FILE_ATTRIBUTE_NORMAL | 128 | A file/directory has no special attributes |
| FILE_ATTRIBUTE_READONLY | 1 | A file/directory can only be read |
| FILE_ATTRIBUTE_SYSTEM | 4 | A file/directory is a part of the operating system |