< Mathematics Index Adventure looks >

Definitions

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.

Boolean Constants

definitionvalue
TRUEt
FALSEf

Mathematical Functions

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.

definitionshortvaluedescriptionresult
ASSIGNASG=value assignmentx
INVERTINV!negative value-x
ADD+additionx+y
SUB-subtractionx-y
MUL*multiplicationx*y
DIV/divisionx/y; error, if y = 0
MOD%modulo (rest of division)x%y; error, if y = 0
POWERPOW#powerx*x*...*x, y times; error, if y < 0
ABSOLUTEABSaabsolute valuex, if x > 0, else -x
MINIMUMMIN<minimumx, if x < y, else y
MAXIMUMMAX>maximumx, if x > y, else y
RANDOMRANDrrandom numberx <= r <= y; error, if y < x
SINUSSINssinus of degreessin(10*x) * y
COSINUSCOSccosinus of degreescos(10*x) * y
TANGENSTANttangens of degreestan(10*x) * y; error, if (x+90)%180 = 0
HOURHhourhour of current time
MINUTEMminuteminute of current time
SECONDSsecondsecond of current time
DAYOFWEEKwday of weekweakday of current date (Sunday = 0)
DAYddayday of current date
MONTHmmonthmonth of current date
YEARyyearyear of current date

Note:

Mathematical Comparisons

The following mathematical relations are defined for the Comparison item. The last column describes the result for two arguments called x and y.

definitionshortvaluedescriptionresult
EQUALEQ=equalx = y
LESSLS<less thanx < y
GREATERGR>greater thanx > y
LESSEQUALLEQ(less than or equalx <= y
GREATEREQUALGEQ)greater than or equalx >= y
NOTEQUALNEQ!not equalx != y

Toolbar Style

One of the following styles for the scene toolbar may be selected in the Game item.

definitionvaluedescription
TOOLBAR_LONGlall toolbar items
TOOLBAR_SHORTsthe main menu is in a separate toolbar
TOOLBAR_TOOLtno menu buttons
TOOLBAR_MENUmno tool buttons
TOOLBAR_LONG_HIDELsame as TOOLBAR_LONG, but hidden
TOOLBAR_TOOL_HIDETsame as TOOLBAR_TOOL, but hidden
TOOLBAR_MENU_HIDEMsame as TOOLBAR_MENU, but hidden
TOOLBAR_NONE_no toolbar

Character Control with Tool

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:

definitionvaluedescription
DONT_MOVE0no change
MOVE_ALWAYS1always go nearby the selected point
MOVE_INSIDE2go to the selected point, if it is not occupied
MOVE_REGION3go to a selected region
MOVE_ACTION4go to a region, if it defines an action for the tool (also for default action)
MOVE_ACTION_EX5go to a region, if it defines an action for the tool (not for default action)
MOVE_JUMP+change position directly without going
TURN_REGIONaturn to a selected region
TURN_ACTIONbturn to a region, if it defines an action for the tool (also for default action)
TURN_ACTION_EXcturn to a region, if it defines an action for the tool (not for default action)

Object Cursor for Tool

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.

definitionvaluedescription
CURSOR_NORMAL0The cursor of the object is not used.
CURSOR_OBJECT1The cursor of the object is used.
CURSOR_OVERLAY2The cursor of the object is used with the cursor of the tool as an overlay.
CURSOR_UNDERLAY3The cursor of the tool is used with the cursor of the object as an overlay.

Mouse State for Text

The following constants are used in the Text item to display the text as selected depending on mouse state.

definitionvaluedescription
MOUSE_NONE0no selected display
MOUSE_OVER1selected display while mouse is inside of the region
MOUSE_CLICK2selected display while mouse is pressed inside of the region

Text Alignment

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

definitionshortvaluedescription
LEFT_TOPLT1left top
LEFT_CENTERLC4left center
LEFT_BOTTOMLB7left bottom
CENTER_TOPCT2center top
CENTER_CENTERCC5center
CENTER_BOTTOMCB8center bottom
RIGHT_TOPRT3right top
RIGHT_CENTERRC6right center
RIGHT_BOTTOMRB9right bottom

Shape Combination

The following constants are used as combination style for the Combination item.

definitionshortvaluedescription
UNION+union; at least one shape must be hit
INTERSECTIONINTER/intersection; all shapes must be hit
DIFFERENCEDIFF-difference; the first shape must be hit, but no other

Transformation

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 .

definitionshortvaluedescription
POSITIONPOS=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
TURNothe 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_POSwa character goes to an absolute position
WALK_MOVEWa character goes to a relative position
CHARACTER_STOPsa character stops walking
CHARACTER_SIZE!the size of a character is scaled (angle value = relative size in 1/1000)
DISTANCE_POSdsets the distance value of a region to the angle value
DISTANCE_MOVEDadds the angle value to the distance value of a region

Frame Change Direction

The following constants are used as type for the ChangeFrame item.

definitionvaluedescription
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

Action Selection for ChangeAction

The following table shows the item types and their actions that may be changed using ChangeAction

definitionvaluedescriptionaction item
ACTION_SETsactionTool, Action, DialogText, PlayAudio, PlayVideo, Timer, MouseInput, KeyInput, CharacterPosition, Animation, Motion
ACTION_EACHEeach actionGame
ACTION_INITiinit actionScene, Dialog, Region, Character
ACTION_EXITeexit actionScene, Dialog, Region, Character
ACTION_TRUEttrue actionCondition
ACTION_FALSEffalse actionCondition
ACTION_INIin actionRegion
ACTION_OUTOout actionRegion
ACTION_PRESSPpress actionRegion
ACTION_RELEASERrelease actionRegion
ACTION_STARTsstart actionCharacter
ACTION_STOPSstop actionCharacter

Special Values in Actions

definitionshortvaluedescriptionaction item
FIRST0first position ChangeList, Inventory
LAST-1last position ChangeList, Inventory
REMOVE-2remove ChangeList, Inventory
SELECT-3selection of objectInventory
SHOWINVENTORYSHOWINV-4open / close inventory (select=true/false) Inventory
REMOVEALL-5remove all elements ChangeList, Inventory
RANDOMPOS-6insert at random position ChangeList, Inventory
REVERSE-7reverse list order ChangeList
FORWARD-8shift list forward ChangeList
BACKWARD-9shift list backward ChangeList
REPLACE-10replaces insertAfter by new item ChangeList, Inventory
LOOP0repeat forever PlayAudio, PlayVideo
SINGLE_SHOT-1play once (faster, unstoppable version; WAV only) PlayAudio

Negation Flags

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.

Special Integer Variables

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.

definitionvalueinitialrangedescriptionflag
POINTS$0points reachedif true, Calculation is not performed a second time
SCENES%00 < xscenes visited
ACTIONS&00 < xactions initiated by mouse clicks
BRIGHT*0-255 <= x <= 255brightness of scenes
RED<0-255 <= x <= 255red filter for scenesno update
GREEN=0-255 <= x <= 255green filter for scenesno update
BLUE>0-255 <= x <= 255blue filter for scenesno update
CHARACTER_X.scene widthx position of character in scene
CHARACTER_Y:scene heighty position of character in scene
CHARACTER_ANGLE+0 <= x < 360orientation of character in scene
CHARACTER_SCALE#0 <= xscaling 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.

Special Item Variables

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.

definitionvaluedescription
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).