Setting up the game

From AGS wiki

Jump to: navigation, search
This article is an entry in the AGS Manual.
Please do not edit this entry except to wikify it, or keep it up-to-date with the manual or current AGS version. Instead you can discuss this article here.
This page was last modified 29 July 2009, and could be out of date with the current AGS version. If you see a page is out of date, please update it!

Owning entry: Tutorial

 

Now that you know how to create a room, it's time to set up the game-wide settings. These include inventory objects, global messages, palette setup and other things which do not depend on individual rooms.

Contents

Palette setup

The first thing you need to do when you create a new game is to decide whether you want to use 8-bit (palette-based) colour or 16-bit (hi-colour). If you want to use 16-bit colour, you can still use 256-colour backgrounds and sprites if you want to, but the engine will only run in a 16-bit colour resolution, thus slowing it down. If you want to use 8-bit (because it runs faster), you need to set up the palette. This is because all sprite and background scene imports rely on the palette setup to be the same. You CANNOT use hi-colour sprites or backgrounds in a 256-colour game.

Choose the "Palette" pane. Here you will see the 256-colour palette displayed in a grid. Most of the slots are marked "X" - these are the slots reserved for the background pictures, and will be different in each room. The other colours will be as they look here for the entire game. These fixed colours allow things like the main character graphics, which must be displayed on more than one screen, to work.

If you want, you can assign more or less colours to the backgrounds. To toggle the background assignment on/off, click on the slot, then check the "This colour is room-dependant" box to swap the slot's status.

IMPORTANT NOTE: You must set up the palette as you want it before you start making your game - if you change it later, you will have to re-import all the sprites and background scenes.

You can select multiple colour slots by clicking on the first slot, then shift-clicking on the last slot in the range you want to select. You can then toggle the background status of all the selected slots at once.

The "Export pal" button exports the entire palette to a .PAL or PCX file which you can then use to read back into the Editor in a different game. If you choose to export to a pcx file, then a screen shot of the Palette Editor will be saved as the picture. This way you can see all the game-wide colours in the file.

The "Import pal" button replaces the selected palette entries with those entries from the PAL or PCX file you choose. It can read standard 768-byte PAL files, SCI palette resources (renamed to extension .pal) and JASC PSP palette files.

Inventory

Most adventure games allow the player to carry a set of objects, which he can then use to solve puzzles. Adventure Game Studio makes this inventory easy for you to manage. Every inventory item which the player may carry during the game at one time or another is listed under the "Inventory" pane. Here, each item also has a number which you use in interactions to identify the object. The left hand side of the screen lists all the items in the game. On the right is the graphic used for the object in the inventory window. To change this, click the "Change image" button, then select the new graphic from the dialog which appears.

If you want the player to start the game with this item in his inventory, check the "Player starts with this item" check-box. To create a new item, click the "New item..." button. You will be asked for the new item's name, and then it will be assigned the next available number.

The last thing to do with the inventory items is to define their interactions: what happens when the player manipulates them in the inventory window. Click the "Interaction" button, which brings up a window which works identically to the hotspot interactions. The available events are described in the reference section.

NOTE: Several limitations apply to the commands you can use in the Inventory interactions. This is because they must run from all rooms, and so cannot have any room-specific commands. In particular, do not use any Object commands, and if you use a "Display message" command, then it must display a global message.

To give the item to the player during the game, you use the "Player - Add inventory" and maybe "Object - Remove object" commands. The inventory number required by the former command is the item number from the list described above. Remember that an inventory item is NOT the same thing as an object.

NOTE: Each character in the game carries their own set of inventory items. This means, if you want to create a game like Day of the Tentacle, where the player can control three different characters, each character will have a seperate inventory.

You have two choices about how the inventory is displayed to the player -- a built-in inventory window to get you started, and support for custom inventory windows when you're ready to make your own.

The default option is the Sierra-style pop-up inventory window, which is popped up by clicking on the Bag icon on the icon bar (which uses the text script InventoryScreen function to display it). You can also have the current inventory item displayed in its own button on the icon bar by creating a button on the GUI and setting its text to (INV) which stretches the item picture to the button size, or (INVNS) which draws the inventory item picture straight onto the button with no resizing. Finally, (INVSHR) , probably the best option, will draw it at actual size if it will fit, or shrink it if not.

