| < Mathematics | Index | Adventure looks > |
Since there are several conventions and shortcuts for values of some items, the file define.adi defines longer expressions, which may be easier to understand, remember, and use. Some definitions have a long and a short form.
To use these definitions in your adventure code, include define.adi by: #include define.adi.
The file define.adi should be in the same directory as AdvMake.exe.
The following lists the definitons made in define.adi.
| definition | value |
|---|---|
| TRUE | t |
| FALSE | f |
The following mathematical functions are defined for the Calculation item. This item always has two arguments, but not all functions use them. The last column describes the result for two arguments called x and y.
| definition | short | value | description | result |
|---|---|---|---|---|
| ASSIGN | ASG | = | value assignment | x |
| INVERT | INV | ! | negative value | -x |
| ADD | + | addition | x+y | |
| SUB | - | subtraction | x-y | |
| MUL | * | multiplication | x*y | |
| DIV | / | division | x/y; error, if y = 0 | |
| MOD | % | modulo (rest of division) | x%y; error, if y = 0 | |
| POWER | POW | # | power | x*x*...*x, y times; error, if y < 0 |
| ABSOLUTE | ABS | a | absolute value | x, if x > 0, else -x |
| MINIMUM | MIN | < | minimum | x, if x < y, else y |
| MAXIMUM | MAX | > | maximum | x, if x > y, else y |
| RANDOM | RAND | r | random number | x <= r <= y; error, if y < x |
| SINUS | SIN | s | sinus of degrees | sin(10*x) * y |
| COSINUS | COS | c | cosinus of degrees | cos(10*x) * y |
| TANGENS | TAN | t | tangens of degrees | tan(10*x) * y; error, if (x+90)%180 = 0 |
| HOUR | H | hour | hour of current time | |
| MINUTE | M | minute | minute of current time | |
| SECOND | S | second | second of current time | |
| DAYOFWEEK | w | day of week | weakday of current date (Sunday = 0) | |
| DAY | d | day | day of current date | |
| MONTH | m | month | month of current date | |
| YEAR | y | year | year of current date |
Note:
The following mathematical relations are defined for the Comparison item. The last column describes the result for two arguments called x and y.
| definition | short | value | description | result |
|---|---|---|---|---|
| EQUAL | EQ | = | equal | x = y |
| LESS | LS | < | less than | x < y |
| GREATER | GR | > | greater than | x > y |
| LESSEQUAL | LEQ | ( | less than or equal | x <= y |
| GREATEREQUAL | GEQ | ) | greater than or equal | x >= y |
| NOTEQUAL | NEQ | ! | not equal | x != y |
One of the following styles for the scene toolbar may be selected in the Game item.
| definition | value | description |
|---|---|---|
| TOOLBAR_LONG | l | all toolbar items |
| TOOLBAR_SHORT | s | the main menu is in a separate toolbar |
| TOOLBAR_TOOL | t | no menu buttons |
| TOOLBAR_MENU | m | no tool buttons |
| TOOLBAR_LONG_HIDE | L | same as TOOLBAR_LONG, but hidden |
| TOOLBAR_TOOL_HIDE | T | same as TOOLBAR_TOOL, but hidden |
| TOOLBAR_MENU_HIDE | M | same as TOOLBAR_MENU, but hidden |
| TOOLBAR_NONE | _ | no toolbar |
The following constants are used to control the behaviour of a player character with a tool (see scene layout for more information). The table states the condition of changing the position or orientation of the character relative to the point or region the player clicked at:
| definition | value | description |
|---|---|---|
| DONT_MOVE | 0 | no change |
| MOVE_ALWAYS | 1 | always go nearby the selected point |
| MOVE_INSIDE | 2 | go to the selected point, if it is not occupied |
| MOVE_REGION | 3 | go to a selected region |
| MOVE_ACTION | 4 | go to a region, if it defines an action for the tool (also for default action) |
| MOVE_ACTION_EX | 5 | go to a region, if it defines an action for the tool (not for default action) |
| MOVE_JUMP | + | change position directly without going |
| TURN_REGION | a | turn to a selected region |
| TURN_ACTION | b | turn to a region, if it defines an action for the tool (also for default action) |
| TURN_ACTION_EX | c | turn to a region, if it defines an action for the tool (not for default action) |
The following constants define whether and how the cursor of the selected Object is used for a tool. If no object is selected, the cursor of the tool is used.
| definition | value | description |
|---|---|---|
| CURSOR_NORMAL | 0 | The cursor of the object is not used. |
| CURSOR_OBJECT | 1 | The cursor of the object is used. |
| CURSOR_OVERLAY | 2 | The cursor of the object is used with the cursor of the tool as an overlay. |
| CURSOR_UNDERLAY | 3 | The cursor of the tool is used with the cursor of the object as an overlay. |
The following constants are used in the Text item to display the text as selected depending on mouse state.
| definition | value | description |
|---|---|---|
| MOUSE_NONE | 0 | no selected display |
| MOUSE_OVER | 1 | selected display while mouse is inside of the region |
| MOUSE_CLICK | 2 | selected display while mouse is pressed inside of the region |
The following text alignment constants are used for the Style item. The numbers are used according to the positions of the numbers on a telephone:
1 2 3 4 5 6 7 8 9
| definition | short | value | description |
|---|---|---|---|
| LEFT_TOP | LT | 1 | left top |
| LEFT_CENTER | LC | 4 | left center |
| LEFT_BOTTOM | LB | 7 | left bottom |
| CENTER_TOP | CT | 2 | center top |
| CENTER_CENTER | CC | 5 | center |
| CENTER_BOTTOM | CB | 8 | center bottom |
| RIGHT_TOP | RT | 3 | right top |
| RIGHT_CENTER | RC | 6 | right center |
| RIGHT_BOTTOM | RB | 9 | right bottom |
The following constants are used as combination style for the Combination item.
| definition | short | value | description |
|---|---|---|---|
| UNION | + | union; at least one shape must be hit | |
| INTERSECTION | INTER | / | intersection; all shapes must be hit |
| DIFFERENCE | DIFF | - | difference; the first shape must be hit, but no other |
The following constants are the transformations for the ChangePlace item. A position, size, or orientation is changed as described. The constants POSITION, MOVE, and SCALE are also used for .
| definition | short | value | description |
|---|---|---|---|
| POSITION | POS | = | the values are assigned |
| MOVE | + | the values are added | |
| SCALE | % | the values are multiplied and then devided by 100 | |
| ANGLE | < | the angle value is assigned | |
| TURN | o | the angle value id added | |
| TURN_TO | > | a character is turned to the position | |
| POS_ANGLE | - | position and angle values are assigned | |
| MOVE_TURN | / | position and angle values are added | |
| SCENE_POS | ~ | a scene is positioned (but restricted to window area) | |
| SCENE_MOVE | * | a scene is moved (but restricted to window area) | |
| WALK_POS | w | a character goes to an absolute position | |
| WALK_MOVE | W | a character goes to a relative position | |
| CHARACTER_STOP | s | a character stops walking | |
| CHARACTER_SIZE | ! | the size of a character is scaled (angle value = relative size in 1/1000) | |
| DISTANCE_POS | d | sets the distance value of a region to the angle value | |
| DISTANCE_MOVE | D | adds the angle value to the distance value of a region |
The following constants are used as type for the ChangeFrame item.
| definition | value | description |
|---|---|---|
| FROM_START | = | sets the frame forwards from the start position |
| FROM_END | _ | sets the frame backwards from the end position |
| FORWARDS | + | sets the frame forwards from the current position |
| BACKWARDS | - | sets the frame backwards from the current position |
The following table shows the item types and their actions that may be changed using ChangeAction
| definition | value | description | action item |
|---|---|---|---|
| ACTION_SET | s | action | Tool, Action, DialogText, PlayAudio, PlayVideo, Timer, MouseInput, KeyInput, CharacterPosition, Animation, Motion |
| ACTION_EACH | E | each action | Game |
| ACTION_INIT | i | init action | Scene, Dialog, Region, Character |
| ACTION_EXIT | e | exit action | Scene, Dialog, Region, Character |
| ACTION_TRUE | t | true action | Condition |
| ACTION_FALSE | f | false action | Condition |
| ACTION_IN | I | in action | Region |
| ACTION_OUT | O | out action | Region |
| ACTION_PRESS | P | press action | Region |
| ACTION_RELEASE | R | release action | Region |
| ACTION_START | s | start action | Character |
| ACTION_STOP | S | stop action | Character |
| definition | short | value | description | action item |
|---|---|---|---|---|
| FIRST | 0 | first position | ChangeList, Inventory | |
| LAST | -1 | last position | ChangeList, Inventory | |
| REMOVE | -2 | remove | ChangeList, Inventory | |
| SELECT | -3 | selection of object | Inventory | |
| SHOWINVENTORY | SHOWINV | -4 | open / close inventory (select=true/false) | Inventory |
| REMOVEALL | -5 | remove all elements | ChangeList, Inventory | |
| RANDOMPOS | -6 | insert at random position | ChangeList, Inventory | |
| REVERSE | -7 | reverse list order | ChangeList | |
| FORWARD | -8 | shift list forward | ChangeList | |
| BACKWARD | -9 | shift list backward | ChangeList | |
| REPLACE | -10 | replaces insertAfter by new item | ChangeList, Inventory | |
| LOOP | 0 | repeat forever | PlayAudio, PlayVideo | |
| SINGLE_SHOT | -1 | play once (faster, unstoppable version; WAV only) | PlayAudio |
In Case and Condition, negation flags are used to invert the truth of a condition. For up to four conditions, there are predefined constants for negation consisting of 'P' (positive) and 'N' (negative). E.g. the constant PNPP means the second condition is negated.
The following variables have a special meaning. Assigning a value to one of these variables with a Calculation implies an according change of a parameter of the adventure engine. The flag attribute of Calculation may have a specific function.
| definition | value | initial | range | description | flag |
|---|---|---|---|---|---|
| POINTS | $ | 0 | points reached | if true, Calculation is not performed a second time | |
| SCENES | % | 0 | 0 < x | scenes visited | |
| ACTIONS | & | 0 | 0 < x | actions initiated by mouse clicks | |
| BRIGHT | * | 0 | -255 <= x <= 255 | brightness of scenes | |
| RED | < | 0 | -255 <= x <= 255 | red filter for scenes | no update |
| GREEN | = | 0 | -255 <= x <= 255 | green filter for scenes | no update |
| BLUE | > | 0 | -255 <= x <= 255 | blue filter for scenes | no update |
| CHARACTER_X | . | scene width | x position of character in scene | ||
| CHARACTER_Y | : | scene height | y position of character in scene | ||
| CHARACTER_ANGLE | + | 0 <= x < 360 | orientation of character in scene | ||
| CHARACTER_SCALE | # | 0 <= x | scaling factor of character in scene | ||
| SCENE_X | - | x offset of scene | |||
| SCENE_Y | _ | y offset of scene |
Note: Brightness and colour filters consume lots of processing resources. If you want to change filters for red, green, and blue simultaneously, set the no update flag for the first two filters and update only, when the last filter is changed. Brightness is not really a parameter but it changes red, green, and blue filters simultaneously to the same value.
Note: To change the character and scene position, you must use ChangePlace. Changing the variable values won't change the position.
The adventure engine assigns items to the following variables for information that would not be accessible by the game otherwise. Don't change them using SetVariable.
| definition | value | description |
|---|---|---|
| LAST_TOOL | . | last selection of tool by player (but not action) |
| LAST_INV_TOOL | : | last selection of inventory tool by player (but not action) |
| CURRENT_SCENE | ! | current scene |
| CURRENT_INVSCENE | ? | current inventory scene |
| CURRENT_DIALOG | + | current dialog |
| CURRENT_OBJECT | * | selected Object |
Note: LAST_TOOL and LAST_INV_TOOL may be used to change the tool while the mouse is over a region and change it back when the mouse leaves the region (cf. dialog example).