*** Indiana Java Complete Reference Manual *** *** Typed by Luca w/ help from Spyros, Chir, Nexus & Riktik *** *** Based upon Multiplatform Adventure Game Engine v1.1 *** Guide Version 1.0 Latest update: December,9th 2001 Every keyword recognised by the parser is listed and explained here. If you do find some words recognized but not listed or explained, report them to me (Luca) [lucachan@freemail.it] and I'll add them here. -------------------------------------------------------------------------------- Index: 1) Block headers 2) System Variables 3) Procedures 4) System Procedures 5) Functions 6) Boolean Operators 7) Appendix & Hints 7.a) indy.ini file 7.b) Running the game as an Application (OBSOLETE) 7.c) Full screen 7.d) Choosing your resolution -------------------------------------------------------------------------------- 1. Block headers These are words which are followed by a "{" some other words, a final "}". This is the reason for calling them "Block": they contain something. :-) The sintax will be: block_word { parameters explained } If a block can be used with different sintax, it will be shown by the No. 1, No. 2 and so on put after the block name. ALPHA { number } This is used inside an ITEM block and defines the transparency of the item. Range is 0...100 meaning 0 = No Transparency and 100 = Full Transparency. Full Transparency means an INVISIBLE item. (Can be useful ;-)) ANGLES { number } This is used inside a SYSTEM block and defines the number of directions the player can face. See IMAGE or ANIMATION blocks. This is of enormous importance: if you make 16 directions and don't change ANGLES { 16 }, you'll only use the ones already declared. Example: ANGLES { 4 } means you'll have only four directions. Not only: let's say you first declare 4 angles. You have: 0: look at the player 1: look right 2: look at the "game" 3: look left If you change to 8, you'll have: 0: look at the player 1: look at the player and right (the diagonal) 2: look right and so on. This means you'll have to change every ORIENTATION in your items. As you have seen in this example, ANGLES { 4 } means from 0 to 3, starting lookin at the player and rotating anti-clockwise. ANIMATION { number } // No. 1 Like ANGLES, it is used in the SYSTEM block to define the number of available attitudes of an item. Default is 4 (0,1, 2 and 3) but it can be changed. (See IMAGE block) ANIMATION { attitude orientation "path/filename" frames } // No. 2 This is used inside an ITEM block to specify the images to be used for an animated item. Not an animated GIF, but an ACTOR! The "attitude orientation... blabla... frames" must be done for every attitude and orientation desired for the item. See IMAGE block for the attitudes explanation. Orientation maps the available orientations of the item, which will be used in SETORIENTATION command. (See ANGLES block) Frames tells the engine how many frames compose the image. This must be a SINGLE image, containing all the frames from left to right. Frames must have the SAME width!! You can use an animated gif too, if you wish, and in this case you'll have to tell how many frames? 1. You have as many directions as the ANGLES number you have declared. :-) BGSOUND { "path/filename" } This is used inside a ROOM block and specifies the MIDI sound used as theme. COMMAND verb item { sequence of commands } This can be used inside ROOM blocks, ITEM blocks, or outside any block. verb must be an already declard verb (see SYSTEM block) and item an existing item. The sequence of commands may be any other block header, procedure, or anything else. This header is quite similar to EVENT with the difference that COMMAND block is executed when the player uses a specific sentence (verb+item1+item2) while EVENT blocks are executed everytime the trigger is verified. CURSOR { "path/filename" numberX numberY } This is used inside a SYSTEM block and specifies the look of the main cursor used in the game. File must be .GIF w/ transparency, and 32x32 pixels wide. numberX means the distance in pixels from left to focal point of cursor. numberY means the distance in pixels from top to focal point of cursor. NOTE: custom cursors don't work in browsers AND JRE 1.2.2 is having problems with them. So, until this gets fixed, use default one. DEFAULTV { verb_name } This is used inside an ITEM block, to specify the default verb highlighted when the cursor touches the ITEM. verb_name must be already defined in the SYSTEM block. It is used inside the SYSTEM block to specify the default verb for items which don't have a default verb declared. (Usually it's look) NOTE: you *HAVE* to define a default verb for each item. Obviously it is solved by putting a DEFAULTV block in the SYSTEM block, but sometimes you could wish not to do this (as it happened to me...): in this case you NEED to define a DEFAULTV block for EACH and EVERY item (or use inheriting). ELSE { list of things to do } This is used together with IF. If you don't know them, study some programming language! :-) If the statement in the brackets of IF is not TRUE, the engine does what's been told in the ELSE statement. The list of things to do is equal to the ones inside a COMMAND block. EVENT { IF { ... } THEN { ... } } This is similar to COMMAND, but with a more general meaning. Instead of happening when a trigger is performed [verb + item1 + item2 + ...] they are executed everytime: they contain many IF statements, which "sleep" and wait for you do to something. Okay, it's easier to do than to type! Look at this example to exit a ROOM: EVENT { IF { COLLISION your_char door_to_other_room } THEN { GOTO other_room PLACE your_char other_room SETPOSITION your_char { x y z } } IF { COLLISION your_char yet_another_door } THEN { GOTO yet_another_room PLACE your_char yet_another_room SETPOSITION your_char { x y z } } } FOR var starting_value ending_value { commands } This is used to make loops. Example: FOR a 1 10 { SAY your_char "My name is John" SLEEP 1000 } This will make the character say his name ten times. NOTE: you don't have to put an increment to the value because the engine does it itself. You can wish to change the pace, but you won't get a neverending loop with my example. :-) FONT { "Font name" size } This is used inside a SYSTEM block and specifies the font used in the dialogues on screen. It can be used in a VERB block too to define the font used. The available fonts in JAVA are: Dialog SansSerif Serif Monospaced Helvetica TimesRoman Courier DialogInput ZapfDingbats IF { things to verify } This is udes together with THEN and ELSE. If you don't know them, study some programming language! :-) If the statement in the brackets of IF is not TRUE, the engine does what's been told in the ELSE statement. If it's TRUE, the engine does what's been told in the THEN statement. The "things to verify" may use boolean operators as AND OR and NOT. ICON { "path/filename" } This is used inside an ITEM block and specifies the image to be used when the item is picked up and shown in the inventory. It's used inside a VERB block, to define the image used for the button. IMAGE { "path/filename" } // No. 1 This is used inside a ROOM block together a WALK block and defines the background image to be used for the room. See WALK too. IMAGE { attitude orientation "path/filename" } // No. 2 This is used inside an ITEM block and defines the image shown in the screen for the specified ITEM. numbers define attitude and direction of image as follows: Attitude: 0 Stand 1 Walk 2 Talk. 3 (and more) SPECIAL. Used for attitudes loaded on-the-fly. See SETATTITUDE and Tutorial #5 for more informations. NOTE: if you have an attitude which occurs several time you could declare it in the ANIMATION block of the item :-) (Look at it) Orientation: 0 Look at player. 1 Look right. 2 Look "game" 3 Look left. NOTE: Orientation depends on the value of ANGLES declared in the SYSTEM block. INK { number } // No. 1 This is used inside an ITEM block to define the color of the text of that ITEM's sentences. number may be one of these: 0: black 1: blue 2: red 3: pink 4: green 5: cyan 6: yellow 7: white 8: gray 9: orange 10: brown INK { red green blue } // No. 2 This is, instead, used either inside a VERB block to define the colour of the text appearing on the button and the upper and right outline of the button itself, or in a INVENTORY block to define the colour of the background of an existing item. red, green and blue are OBVIOUS :-) Split your colour in the basic three... Background for not picked up items (so empty inventory) is due to PAPER block settings. INTEGER { a b c d ... } This is (not necessarily) used outside any block and contains the names of the variables. If put inside a block, the variables will be "valid" ONLY in THAT block (has its own advantages & disadvantages...) Once declared in the INTEGER block, a variable can be accessed, queried compared to another and everything else which regards variables :-) Variables can be initialized too during declaration. Example: INTEGER { a{1} b{2} c d{7} } This means the variables will have the values: a=1 b=2 c=0 => This is the default value for an uninitialized integer var d=7 As for IF and FOR, study some programming language to learn more about the use and the concept of visibility of variables. :-) INVENTORY { list of blocks } This is used inside a SYSTEM block, and contains various settings for the inventory panel. Usually contains: INK { red green blue } PAPER { red green blue } SIZE { number } Give a look at each of them. ITEM { list of blocks } This is used inside a ROOM block and defines an ITEM. If you don't know what an item is, you should not read these lines but the tutorials! Go there! ITEMVAR { a b c ... list of variables } This is used to define Item Variables, which can be used with SAYI, WAITSAYI to make an ItemVar speack. Example, you can write: WAITSAYI CurrentPlayer "Wow, I'm the player now!" and the Item that is the CurrentPlayer will speack. CurrentPlayer is a special ItemVar. KEY { "letter" } This is used inside a VERB block to define a shortcut key. See VERB block for an example. LABEL { "text" } // No. 1 This is used inside a VERB block to define the name which will be displayed when it's selected. Otherwise it can be used in an ITEM block to define the item's name. NOTE: if the label is "" (no text) the item will be unchosable for the player. If it's void (" ") it will not appear until a SETLABEL command declares a name for it. PAPER { red green blue } This is udes inside a VERB block to define the colour of the background of the button in the Verbs panel, or in a INVENTORY block to define the colour of the empty cells in the inventory. Again, red green and blue are obvious :-) PLAYER { your_char } This is used inside a SYSTEM block and defines the player at the start of the game. your_char is an ITEM declared in a proper manner. POSITION { x y z } // No. 1 This is udes inside an ITEM block to specify the starting location of it. x y and z are the coordinates in a Cartesian system. Remember that the adventures are in 2D and the 3rd is just imagination... But you can use the third coordinate if your item is elevated. So other items can walk below it :-) The image is positioned placing its BOTTOM-CENTER point in the x, y, z coordinates. Same for SETPOSITION and other "move" commands. POSITION { number } // No. 2 TROUBLESOME!! Used inside the SYSTEM sub-blocks (WALK, VERB...) it defines where it will be put. Useful if you want to swap space between verbs and inventory or move the command line under the big blocks of interface. Range is 0...4 and it can be put in: WALK (to move command line), *any* of the VERBs block, to move the *entire* verb panel, INVENTORY to move it. Sintax: 0 South/Bottom 1 East/Right [Small place... inventory must be put in Center] 2 North/Top 3 West/Left 4 Center PROC name { list of to-do things } This is used inside a ROOM block, or in no block at all (concept of visibility). name is how you want to call it, and the list of things is as for EVENT or COMMAND blocks (more or less...) A procedure can be run at any time by typing using the CALL command. Example: PROC greeting { SAY your_hero "Hello, I'm very pleased to meet you" } ... ... COMMAND talk_to unmet_guy { CALL greeting SETLABEL unmet_guy "Not Anymore A Stranger Guy®" } This example is REALLY useless, but could be simple enough to understand the role of procedures and how they're called. :-) There are TWO special procedures: OnEntry and OnExit. They must be declared inside a ROOM block and will be run EVERYTIME you enter or exit that room. Example: ROOM stinking_room { ... PROC OnEntry { WAITSAY your_hero "Heck! Somebody should take a bath! And it's not me!" } PROC OnExit { WAITSAY your_hero "Phew... I couldn't stand it anymore!" } ... } ROOM { a lot of blocks } No, you can't be reading this... you can't... ROOMVAR => NOT YET USEFUL. This will be covered later on... Same for ITEMVAR, STRING and System Variables. SCALE { numberA percentageA numberB percentageB } This is used inside a ROOM block and defines the scaling of that room, which means how the images'll be stretched walking the room. numberA is the pixel which has percentageA. It's near the top... numberB is the pixel which has percentageB. It's near the bottom... Example: SCALE { 0 0 240 100 } means that: * Your screen size is at LEAST 240 pixels long. * at height 0 (top) an image will be 0% tall. * at height 240 (bottom or near bottom) an image'll be 100% tall. If you put a top-number which is NOT 0, CHECK that the walkable area does NOT allow the player to go above. Otherwise the game will do something unexpected: how do you like a -10% percentage?!? :-) If you put a bottom-number which is not the bottom of the screen you'll get a percentual higher than 100% which can be useful in certain scenes :-) SCREEN { width height } This is used inside a SYSTEM block and defines the PLAYABLE area. Verbs and inventory panel have same width and are "attached" to the bottom of this "screen". Examples: (should be right) Old time Lucas (Indy3/4, MI1/2, Loom): 320x142 Old time Lucas... but bigger: 640x324 SENTENCE { number_of_items "string" } // No. 1 This is used inside a VERB block and tells the engine that the specified verb wants number_of_items to work and the separator will be string. number_of_items may be a '*' too, meaning "no limit" Example: VERB give_to { LABEL { "Give" } SENTENCE { 2 "to" } } SENTENCE { number } // No. 2 This is used inside an ITEM block to tell the engine the selected item requires another item to be used with. Example is Indy's whip :-) number may be a '*' too, which you should easily understand :-) SIZE { number } // No. 1 This is udes inside an INVENTORY block and defines the number of items displayed at once (divide for two and you have the number of items per row) It's used in TALK block to specify the number of answers displayed at once. It can be used in a VERB block to define the number of rows in the verbs panel. SIZE { width height } // No. 2 This is used inside an ITEM block and defines the dimensions of it. This can be useful if you want to have an ITEM without an image (maybe you don't need an image to be declared, imagine it's already on the background). SPEED { number } This is udes inside a SYSTEM block, and means the number of pixels moved for each frame. A lower speed means a more accurate smoothness, a higher speed means jumps! STRING { a b c d ... } This is used to declare a STRING variable. If you don't know what a string or a variable is, you better learn it somewhere else... a C++ manual maybe! As for the INTEGER variables, STRING ones can be initialized during declaration. This way: STRING { first_string {"First string"} second_string {"Guess what?"} } If you don't initialize a string, it will be blank (that is: "") SUPER This command has to do with inheritance in Java and C++ programming language. As Chir told me: "SUPER is [...] complicated to explain. My file STLDLIB.ADV tries to use it a bit." SYSTEM { lot of things } You should know it... it's like ROOM and ITEM... the BASICS OF THE ENGINE! Anyway, this keeps the blocks which define the look of the game, speed, screen size, default player, look of verbs panel... TALK { lot of things } Used inside a SYSTEM block, it defines the properties of the talking part of the game. Answers displayed, color... TITLE { LABEL { "Write what you want" } } This is used inside a SYSTEM block and defines the text to appear in the program windows. You can put an image in there too: it'll appear depending on the POSITION setting. :-) Sintax is: TITLE { LABEL { "Main window title text" // Guess what is this... "Text appearing in ABOUT window" // Again, guess what? } IMAGE { "path/filename" } POSITION { 0 } // Bottom of interface. } NOTE: both the window titles are OPTIONAL. :-) THEN { list of things to do } This is used together with IF. If you don't know it, study some programming language! :-) If the statement in the brackets of IF is TRUE, the engine does what's been told in the THEN statement. The list of things to do is equal to the ones inside a COMMAND block. VERB name { list of blocks } This is used inside a SYSTEM block and defines a verb of the panel. name is the name of the verb, as it will be used in COMMAND verb_name object Example: VERB Pull { LABEL { "Tira" } // This is italian... learn it, might come useful someday! INK { 137 123 241 } PAPER { 33 16 148 } // You should get a blue interface ICON { "gr/tira.gif" } /* The image you'd like to use. NOTE: if ONE image is wider than the others, every button'll have ITS (larger) width! Use images with the same size. */ KEY { "t" } // Press t to get "Tira" in the upper bar. } NOTE: in the making of the verb and inventory panel, the engine first makes room for the verbs (three fixed rows, variable number of columns) then for the inventory objects, so watch your sizes carefully :-) NOTE: if you declare four verbs, you get a 2x2 panel. WALK { "path/filename" } // No. 1 This is used inside a ROOM block together with the IMAGE block. It defines the walkable area of a room. It's a two color image: white => can walk. black => can't walk. WALK { list of blocks } // No. 2 This is used inside a SYSTEM block to define the look of the command line. Example: WALK { LABEL { "Vai verso" } // Italian for "Go to" INK { 255 255 255 } // Color of text: white. PAPER { 0 0 0 } // Background of text: black. KEY { "v" } // Shortcut } WHILE { lot of things } This is used together a THEN command. Esample: WHILE { LT a 10 } THEN { .... } What is specified in the THEN block will be done until a is lesser than 10. Obviously the THEN block must have a way to increment a, otherwise you will get a neverending loop! -------------------------------------------------------------------------------- 2. System variables These are default variables recognized by the parser. NOT YET USEFUL, will be implemented in newer releases of the engine. CurrentRoom Used with EQR. Example: IF { EQR CurrentRoom road } THEN { .... } If the character is in the room named road, what's in the THEN block will happen. CurrentPlayer Both used with EQI and SAYI. Example of EQI: IF { EQI CurrentPlayer bad_hero } THEN { SETPLAYER good_hero } If you're playing the wrong version of the game (EQI Current Player bad_hero gives a TRUE result) you'll change to the right one ;-) Example of SAYI: SAYI CurrentPlayer "I'm the player! Wow, I can't believe it!" Regardless of the identity of the player, he/she/il will speack :-) Argv1 Not yet used. Argv2 Not yet used. -------------------------------------------------------------------------------- 3. Procedures These are what I call "commands" not to be confused with the COMMAND block header. ADD IntVar int This adds the INT value to the one already stored in IntVar. In a good programming language (C/C++) you get: IntVar = IntVar + int ADDANSWER "text" int This adds the specified text to the conversation panel, with the specified integer ID. See the tutorial for programming dialogues. ADDV IntVar1 IntVar2 This adds to the value stored in IntVar1, the value stored in IntVar2. In a programming language you get: IntVar1 = IntVar1 + IntVar2 ATTITUDE item int => OBSOLETE Equivalent to SETATTITUDE. CALL procedure_name Used everywhere to call an already defined procedure. See PROC block for examples. CLRANSWER Empty the conversation panel. See the tutorial for programming dialogues. DELANSWER int This is used to remove the answer corresponding to the int from the conversation panel. See the tutorial for programming dialogues. EXIT Quits the engine immediately (no "save before closing" confirmation). Nice copy-protection tool ;-) Remember, though: games developed with MAGE/IJ *must* be free as the engine. GIVE actor item Moves the item into actor's inventory. GOTO room_name Jumps to specified room. Equivalent to TRANSITION room_name 0 GOTOTRANSITION room_to_go "text" Jumps to specified room, using the specified custom plug-in as visual transition effect. It's quite similar to TRANSITION, but lets you use even your own custom defined transition effects. You define (you have to know Java) an effect, label it, then you can call it with this command. You can call standard transition effects too: Example: GOTOTRANSITION room_to_left "4" TRANSITION room_to_left 4 Note that those two commands have the same effect :-) In IJ homepage there is a file called ij_transition.zip which explains how to make the custom transitions. :-) LET IntVar int Stores the value of int in the IntVar. In programming language is: IntVar = int LETI ItemVar Item Associates the Item to the Item Variable (declared in the ITEMVAR block). LETS StringVar "text" Stores the text inside the StringVar. LOAD "filename" This is used everywhere to load a pre-compiled game (GAG). You can use it to change from Part I to Part II, or to Intro to Game... whatever! :-) What is in one .gag ISN'T in another .gag UNLESS you put it in the .adv file and compiled it. I mean: the maximum visibility range is a single .adv file, so a single .gag file. LOCATE item x y z => OBSOLETE Equivalent to SETPOSITION. MOVE item x y z This is used to have the item "walk" towards the specified coordinates in the current room. This overrides the WALKABLE AREA of the room. See WALK too. MOVETO itemA itemB This is used to move ItemA towards ItemB. It tries to collide moving towards it regardless of the WALKABLE AREA of the room. See WALKTO too. MULT IntVar int This stores in IntVar the value of IntVar (before multiplication) * int In a programming language is: IntVar = IntVar * int MULTV IntVar1 IntVar2 As in MULT, storing the value into IntVar1. In a programming language is: IntVar1 = IntVar1 * IntVar2 ORIENTATE item int => OBSOLETE Equivalent to SETORIENTATION. PLACE item room_name This puts the item into the room_name. Need further explanation? ;-) The item gets placed with the same coordinates it has before movement. RAND IntVar This puts a random value between 0 and 1000 in the specified variable. SAY item "text" This makes the item say the specified sentence. Sentences are centered on the item. See WAITSAY too. SAYI ItemVar "text" This makes the specified item stored in the ItemVar say the specified text. Same for SAY. SAYIS ItemVar StringVar Makes the item stored in ItemVar say the string stored in StringVar. SAYS item StringVar Makes this item say a STRING (See) SETALPHA item number => Requires Java 1.2 Changes the transparency level of the specified item. Default = 100 (no transparency). See also ALPHA block. SETANIMATION item attitude orientation "path/filename" frames Changes the animation of an item for the specified attitude and direction. See ANIMATION or IMAGE block for further infos. SETATTITUDE item number Changes the attitude of an item. See IMAGE block. SETBGSOUND item attitude "path/filename" Changes the sound associated to a specific item's attitude. SETICON item { "path/filename" } Changes the inventory icon of an item. SETIMAGE item int1 int2 { "path/filename" } Changes the image of an item. int1 is the attitude (See ANIMATION) and int2 the direction. Equivalent to SETANIMATION int1 int2 { "path/filename" } 1 SETINK item int Changes the speech color of an item. See INK for the colors. SETLABEL item "label" Changes the label of an item with the new one. SETLIGHTING item red green blue opacity This is used to change the look of an item. Think of it as this: the engine makes a fake image, identical to the one of item. This image is entirely of of ONE color, defined by red green and blue values. Then the engine mixes the original image with this in this way: opacity is 0 => The result is the original image. opacity is 100 => The result is the "fake" image. So, opacity tells the percentage of "fake" image to get mixed. If you think you could explain all this with fewer words than me... JUST DO IT and email me your version :-) SETMAPMODE number Switches interface to/from "map" mode. Valid integer values are 0 and 1. Map set to 1 means that your verbs, arrow and inventory panels will disappear, as for the walk panel. ITEM labels will be displayed above ITEM images. SETMOTIONBLUR number => Requires Java 1.2 This is used to have anything appearing on the screen (image or sentence) leaving behind a trail. number may vary between 0 and 100. 0 is a neverending trail. 100 is no blur at all. 30 is a good value for a good blur. SETORIENTATION item number This is used to orientate the item in the specified direction. The direction number is the same as in the IMAGE block. SETPLAYER item Switches control to the specified actor, automatically changing rooms if necessary. SETPOSITION item x y z Instantly moves the item to the specified (x,y,z) location in the item's current room. The first 2 coordinates are absolute pixel position within the background picture, with point (0,0) being the topleft corner of the background. The third coordinate is the elevation from the floor (normally zero). Used together with PLACE when moving items from a room to another. SETROOMBGSOUND room_name { "path/filename" } Changes the background music of a room with the new one. SETSCALE item int Changes the scaling factor for a specific item. SETSPEED item number Changes the walking speed of an item. Number may range between 1? to ?? 1 => Does not move at all. 15 => Moves in a liiiitle hurry. 100 => Instant travel! Scotty, beam me up! *** HOW DOES THE NUMBER WORK? I STILL DON'T KNOW *** SETTRAIL number Makes all items leave a trail behind them when they move. Valid integer values are 0 and 1. With 1 you'll leave the trail. Setting back to zero the trail will disappear. SETVERBLABEL verb "new_label" Changes the appearent name of a verb in the interface. Not the name you use to refer to the verb, but the text displayed in the upper system area. SLEEP number Freezes execution during the specified number of milliseconds. SOUND "path/filename" Plays once the specifies sound file. SPEAK item "text" "path/filename" Makes the item say the specified text while pronounce a recorded sentence. It uses any filetype which is supported by JRE, so read the documentation. STOPSOUND Interrupts the latest SOUND instruction (if still playing). TRANSITION room_to_go number Jumps to specified room, using the specified visual transition effect, according to the following codes: 0: no visual transition (jump immediately) 1: fade to black from center. The current room gets erased by an increasing black rectangle, then the rectangle decreases size and the new room is painted. 2: fade to black from left. Screen gets erased from left to right, and new room painted from right to left. 3: fade to black from top. Screen is erased form above, and new image painted from bottom. 4: scroll left. New ROOM scrolls into view from left. 5: scroll right. New ROOM scrolls into view from right. 6: scroll up. New rooms scrolls into view from under the screen. 7: scroll down. New rooms scrolls into view from above the screen. 8: smooth mix. The two rooms are progressively mixed until old one vanishes and new one is complete. NOTE: Requires Java 1.2 9: smooth fade to black. The room is filled in black, then the light comes back and you're in the new room. NOTE: Requires Java 1.2 NOTE: TRANSITION only works with standard effects. To use custom programmed effects you have to use GOTOTRANSITION. TURN item1 item2 This makes item1 turn to look at item2. WAIT item Takes control out of the player while the specified item is busy (talking or walking). See WAITMOVE, WAITSAY and other for additional info. WAITANSWER var Used for dialogue programming. Look at some tutorials. WAITMOVE item x y z Equivalent to MOVE item x y z followed by WAIT item. The control will be took out of the player until the item has stopped moving. WAITMOVETO itemA itemB Same for MOVETO command followed by WAIT instruction. WAITSAY item "text to be said" Equivalent to SAY item "text" followed by WAIT item. The control will be took out of the player until the sentence has been told. WAITSAYI ItemVar "text to be said" Equivalent to SAYI item "text" followed by WAIT item. The control will be took out of the player until the sentence has been told. WAITSAYIS ItemVar StringVar Equivalent to SAYIS followed by WAIT. WAITSAYS item StringVar Equivalent to SAYS followed by WAIT. WAITSOUND "path/filename" Freezes execution while the specified sound is being played. WAITVIDEO "path/filename" Freezes execution while the specified video is being played. WAITSPEAK item "text" "path/filename" Equivalent to SPEAK followed by WAIT. WAITWALK item x y Equivalent to WALK item x y followed by WAIT instruction. Command will be took out of the player until the command has been accomplished. WAITWALKTO item1 item2 Equivalent to WALKTO item1 item2 followed by a WAIT instruction. WALK item x y Sets the destination of the item to the specified (x,y) location in the item's current room. The item will try to reach the position by walking towards it, within the 'walk area'. Unlike MOVE, only 2 coordinates are needed here, since the item will not change the third one during the walk. WALKTO item1 item2 Item1 will walk towards Item2 following the restrictions of the walkable area image. -------------------------------------------------------------------------------- 4. System procedures These are special procedures of the game. See PROC block header for info. OnEntry Used inside a ROOM, is performed as the scene moves to the room. OnExit Used inside a ROOM, is performed as the scene moves out of the room. OnClick This has been introduced in MAGE v1.0a and simplifyes the mapview mode. Look at IJ episode_0.adv file. -------------------------------------------------------------------------------- 5. Functions These are used to perform checks. They're usually used inside IF blocks. COLLISION item1 item2 Checks if two items have collided. EQ IntVar int Checks if var is equal to int. EQI ItemVar item Checks if var is equal to item. EQR RoomVar room Checks if var is equal to room. EQS StringVar "text" Checks if var is equal to text. EQSV StringVar1 StringVar2 Checks if StringVar1 is equal to StringVar2 EQV IntVar1 IntVar2 Checks if IntVar1 is equal to IntVar2 GE IntVar int Checks if var is greater/equal to int. GEV IntVar1 IntVar2 Checks if IntVar1 is greater/equal to IntVar2. GT IntVar int Checks if IntVar is greater than int. GTV IntVar1 IntVar2 Checks if IntVar1 is greater than IntVar2 INSIDE Checks if item2 is located within item1's bounding box. It's very similar to COLLISION with this difference: COLLISION happens when you click on item1 and item2 (your player usually) reaches/touches it. INSIDE happens whenever item2 overlaps item1, even if you didn't click on item1. ISPLAYER item_name Checks if the item currently under player's control is item_name LE var int Checks if var is lower or equal to int LEV IntVar1 IntVar2 Checks if IntVar1 is lower or equal to IntVar2 LT var int Checks if var is lower than int LTV IntVar1 IntVar2 Checks if IntVar1 is lower than IntVar2 NE var int Checks if var different from int. See NOT truth table :-) NEV IntVar1 IntVar2 Checks if IntVar1 is different from IntVar2 PRESENT item room Checks if the specified item is currently into that room. TAKEN actor item Checks if the specified item is currently into the actor's inventory. -------------------------------------------------------------------------------- 6. Boolean Operators These should not need any explanation. They're used inside IF blocks. { ... } AND { ... } This is TRUE when BOTH expressions are TRUE. Exp A | Exp B | Result True | True | True True | False | False False | True | False False | False | False { ... } OR { ... } This is TRUE when AT LEAST ONE expression is TRUE. Exp A | Exp B | Result True | True | True True | False | True False | True | True False | False | False NOT { ... } This is TRUE when expression is FALSE. Exp A | Result True | False False | True -------------------------------------------------------------------------------- 7. Appendix & Hints -------------------------------------------------------------------------------- a. INDY.INI file This files has been first introduced in MAGE v1.0a and keeps some useful informations. Line starting with a # are comments and will be ignored by the engine. ICON=file.extension This is the icon of the game, and has to be a self-made 256 color gif image. It will appear both in the taskbar and in the upper right corner of the window. LOGO=file.extension This is the image which appears once the engine is ready. Not to be confused with SPLASH.GIF, image which will be displayed *while* the engine loads. It can be of any size. If no image is declared, engine will be very small :-) This does not affect the .gag files!! AUTORUN=file.gag This is the name of .gag file which will start with engine. If you declare a valid .gag file, as soon as you run indy.jar, you'll get the engine running that .gag file. RUN=file.gag This is the name of .gag file which will start on MENU - NEW selection. PAGE_HELP=file.txt This is the .txt file displayed in Help window. PAGE_HOME=url This is an URL which will be opened with the browser if you click in the about - "homepage" SHOW_IMPORT This can be 'true' or 'false' and enables the import button in the main menu. If you are developing, it should be true. If you are releasing a game, it will likely be false. WINDOW_X This is used to determine where the window will popup. It means the pixels between the left side of the window and the left border of the monitor. If you omit the value, it will appear at the horizontal center. WINDOW_Y Like WINDOW_X but with the height from the top of the monitor. If you omit the value, it will appear at the vertical center. MENU LABELS does not need any explanation... RIGHT? -------------------------------------------------------------------------------- NOTE: this following "b" section is now obsolete: things seem to work fine after installation. I don't delete it, though, for convenience sake. b. Running the game as Application (not inside Browser) in Win9x environment. Since Windows 95 (the one I'm using) is really stupid, and Sun's Java is not any smarter, once you install JRE or JDK, you won't be able to run I.J. games. Trick is this: PART 1: Either copy JAVA.EXE or JAVAW.EXE in your %Windows% directory or add JRE/JDK's path in PATH environment in Autoexec.bat This will enable you to run .jar files with a double click on them, WHEREVER you put them. PART 2: Make a indijava.bat file which contains one of these lines: JAVAW -jar INDY.JAR => If you just want to start the game and play it. JAVA -jar INDY.JAR => If you want to keep open the DOS/JAVA window where the debug informations are shown. Useful when something does not work :-) PART 2.1: If you have choosen to have the debug window, you have to make a link to the bat file, right click on it, go to "program", choose "close on exit" and then OK. This way, when the engine is shut down, the DOS/JAVA window will be closed too. If you don't do this, the window will stay open until you manually close it. -------------------------------------------------------------------------------- c. FULL SCREEN With v.1.0a of engine comes a file called SCREEN.DLL. This file enables full screen for games. Screen size depends on the WIDTH of your game screen while the HEIGHT depends on it with a ratio of 4:3 (320x240). If you screen is taller, you'll have verbs and inventory panel cut out. Remember that panels use 147 pixels of height, more or less. SCREEN.DLL affects games RUN and not games imported. Full screen can be disabled runtime using the window menu. If you want to disable it "once and for all" just delete file SCREEN.DLL from IJ tree directory. ------------------------------------------------------------------------------- d. Choosing your resolution If you want your game to be played at full-screen, you'll have to set it so that the screen size has a ratio of 4:3 (width:height). An example is 320x240, 400x300, 640x480, 800x600, 1024x768. All of them have that ratio. Once you choose your resolution, you'll have to set up the SCREEN block (See for details) remembering that it's the PLAYABLE area, and not the window size. Remember that the bigger the window, the slower the game. I suggest you not to use a resolution higher than 640x480. Let's assume you choose 400x300. SCREEN wants two numbers: width and height. Width is really easy: 400! Height requires some (easy) calculations: Resolution "y" (300 pixels in the example) - Game menu' (it's *always* 18 pixels) - Walk area (it's *always* 23 pixels) - Verb/Inventory panel (depends on you) - Optional underbar (depends on you) = ------------------------------------------------ SCREEN "y" The Verb/Inventory panel is made this way: the number of rows multipled the height of each button (if you're using images for the buttons) plus seven pixels. In this example we have three rows (the old Lucas style) and we use buttons of 20 pixels. Verb/Inventory: (20*3)+7 = 67 pixels. Let's add an underbar of 20 pixels! So, in this example, we get: 300 -18 -23 -67 -20 = 172 pixels. SCREEN { 400 172 } For your information, this is the resolution used for Adventures of a Future Generation! ------------------------------------------------------------------------------- *** This line closes this file. If you can read this, you have *** *** successfully downloaded this file! ***