The other option is a custom inventory window. To use this, you will need to edit the GUI to add it, so I will explain this later on. While you are starting off with AGS, it is recommended to use the supplied standard Sierra-style inventory window.

Finally, you may have noticed a "Draw hotspot dot" checkbox at the bottom of the Inventory pane. If you check this, then when the player selects an inventory item, the mouse cursor for it will have a dot and mini-crosshair drawn on it, to show the player where the hotspot is. You can enter the colour for the centre dot and also for the surrounding 4 pixels.

Importing your own sprite graphics

When you were choosing the graphics for the object earlier in this tutorial, you probably noticed that most of the graphics available didn't look up to much. This is no problem, because you can import your own graphics using the Sprite Manager. Go to the Sprite Manager pane in the editor. Here, you will see the complete sprite set for the game. There are two ways to import your graphics - either overwrite an existing slot with your graphic, or create a new slot for it.

To overwrite an existing sprite, right-click the sprite and select "Import over this sprite". To import a new slot, right-click on the background to the window and choose "Import new sprite".

When you choose either of these options, a window appears which has a couple of options in it, and a big "Import from File" button. If your game is hi-colour, you also get an option to paste from the clipboard* (see note below).

To import your graphic, click the "Import from File" button. The graphic you choose must be at the same colour depth as your game (ie. if you are using hi-colour backgrounds, your sprites must be hi-colour, and vice versa). The picture is displayed on-screen.

If you move the mouse over the image, you'll notice a rectangle following the cursor around. This is the portion of the image that will be imported when you click the left mouse button. To resize the rectangle, click and drag the right mouse button. Or, you can import the entire image with the "Grab entire image" button.

NOTE (256-colour only): You may well find that the colours on your graphic look slightly strange in the Room Editor. This is because the sprites are only allocated, by default, the first 41 of the palette colours (see the palette section), so your graphic will be remapped to this much smaller palette. If you find that many of your imported sprites look strange, you can increase the number of colours assigned to sprites, at the expense of background colours (again see the section above for information on how to do this).

If your sprite will only be used in one room then alternatively you can use the "use background palette" option, which will remap your graphic to the palette of the room currently loaded, giving much better results. Note, however, that if you do this, and then try and use the sprite on another screen, its colours will most likely be screwed up. To use the room palette, check the "use bkgrnd pal" check-box. Make sure to un-check this box before you import any other sprites.

NOTE: The transparent colour used by AGS is palette index 0 (for 256-colour sprites) and RGB (255,0,255) for hi-color. Any pixels you draw on imported sprites in these colours will be transparent.

You can group imported sprites into folders. This prevents the main sprite list from becoming very long (and you can only have 200 sprites per folder anyway). By default, the Sprite Manager displays the Main folder, which contains some graphics and a sub-folder called "Defaults". Folders work the same way as Windows folders. Right-click on a folder in the tree to rename it or make a sub-folder.

You can move sprites by dragging them into a different folder in the folder list. You can delete a folder by right-clicking on it and selecting the "Delete" option; beware though that this will also delete all the sprites in the folder.

NOTE: A few people have experienced problems when importing from clipboard, in that the image colours get reversed (red becomes blue, blue becomes red, and so on) when they are running Windows at 24-bit or 32-bit colour. If this happens to you, there are two solutions: (a) turn down your desktop colour depth to 16-bit to run the AGS Editor, or (b) import your sprites from files rather than the clipboard.

Tiled sprite import

You may have noticed a checkbox called "Tiled sprite import". Some people find this a useful way of importing many frames of a character's animation at once.

In order for this to work, you need to have all your sprites lined up on your source bitmap at even intervals. Then, click "Import from file" and import it as usual. Check the "Tiled sprite import" box, and select the upper-left frame.

When you click the left mouse button, the selection rectangle will become un-filled and now you can drag the mouse to define how many frames to import - they'll all be enclosed by selection rectangles. Once you have the correct number, click the left button again and they will all be imported.

Alpha blended sprites

AGS supports alpha blended sprites if your game is 32-bit colour. In this case, you need to import a PNG or TGA image with an alpha channel (you cannot paste alpha-blended images from the clipboard).

When you do so, AGS will prompt you asking whether you want to use the image's alpha channel or not. If you select Yes, then the sprite will be drawn alpha blended in the game if it is used for a character, object, mouse cursor or GUI.

