/
ags.tex
20153 lines (14859 loc) · 746 KB
/
ags.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentstyle[a4,makeidx,verbatim,texhelp,fancyhea,mysober,mytitle]{report}%
%\input{psbox.tex}
\newcommand{\commandref}[2]{\helpref{{\tt $\backslash$#1}}{#2}}%
\newcommand{\commandrefn}[2]{\helprefn{{\tt $\backslash$#1}}{#2}\index{#1}}%
\newcommand{\commandpageref}[2]{\latexignore{\helprefn{{\tt $\backslash$#1}}{#2}}\latexonly{{\tt $\backslash$#1} {\it page \pageref{#2}}}\index{#1}}%
\newcommand{\indexit}[1]{#1\index{#1}}%
\newcommand{\inioption}[1]{{\bf {\tt #1}}\index{#1}}%
\parskip=10pt%
\parindent=0pt%
\backgroundcolour{255;255;225}\textcolour{0;0;0}% Has an effect in HTML only
\title{Adventure Game Studio 3.2.1}%
\author{by Chris Jones}%
\makeindex%
\begin{document}%
\maketitle%
\pagestyle{fancyplain}%
\bibliographystyle{plain}%
\pagenumbering{roman}%
\setheader{{\it CONTENTS}}{}{}{}{}{{\it CONTENTS}}%
\setfooter{\thepage}{}{}{}{}{\thepage}%
Welcome to Adventure Game Studio! This new Windows Help version of the manual should
help you get even more out of AGS. Enjoy!
\tableofcontents%
\chapter*{Copyright and terms of use}%
\setheader{{\it COPYRIGHT}}{}{}{}{}{{\it COPYRIGHT}}%
\setfooter{\thepage}{}{}{}{}{\thepage}%
Copyright (c) 1999-2010 Chris Jones.
THE SOFTWARE IS PROVIDED 'AS-IS' AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
IN NO EVENT SHALL CHRIS JONES BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE
POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
NO MONEY WHATSOEVER MAY BE CHARGED FOR ADVENTURE GAME STUDIO UNLESS EXPRESS
WRITTEN PERMISSION IS GIVEN BY THE AUTHOR. IF YOU PAID FOR THIS, THE SELLER
IS BREACHING THE TERMS OF DISTRIBUTION OF THIS APPLICATION.
AGS is an adventure game creation system. As such, it is provided to you in
good faith by the author. Chris Jones cannot be held responsible for the
contents of any works created with AGS, including but not limited to any which
infringe on copyright, are libellous or contain offensive material.
Please use AGS responsibly.
AGS allows user-made "Plugins" to be incorporated into games created by the system.
These Plugins can access all standard Windows functionality and are therefore
not protected from system functions as the scripting language is.
Chris Jones cannot be held responsible for any Plugins for AGS which you use
in your game. Any problems with the Plugin should be addressed to its author.
Anything you distribute which has been created with AGS \bf{MUST} retain the Version resources
unaltered in order to display the AGS version and copyright in the Version tab of the EXE
properties.
Please note that this is the \bf{only} evidence that remains that your game was created
with AGS - I do not place any splash screens or copyright messages in your game, and
leaving the version tab is all I ask.
TrueType font display uses ALFont by Javier Gonzalez and the Freetype project. Distributed
under the terms of the Freetype Project license.
OGG Vorbis player is alogg by Javier Gonzalez, using the Ogg Vorbis decoder, which is available
from http://www.xiph.org/ . Copyright (c) 2002, Xiph.org Foundation
OGG Theora player is APEG by Chris Robinson, using the Ogg Theora decoder, which is
Copyright (C) 2002-2008 Xiph.Org Foundation and contributors.
MP3 player is almp3 v2.0.4, by Javier Gonzalez and the MPG123 team. It uses the mpg123 MP3 decoder,
and again is distributed under the terms of the GNU Lesser General Public License version 2.1.
Copyright information on the various other modules AGS uses can be found in the
\helpref{credits}{Credits} section.
Pentium is a trademark of Intel corporation.
Windows is a trademark or registered trademark of Microsoft corp.
\chapter{Introduction}%
\Large{Adventure Game Studio}
\large{Copyright 1999-2010 Chris Jones}\hrule
Welcome to AGS!
Adventure Game Studio allows you to create your own point-and-click adventure
games like the old Sierra and Lucasarts classics, but with modern features
such as digital music and alpha blending.
AGS is based around an easy-to-use IDE, where you can set up all the parts of
your game, and then add some script to process game events. Making a game
has never been so productive!
To get started, \helprefn{read the tutorial}{StartingOff}.
\section{System Requirements}%
To run the Editor, you need a Windows-based PC with at least 128 MB RAM and
the .NET 2.0 Framework installed (games you create do \bf{NOT} require the framework).
Any games you create have at least these system requirements:
\begin{itemize}\itemsep=0pt
\item Pentium or higher processor
\item 64 Mb RAM
\item Windows 98, ME, 2000, XP or Vista with DirectX 5 or above
\item Supports all DirectX-compatible sound and video cards
\end{itemize}
Depending on your game's resolution and colour depth, you may have higher requirements.
The processor required is as follows:
\begin{itemize}\itemsep=0pt
\item 320x200, 256-colour: Any Pentium-class system
\item 640x400, 256-colour: 266 Mhz or above
\item 800x600, 256-colour: 500 Mhz or above recommended
\item 320x200, 16-bit colour: 233 Mhz or above
\item 640x400, 16-bit colour: 500 Mhz system minimum, may need faster if you use large objects
\item 800x600, 16-bit colour: 600 Mhz system minimum, may need faster if you use large objects
\item 320x200, 32-bit colour: 300 Mhz or above
\item 640x400, 32-bit colour: 700 Mhz system minimum, may need faster if you use large objects
\item 800x600, 32-bit colour: 900 Mhz system minimum, may need faster if you use large objects
\end{itemize}
These requirements are not an exact science though - game speed is affected by many
factors, including how many objects/characters are on the screen, whether background music
is playing, the complexity of your scripts, and more. The best way to determine the requirements
of your game are to test it on different computer configurations.
\chapter{The run-time engine}\index{Engine}\index{Run-time engine}\index{Interpreter}%
The engine (also called the "interpreter") is what runs your game and is what
the end player will use.
If you are using the default interface, then you use the right mouse button to
cycle between the available 'modes', and the left button to use the current
mode on the mouse position. You can also move the mouse to the top of the
screen to bring up the icon bar where you can directly select a mode.
To exit the engine, press Ctrl-Q. You can save your game position using F5
and restore with F7.
The controls described above work with the default setup; however, you can
customize your game to use a different interface and shortcut keys.
\section{The demo game}\index{Demo game}%
The first thing you'll probably want to do is to run the demo game. This
game will try to show you some of what AGS can do.
To run the demo, choose the "Open the Demo Game" option from the AGS folder
in your start menu. If you're looking for the files, they're located in the
All Users Application Data folder (this is for compatibility with Windows Vista's
new security filters).
\bf{NOTE:} The demo game is currently under development. It has various unfinished
or unimplemented areas.
\section{Graphics driver selection}\label{GraphicsDriver}\index{Direct3D engine}%
AGS has two different graphics drivers when run on Windows -- DirectDraw and Direct3D.
DirectDraw is the 'classic' software graphics driver, that AGS has used ever since
the initial Windows version was released. It's perfectly fine for simple games
that don't use many large sprites, tinting or alpha blending. It's also quite fast
at doing RawDrawing to the screen.
Direct3D is a new, hardware accelerated graphics driver. It uses the Direct3D 9.0 to
render the game in a fully hardware-accelerated environment. This means that the
game will run a lot faster if you use features such as alpha blending and tinting,
which are quite slow to perform in software mode. However, with Direct3D doing RawDraw
operations can be quite slow, and the driver won't work on all graphics cards.
No matter which you choose as your default graphics driver, the player can always
run the Setup program and switch to using the other driver if they are having problems
on their PC.
\bf{System Requirements}
\bf{DirectDraw}: any Windows-based PC with DirectX 5 or later installed ILBRK
\bf{Direct3D}: any Windows-based PC with DirectX 9.0 installed and a graphics card designed
for DirectX 8.1 or later (most cards manufactured from 2003 onwards).
If you get the error message "Graphics card does not support Pixel Shader 1.4" on startup,
this indicates that your graphics card is too old to run with the Direct3D driver. You
should choose the DirectDraw driver instead.
See Also: \helprefn{System.HardwareAcceleration property}{System.HardwareAcceleration}
\section{Run-time engine setup}\index{Setup}%
The engine Setup program allows the player to customize certain game settings.
Firstly, they can change the game resolution. If they do so, all your game
graphics will automatically be stretched or shrunk to fit, and the option is a
handy way for the player to start the game if their system won't run at the default
resolution for some reason.
They can also select to run the game in a window on the desktop rather than full-screen.
This will take a performance hit though, so it's always preferable to run full-screen.
The "Use 85 Hz display" option sets the monitor refresh rate to 85 Hz to run the game, which
eliminates flicker. However, this does not work on all monitors, and not at all on flat
panel displays, which is why it is disabled by default.
The "Force alternate letterbox resolution" option is only available for 320x200 and 640x400
modes, and tells AGS to actually run at 320x240 or 640x480 instead, with black 'letterbox'
borders at the top and bottom of the screen. This is useful because some computers no longer
support the 320x200 or 640x400 resolutions, but do support the letterboxed versions.
"Smooth scaled sprites" will apply anti-aliasing to scaled characters, in order to
give a smoother look to the resizing. This can slow down the game though, so it is off
by default.
Finally, the "Downgrade 32-bit graphics to 16-bit" option is only available for 32-bit games.
It allows people with slower PCs to choose to play the game at 16-bit instead, in order
to boost performance. If they use this, the graphical quality will reduce, but it should at
least allow them to play the game at a decent speed.
\chapter{Tutorial}%
This section will introduce you to the AGS by leading you through how to
create a simple game.
\section{Starting off}\label{StartingOff}%
The tutorial has now been updated for AGS 3.0. Follow the links below
to run through it.
\urlref{Tutorial Part 1 - Creating the game}{acintro1.htm}
\urlref{Tutorial Part 2 - Creating your first room}{acintro2.htm}
\urlref{Tutorial Part 3 - Hotspots and events}{acintro3.htm}
\urlref{Tutorial Part 4 - Objects}{acintro4.htm}
\urlref{Tutorial Part 5 - Managing inventory}{acintro5.htm}
\urlref{Tutorial Part 6 - Using your own graphics}{acintro6.htm}
\urlref{Tutorial Part 7 - Animations and cutscenes}{acintro7.htm}
\urlref{Tutorial Part 8 - Conversations}{acintro8.htm}
\urlref{Tutorial Part 9 - Cursors and fonts}{acintro9.htm}
For the latest version of the tutorials, always check the AGS website.
\section{Setting up the game}\label{Settingupthegame}%
Now that you know how to create a room, it's time to set up the game-wide
settings. These include inventory items, sprite graphics, palette setup
and other things which do not depend on individual rooms.
\subsection{Palette setup}\label{PalSetup}%
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 \bf{CANNOT} use hi-colour sprites or backgrounds
in a 256-colour game.
You set your chosen colour depth by opening the General Settings pane and
adjusting the Colour Depth setting near the top of the list.
Now, choose the "Colours" 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.
\bf{IMPORTANT NOTE:} \it{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.
You can right-click in the palette grid to export 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 "Replace palette" option replaces the 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.
\subsection{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 items" node. Here, each item
has a number and a script name which you use in scripts to identify the object.
To create a new item, right-click on the "Inventory items" node.
Double-click on an inventory item to open it up. On the
left you'll see the graphic used for the object in the inventory window. To change
this, select the "Image" entry in the property grid on the right, and click the "..."
button.
The last thing to do with the inventory items is to define their events:
what happens when the player manipulates them in the inventory window. Click
the "Events" button (the lightning bolt button at the top of the property grid),
which brings up a list which works identically to the hotspot events.
The available events are described in the reference section.
\it{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
separate 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 Inventory icon on the icon bar. 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 "Hotspot Marker Settings" frame at the top of the
Inventory pane. This allows you to switch on an option so that when the
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.
\subsection{Importing your own sprite graphics}\index{Alpha blended sprites}%
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 \bf{Sprites} 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 "Replace sprite
from file". To import a new slot, right-click on the background to the window
and choose "Import new sprite".
The graphic you choose to import 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). AGS will attempt to convert the image if possible, but if
your game is 256-colour then the results of downgrading a hi-colour image
can be poor.
Then, the Import Sprite window will appear. Here, you need to decide which portion
of the image will be imported. You do this by right-clicking and dragging in the
image, which will produce a yellow rectangle showing the selection. Once you are
happy with it, left-click to import.
Alternatively, you can import the entire image with the "Import whole image" button.
\it{NOTE (256-colour only):
You may well find that the colours on your graphic look slightly strange in
the AGS Editor. This is because the sprites are only allocated, by default,
the first 41 of the palette colours (see the \helpref{palette section}{PalSetup}), 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 too long. 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 delete a folder by right-clicking on it and selecting the "Delete"
option; beware though that \bf{this will also delete all the sprites in the folder}.
* \it{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.}
\bf{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, use the "Import from file" option 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.
\bf{Alpha blended sprites}
AGS supports alpha blended sprites if your game is 32-bit colour. In this case, you
need to import a PNG 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.
\bf{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.
\subsection{Introduction sequences}\index{Cutscenes}%
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. This is defined by the starting room
number of the player character. To change it, open up the player character's
Character pane, and change the StartingRoom number in the property grid.
\it{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 have some experience of how
to use these functions.
\subsection{Animations}\label{Views}\index{Views}%
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" node, right-click it and select the "New view"
option to create us a new, empty view. Double-click the new view to open it.
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.
You select a frame by left-clicking it -- when you do so, the property grid
will update with information about the frame. One of these settings is
called "Delay", which is the frame's \bf{relative} speed. 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 delay to make it particularly fast, for example setting
it to -3 means that the frame will stay for hardly any time at all. ILBRK
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).
The "Sound" propery allows you to 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 script animation commands, which will
be explained in detail later. Briefly, 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.
\subsection{Characters}\index{Idle animations}%
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 \helpref{View Editor}{Views}, 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:
\begin{verbatim}
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
\end{verbatim}
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.
\bf{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.ILBRK
\bf{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 \bf{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.
\it{NOTE: Because importing always creates a new slot, you cannot use it to
overwrite an existing character.}
\subsection{Conversations}\index{Dialogs}\index{run-script}\index{add-inv}\index{goto-dialog}\index{new-room}\index{option-off}\index{option-on}\index{option-off-forever}\index{play-sound}\index{return}%
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:
\begin{itemize}\itemsep=0pt
\item The "Show" column specifies whether that option is available to the player
at the start of the game.
\item 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.
\end{itemize}
\bf{Dialog scripts}
You control what happens when the player chooses an option by editing
the script on the right. This is called the \bf{dialog script}, and is a
simplified version of scripting streamlined for conversations.
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
\begin{verbatim}
ego: "I am very happy today because it's my birthday."
\end{verbatim}
The character name is used by the system to choose the correct colour for
the text.
\bf{IMPORTANT:} Do \bf{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 \verb$...$ 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,
\begin{verbatim}
@1
ego: "Hello. How are you?"
narrator: The man looks you in the eye.
otherman: ...
otherman: "I'm fine."
return
\end{verbatim}
"return" tells AGS to go back and display the choices again to the player.
If you use "stop" instead of return, then the conversation is ended. Alternatively,
you can use "goto-dialog" or "goto-previous", which abort the current dialog script
and transfer control to the new dialog.
\bf{NOTE:} Do \bf{NOT} indent these lines with spaces or tabs. Indented lines
signify that AGS should interpret the line as a normal scripting command
rather than a dialog scripting command.
The dialog commands available are:
\begin{itemize}\itemsep=10pt
\item \bf{goto-dialog X} ILBRK
Switches the current topic to Topic X, and displays the current list of
choices for that topic.
\item \bf{goto-previous} ILBRK
Returns to the previous topic that this one was called from. If the dialog
started on this topic, then the dialog will be stopped.
\item \bf{option-off X} ILBRK
Turns option X for the current topic off, meaning it won't be displayed in
the list of choices next time.
\item \bf{option-off-forever X} ILBRK
Turns option X off permanently. It will never again be displayed, not even
if an "option-on" command is used.
\item \bf{option-on X} ILBRK
Turns option X for the current topic on, including it in the list of choices
to the player next time they are displayed.
\item \bf{return}ILBRK
Stops the script and returns to the list of choices.
\item \bf{stop} ILBRK
Stops the conversation and returns the player to the game.
\end{itemize}
For an example of a dialog script, load the demo game into the editor and
look at the script for its topic 0.
\bf{Using scripting commands in dialogs}
Often the provided dialog scripting commands won't be enough for what you want
to do in the dialog. You might want to give the player an inventory item or
add some points to their score, for example.
AGS now lets you put normal scripting commands in your dialog script, by indenting
the line with spaces or tabs. For example:
\begin{verbatim}
@1
ego: "Hello. How are you?"
narrator: The man looks you in the eye.
player.AddInventory(iKey);
Display("This line is displayed from a normal script command");
otherman: "I'm fine."
return
\end{verbatim}
Here, you can see dialog script commands being used, but also then a
couple of normal scripting commands have been inserted, on indented lines.
When working with dialog scripts, the \bf{this} keyword allows you to access
the currently running dialog.
If you want to conditionally break out of the dialog
script, the special tokens \verb$RUN_DIALOG_GOTO_PREVIOUS$, \verb$RUN_DIALOG_RETURN$
and \verb$RUN_DIALOG_STOP_DIALOG$ are available which you can \verb$return$ from inside
a script block. For example:
\begin{verbatim}
@1
ego: "Hello. How are you?"
narrator: The man looks you in the eye.
if (player.HasInventory(iKey)) {
player.Say("Actually, I'd better go.");
return RUN_DIALOG_STOP_DIALOG;
}
otherman: "Here's a key for you."
return
\end{verbatim}
\bf{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 \helprefn{text parser}{TextParser} section
for more info.
\subsection{Game options}\index{options}\index{Anti-aliasing fonts}\index{Crossfading music}%
The Game Settings pane contains a list of all the various overall options
that you can set for your game.
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.
\begin{itemize}
\item \bf{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 \helprefn{Debugging features}{Debuggingfeatures} section for more.
\item \bf{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.
\item \bf{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.
\item \bf{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.
\item \bf{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.
\item \bf{Text windows use GUI} - allows you to customize the standard text window
appearance in the game, using the specified interface element. See \helpref{here}{TextWin}
for more information.
\item \bf{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.
\item \bf{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.
\item \bf{When interface disabled} - determines what happens to buttons on your
GUIs while the game interface is disabled (eg. during a cutscene).
\item \bf{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.
\item \bf{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. ILBRK
However, if you set this option to Sierra-style then the talking view is used to display an
animating portrait separately 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. ILBRK
"Whole Screen" uses a full-screen character portrait, like the way that QFG4 worked.
\item \bf{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.
\item \bf{Room transition style} - defines what type of screen transition is used when
moving from one room to another. Various options are available.
\item \bf{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.
\item \bf{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.
\item \bf{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.
\item \bf{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.
\item \bf{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.
\item \bf{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 screen 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.
\item \bf{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.
\item \bf{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.
\item \bf{Resources split every Mb} - see \helpref{here}{SplitRes} for information.
\item \bf{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.
\item \bf{Override built-in inventory window click handling} - AGS has some built-in processing
of Inventory Window GUI controls, whereby a right-click will Look at the item, and a left click
will select it if the cursor mode is Interact. However, if you enable this
option, then clicking on an inventory item in an Inventory Window will call your \verb$on_mouse_click$
function with eMouseLeftInv, eMouseMiddleInv or eMouseRightInv, and you then need to process it
yourself. You can use the \verb$game.inv_activated$ variable to find out what they clicked on.
\item \bf{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.
\bf{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.
\item \bf{Number dialog options} - adds an index number before each dialog option when
they are displayed to the player. For example,
\begin{verbatim}
1. Hello there!
2. Goodbye
\end{verbatim}
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.
\item \bf{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.
\item \bf{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.
\item \bf{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).
\bf{NOTE} that anti-aliasing is not currently done on lucasarts-style speech due to
technical reasons.
\item \bf{Thought uses bubble GUI} - Determines which text window GUI is used for displaying
thoughts with \helprefn{Think}{Character.Think}.
\item \bf{Characters turn to face direction} - if set, then when a character turns round
with the \helprefn{Character.FaceLocation}{Character.FaceLocation} or \helprefn{Character.FaceCharacter}{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.
\item \bf{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.
\item \bf{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.
\item \bf{Save games folder name} - if this is blank, then the player's saved games will
be saved to the folder where the game is installed. This is not a good idea, because it
forces different users on the same machine to share save games, and Windows Vista discourages
games from writing to the Program Files folder. Instead, if you supply a folder name here,
then AGS will automatically create it within the user's Saved Games (Vista) or My Documents
(XP and earlier) folder, and their save games will be saved there.
\end{itemize}
See Also: \helprefn{Enhanced Saved Games}{EnhancedSaveGames} ILBRK
See Also: \helprefn{Windows Vista Game Explorer}{GameExplorer}
\subsection{Cursors}\index{Mouse cursors}%
The Cursors node of the editor shows you the current mouse cursor modes available in
the game. Each cursor mode performs a different action within the game. Double-click