Note that if you use alpha blending, any overall transparency that you set (such as Character.Transparency, Object.Transparency, GUI.Transparency) will be ignored.

NOTE: Currently, alpha blended sprites cannot be antialiased, so if you have the Anti Alias Sprites option turned on in Setup, it will not be applied to alpha-blended characters.


Global Messages While each room has its own set of messages ("local messages"), in some situations you need to be able to display a message from more than one room, or in a global game interaction which is not related to a room. For this purpose global messages are provided. Choose the "Global messages" pane. Here you are presented with a list of the 500 available global message slots. By default, they are all empty except messages 983-999 which contain the default messages for actions on the player character, the Save Game dialog box, and so on. Global messages are numbered between 500 and 999 so that they are not confused with local room messages.

To display a global message, simply use its number in any "Display message" command.

You can include a couple of variables into global (and local) messages. You do this by inserting special tokens into the message. When the message is displayed in the game, the engine replaces the token with its value:

token   replaced by
@INx@  number of inventory item x that the player has
@GIx@  the current value of GlobalInt x (used with SetGlobalInt/GetGlobalInt)

The default global messages are used as follows:

983   text when save/load disabled ('sorry, not now' is the default)
984   text for "Restore" button in Restore game dialog
985   text for "Cancel" button
986   the top "Select a game to restore" text
987   text for "Save" button in Save Game dialog
988   the header "Type a name to save as:" text
989   text for "Replace" button when save folder is full
990   header text "The folder is full, you must replace a game"
991   text header "Replace:"
992   header "With:"
993   text for Quit button in Quit dialog
994   text for Play button in Quit dialog
995   header text "Are you sure you want to quit"
996   message displayed if player clicks Inventory but has no items
997   default interaction for talking to player character
998   default interaction for interacting with player character
999   default interaction for looking at player character

You can of course change any of these messages to customize your game.

Introduction sequences

You can easily add intro, outro and cutscene sequences to your game. There is no specific function to do these, but using the provided animation and script commands you can create almost anything you might need. Normally, the game will start in room 1. However, you can change this to any room you want. Go to the "Characters" pane. Make sure that the main character is selected in the list on the left. You will see on the right hand side "Start in room:" followed by "1". This is the starting room for the player character, and it is this entry that decides which is the first room loaded.

Set the starting room to room 0. Now, when you run the game, the intro will be the first room loaded. In this room, you will probably want to disable the main character (if you want a logo graphic up first). Remember, you do this through Room Editor -> Settings -> Player character visible.

TIP: The starting room facility is also useful when testing your game - you can make the game start in any room, at the point where you are testing it, rather than having to keep playing the game through to get there.

Cutscenes are created using the normal animation script commands, such as Character.Walk, Object.SetView, and so forth. I would suggest you leave this until you are more comfortable with AGS, and can appreciate how things are done.

Animations

In most games you will use some sort of animation during the game, whether it be a flag waving in the breeze or the player bending over to pick something up. The term "animation" refers to the ability to change the look of, and move, objects. Animations in AGS are managed using Views. A "view" is a set of one or more "loops". A loop is a set of frames which, when put together, give the effect of movement. Each frame in the view can be set a graphic and a speed. Go to the editor's "Views" pane. This is the View Editor. Here you will see the main character's walking view.

Click the "New view" button to create us a new, empty view. Each loop is displayed horizontally with its number at the left hand side, frames going out to the right. To add a frame, click the grey "New frame" button. To delete a frame, right-click it.

To change a frame's graphic, double-left-click it. The sprite list screen will be displayed (you may remember this from the Object graphic selection) where you can choose the graphic you want to use for this frame.

Note that for walking animations, the first frame in each loop is reserved for the standing frame, and when walking it will only cycle through from the second frame onwards.

Below each frame you will see "SPD:0". This is the frame's relative speed, which you can change by clicking on the word "SPD:". The larger the number, the longer the frame stays (ie. the slower it is). When the animation is run, an overall animation speed will be set, so the actual speed of the frame will be: overall_speed + frame_speed . Note that you can use negative numbers for the frame speed to make it particularly fast, for example setting it to -3 means that the frame will stay for hardly any time at all. Animation speed is specified in Game Loops (ie. animation speed 4 will show the frame for 4 game loops - at 40fps, that would be 0.1 seconds).

You will also see something marked "NO SND". If you click this, you can enter a sound number that will be played when this frame becomes visible on the screen. This is especially useful for footstep sounds.

You run an animation by using the interaction editor or script animation commands, which will be explained in detail later.

To animate an object, you first of all need to set the object's view to the correct view number (use the Object.SetView script command), and then use the Object.Animate script command to actually start the animation.

Characters

A character is similar to an object, except that it can change rooms, maintain its own inventory, and take part in conversations (more on these later). It can also have its own custom animation speed and movement speed.

Go to the "Characters" node in the main tree. You will see under it a list of all the characters in the game. To create a new character, right-click the "Characters" node and choose the "New character" option.

You will see that there are a lot of options which you can set for each character. The most immediately obvious one is the "Make this the player character" button, which allows you to change which character the player will control at the start of the game. When the game starts, the first room loaded will be this character's starting room.

The rest of the options are hidden away in the property grid on the right. Some of them are described below:

The "UseRoomAreaScaling" option allows you to specify whether this character will be stretched or shrunk in scaling areas of the screen. You might want to disable this if you have a character who always stands still in the same place, and you want the graphics on-screen to be the same size as you drew them, even though he is standing on a scaled area.

The "Clickable" option tells AGS whether you want the player to be able to click on the character. If Clickable is enabled, then the character will be interactable, like the way things worked in Sierra games. If it is not enabled then the character works like the main character did in Lucasarts games - if you move the cursor over him or click to look, speak, etc, then the game will ignore the character and respond to whatever is behind him.

To set which room this character starts in, change the "StartingRoom" property. You can set the character's location within this room by using the "StartX" and "StartY" properties to type in the X,Y co-ordinates you want him to start at. These co-ordinates define where the middle of his feet will be placed.

The "NormalView" is where you set what the character looks like. You must create a view in the View Editor, and this view must have either 4 or 8 loops. If you use 4 loops, then when walking diagonally the closest straight direction is used for the graphics. Each loop is used for the character walking in one direction, as follows:

Loop 0 - walking down (towards screen)
Loop 1 - walking left
Loop 2 - walking right
Loop 3 - walking up (away from screen)
Loop 4 - walking diagonally down-right
Loop 5 - walking diagonally up-right
Loop 6 - walking diagonally down-left
Loop 7 - walking diagonally up-left

To change the rate at which the character animates, change the Animation Speed box. Here, a smaller number means faster animation. Note that this does NOT effect the speed at which the character actually moves when walking.

NOTE: The first frame in each loop is the standing still frame. When walking, the game will cycle through the rest of the frames in the loop.

The "MovementSpeed" option allows you to control how fast the character moves when walking. Here, a larger number means he walks faster. If you find that a movement speed of 1 is still too fast, you can use negative numbers (eg. -3) which will move even more slowly. The lower you go, the slower the movement speed.

The "SpeechColor" option specifies which colour is used for the text when this character is talking. It effects all messages that are said by this character. You can find out the colour for each number by going to the "Colours" pane.

The "IdleView" option allows you to set an idle animation for the character. To do this, create a new view, with one or more loops of the character idle (eg. smoking, reading a book, etc). Then, set the "Idle view" to this view number. If the player stands still for 20 seconds (you can change the timeout with the Character.SetIdleView script function), then the current loop from the idle view will be played.

The "ScriptName" property sets the name by which the character will be referred to in scripts and in conversation scripting. The difference from the RealName of the character is that the script name may only contain letters A-Z and numbers 0-9 (the first character must be a letter, however). The convention in AGS is that character script names start with a lower case "c".

To set what happens when the player interacts with the character, click the "Events" button (this is the lightning bolt button at the top of the property grid). You will be presented with the events list; select an event and press the "..." button to allow you to enter some script to handle the event.

You can also set a talking view for the character. To set one, use the "SpeechView" property. If you set a talking view, then that view will be used to animate the character while they are speaking. You should generally have about 2-3 frames in each loop (the loops are used for the same directions as in the main view).

There is also an available "Blinking view". This is used to play intermittent extra animations while the character is talking. You may want to use this for effects such as blinking (hence the name). If you set a view here, it will play intermittently while the character talks (it is drawn on top of the normal talking view). The default time between it playing is 3-4 seconds, but you can change this with the Character.BlinkInterval script property.

NOTE: the blinking view is currently only supported with sierra-style speech.

"UseRoomAreaLighting" allows you to tell AGS whether this character will be affected by light and tint levels set on room regions.

If you disable "TurnBeforeWalking", it will override the General Setting for turning and tell AGS not to turn this particular character around on the spot before they move.

"Diagonal loops" specifies that loops 4-8 of the character's view will be used for the four diagonal directions. If this option is not enabled, the character will only face 4 ways, and you can use loops 4-8 for other purposes.

"Adjust speed with scaling" modifies the character's walking speed in line with their zoom level, as set on the walkable areas.

"Adjust volume with scaling" modifies the volume of any frame-linked sounds on the character's view (eg. footstep sounds) with their zoom level, as set on the walkable areas.

"Solid" specifies that this character is solid and will block other characters from walking through it. Note that both characters must be solid in order for them to block one another.

AGS allows you to export your characters to a file, and then import the file into a different game - so you can share the same main character between games, or create one for distribution on the internet. Right-click on the character and choose "Export character". The entire character setup and graphics will be exported to the file, including the character's walking and talking animations. To import the character into a different game, load it up, right-click the "Characters" node and choose "Import Character". The file selector appears, where you find the CHA file which you exported earlier. A new character slot will be created and all the settings imported.

NOTE: Because importing always creates a new slot, you cannot use it to overwrite an existing character.

Conversations

While the old Sierra games were mainly based on action and not talking, the Lucasarts games took the opposite approach.

If you want to create a game with conversations where the player can choose from a list of optional topics to talk about, you can now with the new Dialog Editor. Go to the "Dialogs" node.

Conversations are made up of Topics. A "topic" is a list of choices from which the player can choose. You may have up to 30 choices in a topic. However, not all of them need to be available to the player at the start of the game - you can enable various options for conversation once the player has said or done other things. For example, when you talk to the man in the demo game, the first option is just "Hi". Once he has said this, however, a new option becomes available.

The Dialog Editor is quite self-explanatory. Double-click a dialog topic to open up its window. You'll see the list of options for the topic on the left, and the dialog script on the right. Each option has a couple of checkboxes to its right:

  • The "Show" column specifies whether that option is available to the player at the start of the game.
  • The "Say" column defines whether the character says the option when the player clicks it. The default is on, but if you want options describing the player's actions rather than the actual words, you may want to turn this column off for that dialog.

You control what happens when the player chooses an option by editing the script on the right. This is NOT the same script language as the main event scripts use - it is a much simplified and easier to understand language specific to dialogs.

With a newly created dialog topic, all you will see in the script is a number of lines starting with an '@' symbol. In the dialog script, these signify the starting points of the script for each option. For example, when the player clicks on option 3, the script will begin on the line following "@3". There is also a special starting point, called "@S". This is run when the conversation starts, before any choices are given to the player. This could be used to display a "Hello" message or something similar.

To display some speech, you begin the line with the character's SCRIPT NAME (not full name), followed by a colon, then a space, and then what you want them to say. For example, if my main character's script name is EGO, I would write

 ego: "I am very happy today because it's my birthday."

The character name is used by the system to choose the correct colour for the text.

IMPORTANT: Do NOT include the "c" at the start of the character's script name here.

You can also use the special character name "narrator", which displays the text in the pop-up message box instead of as speech text; and the alias "player", which will say it as the current player character - useful if you don't know which character the player will be controlling when they speak the conversation.

If you just use ... as the text for a character to say, the game will pause briefly as if they are stopping to think, and nothing will be displayed.

To signal the end of the script for this option, place a "return" command on the last line of it. For example,

@1
ego: "Hello. How are you?"
narrator: The man looks you in the eye.
otherman: ...
otherman: "I'm fine."
return

This tells the program to go back and display the choices again to the player. If you use "stop" instead of return, then the conversation is ended. You use this after the player saying "Goodbye" or something similar.

The dialog commands available are:

add-inv X Adds inventory item X to the current player's inventory. This does the same thing as the AddInventory script command, but is provided here because it is frequently used in dialogs.

give-score X Gives the player X points, and plays the score sound if appropriate.

goto-dialog X Switches the current topic to Topic X, and displays the current list of choices for that topic.

goto-previous Returns to the previous topic that this one was called from. If the dialog started on this topic, then the dialog will be stopped.

lose-inv X Removes inventory item X from the current player's inventory. This does the same thing as the LoseInventory script command, but is provided here because it is frequently used in dialogs.

new-room X Takes the player to room X, and aborts the conversation. Since this does not allow you to specify co-ordinates, you may need to use some Player Enters Screen logic in the target screen to place the character properly.

option-off X Turns option X for the current topic off, meaning it won't be displayed in the list of choices next time.

option-off-forever X Turns option X off permanently. It will never again be displayed, not even if an "option-on" command is used.

option-on X Turns option X for the current topic on, including it in the list of choices to the player next time they are displayed.

play-sound X Plays sound effect X, similar to the Play Sound interaction command.

return Stops the script and returns to the list of choices.

run-script X Runs global script function "dialog_request", with X passed as the single parameter. This allows you to do more advanced things in a dialog that are not supported as part of the dialog script. The "dialog_request" function should be placed in your game's global script file, as follows:

 function dialog_request (int xvalue) {
   // your code here
 }

set-globalint GI VAL Changes script GlobalInt number GI to have the value VAL. This is equivalent to the SetGlobalInt script command, and allows you to quickly set things without having to go through a run-script just to set an int value.

set-speech-view NAME X Changes character NAME's talking view to X. NAME must be their script name, and X is the number of the new talking view. Use this to easily change their facial expression during a conversation.

stop Stops the conversation and returns the player to the game.

For an example of a dialog script, load the demo game into the editor and look at the script for its topic 0.

Parser input

You'll notice in the dialog editor, the property grid has an option called "ShowTextParser". If you enable this, a text box will be displayed below the predefined options in the game, which allows the player to type in their own input.

If they type in something themselves, then the dialog_request global script function will be run, with its parameter being the dialog topic number that the player was in.

AGS automatically calls ParseText with the text they typed in before it calls dialog_request, so you can use Said() calls to respond. See the text parser section for more info.

Game options

On the Game Settings pane you may have noticed quite a lot of check-boxes. These set gamewide options, and mean the following things. Note that some things listed here are explained later in the documentation, so if you don't understand one of the items in this list, come back to it later.

Most of these options can be changed at runtime with the script command SetGameOption.

Debug Mode whether the debug keys are active. When debug mode is on, you can press Ctrl-X to teleport to any room, Ctrl-S to give all inventory items, Ctrl-A to display walkable areas on the screen, and Ctrl-D to display statistics about the current room. When debug mode is off, these do nothing. See the Debugging features section for more.

Play sound on score controls whether a sound effect is played when the player scores points. If so, you can set the sound number, which will play SOUNDx.WAV (or SOUNDx.MP3), where X is the number you set.

Walk to hotspot in Look mode - controls whether the player will walk to "walk-to" spots when the player looks at the hotspot. Normally he only walks on use, speak and use-inv.

Dialog options on GUI - controls where the player's options for dialog are displayed. If this option is not checked, then in a conversation, the options will be displayed at the bottom of the screen. If you check this box, then instead the options will be displayed on the GUI you specify.

Use anti-glide mode - you may notice that, as the character walks, it can seem as if he is gliding, especially if you have a slow animation speed setting. When anti-glide mode is on, the man's position is only updated when the frame of animation changes. You will need to increase each character's walking speed if you use this option.

Text windows use GUI - allows you to customize the standard text window appearance in the game, using the specified interface element. See here for more information.

Pixel gap between options - defines the gap between the options displayed to the player in a conversation. Normally this is 0, which means the options are right below each other. Changing it to 1 or 2 can make the option display look less cluttered; it's a matter of personal preference.

Skip Speech - determines how and whether the player can skip speech in-game. This can be set to allow the mouse and/or keyboard, or neither, to skip speech in the game. When interface disabled - determines what happens to buttons on your GUIs while the game interface is disabled (eg. during a cutscene).

Always display text as speech - if you select this option, then all normal text in the game will be displayed above the main character's head as speech text, much like the way the Lucasarts games worked. If this option is not checked, then normal text appears in a pop-up message box, like the way that the Sierra games worked.

Speech style - in the default Lucasarts-style speech, when a character talks, the speech text is displayed above their head in the game, and the character's talking view is used to animate the actual character. However, if you set this option to Sierra-style then the talking view is used to display an animating portrait seperately in the top-left of the screen, with the text to the right of it. This is similar to the way that Space Quest 5, King's Quest 6 and other later Sierra games worked. You can also cycle to another option, "Sierra- style with background", which is the same except a text window is drawn behind the speech text to make it easier to read. "QFG4-style speech" uses a full-screen character portrait, like the way that QFG4 worked.

Speech portrait side - if you're using Sierra-style speech, then this determines whether the portrait appears on the left or the right of the screen. The "alternate" setting means it swaps sides whenever a different person talks, and the "Based on X position" setting means that the side of the screen is chosen depending on where the characters are standing.

Room transition style - defines what type of screen transition is used when moving from one room to another. Various options are available.

Save screenshots in save games - Saves a mini-screenshot of the player's current position into the save game file. This will create larger save game files, but it will mean that you can use a save game thumbnails GUI to make the save/load interface more professional.

Enforce object-based scripting - Puts the script compiler into strict mode, where it will not accept the old-style (pre-AGS 2.7) script commands. This should preferably be ticked, since you should no longer be using the old commands.

Left-to-right operator precedence - if this is ticked, then operators of equal precedence in the script will be evaluated left to right. For example, 5 - 4 - 3 could be interpreted as (5 - 4) - 3 or as 5 - (4 - 3), thus giving different results. You should always use parenthesis to clarify expressions like this, so that the operator precedence doesn't affect the result.

Pixel-perfect click detection - normally, when the player clicks the mouse, AGS just checks to see if the cursor is within the rectangular area of each character and object on the screen. However, if this option is checked, then it will further check whether the player clicked on an actual pixel of the object graphic, or whether it was a transparent part of the graphic. If this option is enabled and they click on a transparent pixel, then the hotspot behind the object will be activated instead. Don't automatically move character in Walk mode - normally, when you click the mouse in the Walk mode, the main character will move to where you clicked. However, if you want to create a game all viewed from a 1st-person perspective, and so don't have a main character, then selecting this option allows you to use the Walk mode for other things. If selected, then "Character stands on hotspot" events are instead triggered by clicking the Walk cursor on the hotspot.

Use letterbox (320x240 / 640x480) resolution - this option is only available if your game is 320x200 or 640x400, and it will tell AGS to run the game at 320x240 or 640x480 instead. The screeen will be "letter-boxed" - that is, there will be a black border top and bottom. You may want to use this option if you need a square pixel aspect ratio for your graphics.

Don't use inventory graphics as cursors - normally, when you select an inventory item the mouse cursor is changed into that item. However, if you want to create a Lucasarts-style game (where the inventory cursor is always a cross-hair), check this option and it won't be changed.

Don't scale up fonts at 640x400 - normally, if the player chooses 640x400, then the fonts will be scaled up to match. However, if you have drawn your fonts for the 640x400 resolution, use this option to stop them being stretched.

Resources split every Mb - see Distributing your game for information.

Characters turn before walking - specifies that when a character starts to walk somewhere, it will first turn round to face the correct direction using available animation frames, rather than just suddenly switching to face the right way.

Handle inventory clicks in script - normally, if the player clicks on an inventory item, it is processed internally by AGS. However, if you enable this option, then clicking an inventory item will call your on_mouse_click function with eMouseLeftInv or eMouseRightInv, and you then need to process it yourself. You can use the game.inv_activated variable to find out what they clicked on. This only works with custom Inventory GUI controls, not with the built-in InventoryScreen sierra-style window.


Enable mouse wheel support - if enabled, on_mouse_click can be called with the values eMouseWheelNorth and eMouseWheelSouth, which signify the user scrolling their mouse wheel north or south, respectively. NOTE: Not all mice have mouse wheels, and the DOS engine does not support the mouse wheel at all. Therefore, your game should never require the mouse wheel in order to be playable - it should only be used as a handy extra.

Number dialog options - adds an index number before each dialog option when they are displayed to the player. For example,

  1. Hello there!
  2. Goodbye

This allows you to visually show the player which option the shortcut keys will choose, as well as seperating the options if you don't use a bullet point. Dialog options go upwards on GUI - Normally, if you select a non-textwindow GUI for the dialog options, they will be printed from the top down. However, if you select this option they will go from the bottom of the GUI upwards.

Crossfade music tracks - This allows you to tell AGS to crossfade between your background music tracks. Crossfading means fading out the old track while fading in the new one when the music changes. You can select a crossfade speed from the drop-down list. There are some disadvantages to using this option - firstly, it's fairly slow, since AGS has to decode two music files at once. Secondly, it only works with OGG, MP3 and WAV music. You cannot crossfade MIDI, XM, MOD, S3M or IT music.

Anti-alias TTF fonts - If enabled, any TTF fonts you have in your game will be rendered to the screen anti-aliased. This can make them look a lot better, but it has two drawbacks - firstly, anti-aliasing is significantly slower than normal rendering, so you might want an option to allow the player to turn it off. Second, anti-aliasing only works in hi-color games (in 256-colour games, the output will look blurred and unreadable). NOTE that anti-aliasing is not currently done on lucasarts-style speech due to technical reasons.

Thought uses bubble GUI - Determines which text window GUI is used for displaying thoughts with Think. Characters turn to face direction - if set, then when a character turns round with the Character.FaceLocation or Character.FaceCharacter script commands, they will visibly turn around using their available loops. If this option is not set, they will immediately appear facing their new direction.

Write game text backwards - in-game text will be written right-to-left, ie. line breaks are worked out from the end of the sentence going backwards, and the last words are displayed first. This is used by languages such as Arabic and Hebrew.

Display multiple inventory items multiple times - normally, if the player has two of an inventory item, the item will still only be shown once in the Inventory window. If you check this option, however, then all the copies of the item that the player has will be displayed. Useful for RPG-style inventories.

Cursors

The Cursors mode of the editor shows you the current mouse cursor modes available in the game. Each cursor mode performs a different action within the game. The "Standard cursor mode" checkbox tells AGS that this is a 'normal' cursor mode - ie. using this cursor will generate an interaction on whatever is clicked on as usual. This mode applies to the standard Walk, Look, Interact and Talk modes, but you can create others too. Do not tick it for the Use Inventory mode, since this is a special mode.

The "Animate" checkbox allows you to specify that the mouse cursor will animate while it is on the screen. Choose a view number, it will use loop 0 of that view. You can make it animate only when over something (hotspot, object or character) by checking the appropriate box. The "Only when the mouse is moving" box allows you to do a QFG4-style cursor, where it only animates while the player is moving it around.

Three of the cursor modes are hard-coded special meanings into AGS:

Mode 4 (Use Inventory). This is special because the game decides whether to allow its use or not, depending on whether the player has an active inventory item selected.

Mode 6 (Pointer). This cursor is used whenever a modal dialog is displayed (ie. a GUI that pauses the game). Normally this is a standard arrow pointer.

Mode 7 (Wait). This cursor is used whenever the player cannot control the action, for example during a scripted cutscene. For a lucasarts-style game where the cursor disappears completely in this state, simply import a blank graphic over the wait cursor. For the standard modes,

  • Mode 0 will cause the player to walk to the mouse pointer location when clicked.
  • Modes 1, 2, 3, 5, 8 and 9 will run the interaction with the same name as the cursor mode.

Fonts

Adventure Game Studio allows you to replace the default font and to add your own. You can use both TrueType (TTF) and SCI fonts (Sierra's font format). SCI fonts can be created in two ways:

  • Extract the font from a Sierra game, using the SCI Decoder program available on the internet.
  • Create your own font and save it in SCI Font format, using the SCI Graphic Studio program.

There are also some fonts available on the AGS website.

Note that SCI fonts are faster to render than TTF fonts, and so may give your game a speed advantage. It's preferable to use a SCI font if you can.

Go to the "Fonts" pane. Here you can see all the current fonts by using the list on the left. You can create a new font slot by clicking the "New font" button. To import your font into the current slot, click the "Import font" button.

Fonts can have outlines. For lucasarts-style speech, outlines are really a necessity since they stop the text blending into the background and becoming un-readable. To outline a font, either click the "Automatic outline" radio button to have AGS do it for you, or you can use a specific font slot as the outline font (it will be drawn in black behind the main font when the main font is used).

NOTE: If you go to your Windows Fonts folder, you will not be able to select any fonts to import, since double-clicking them will open them up in the Windows Font Viewer. Unfortunately there is nothing I can do about this, you must either type the filename in manually, or copy the font to another folder and import it from there.

NOTE: Font 0 is used as the normal text font, and font 1 is used as the speech font. To use any additional fonts, the script functions SetNormalFont and SetSpeechFont can be used at runtime.

Personal tools
Advertisement