310
edits
mNo edit summary |
|||
(40 intermediate revisions by 12 users not shown) | |||
Line 1: | Line 1: | ||
==Deleting characters (and other items)== | ==Deleting characters (and other items)== | ||
Please refer to [[AGS Editor & User Interface#Deleting stuff besides sprites and frames|this entry]]. | |||
==Using 3D characters and backgrounds== | ==Using 3D characters and backgrounds== | ||
''Is it possible to use 3D characters/backgrounds in AGS?'' | ''Is it possible to use 3D characters/backgrounds in AGS?'' | ||
AGS doesn't support 3D files itself, but you can, however, render all images as BMP files and import them into AGS that way. AGS is an Adventure Game Studio, made to fit the styles of the older Sierra/LEC games like King's Quest I-VII, Quest for Glory I-IV, and Monkey Island I-III; therefore, 3D files aren't supported and probably never will be. For realtime 3D support, try 3D Game Studio. It'll cost you a couple hundred dollars though! | AGS doesn't support 3D files itself, but you can, however, render all images as BMP files and import them into AGS that way. AGS is an Adventure Game Studio, made to fit the styles of the older Sierra/LEC games like King's Quest I-VII, Quest for Glory I-IV, and Monkey Island I-III; therefore, 3D files aren't supported natively and probably never will be. However, there is a [http://www.adventuregamestudio.co.uk/forums/index.php?topic=22615 3D background module and plugin]. There is also an [http://www.adventuregamestudio.co.uk/forums/index.php?topic=26130.0 Easy3D module]. For realtime 3D support, try 3D Game Studio. It'll cost you a couple hundred dollars though! | ||
For 3D characters, you may even try [http://www. | For 3D characters, you may even try [http://www.adventuregamestudio.co.uk/forums/index.php?topic=23400.0 this plugin], but bear in mind that it's still in beta stage, and it current works only for the windows port. | ||
==Dithering and other mishaps in imported images== | ==Dithering and other mishaps in imported images== | ||
Line 36: | Line 24: | ||
Another problem could be that you are using the special ASCII quotes and/or apostrophes (i.e., “ ” ‘ ’ instead of " and '). Go through the string on the specified line and make absolutely sure that there are no special quotes or apostrophes. | Another problem could be that you are using the special ASCII quotes and/or apostrophes (i.e., “ ” ‘ ’ instead of " and '). Go through the string on the specified line and make absolutely sure that there are no special quotes or apostrophes. | ||
The [[Digraphs Module|Digraphs]] and [[SpriteFonts Module|SpriteFonts]] modules allow characters beyond the 128 to be used, but also to be typed easily. Digraphs can also be used to replace something like "a/" with antoehr character that has been redrawn to look like an a with an acute accent. | |||
Finally, check to make sure you are not displaying any blank strings. Might not be the problem, but it's worth checking. Also, the British Sterling Pound symbol is not supported, because it is not in the normal ASCII range. It might be on your keyboard (if you're in the U.K.), but it's not between ASCII 1 and 127. | Finally, check to make sure you are not displaying any blank strings. Might not be the problem, but it's worth checking. Also, the British Sterling Pound symbol is not supported, because it is not in the normal ASCII range. It might be on your keyboard (if you're in the U.K.), but it's not between ASCII 1 and 127. | ||
Line 64: | Line 54: | ||
''How on Earth do I create my own characters!?'' | ''How on Earth do I create my own characters!?'' | ||
* Go to the 'Characters' pane of the editor. | |||
* Press the 'New Character..' button, enter a name in the popup box and click 'OK'. | |||
* At the top of the screen, give your character a Script name - this will create the Script-o-name, which is how the character will be refered to when you're scripting. | |||
* '''Congratulations!''' You've just made your own Character. | |||
Now, the hard bit... | |||
The character you just created probably looks like the default character, Roger - he's not a bad looking chap, but a game full of him would be a bit much. So, you'll need to perform a little cosmetic surgery: | |||
* First, you'll need to create the frames for your character animation (e.g. walking and talking) in an art program of some sort. The Critics Lounge on the AGS forums has threads of recommendations for programs, as well as templates to help you with the animation. | |||
* Import your Sprites in to AGS, in the 'Sprite manager'. AGS can import graphics in '''.BMP, .GIF, .PCX, .PNG''' and '''.TGA''' formats. There are options to bulk import sprites, and to import all frames from an animated '''.GIF''' or '''.FLC''' animation file. Alpha channels are supported for '''.PNG''' and '''.TGA files''', if your game is 32-bit colour. | |||
* Assign your imported sprites to a View. You can do this one at a time in the 'View' pane of the editor, or assign multiple sprites at once in the 'Sprite manager' - Select them, right-click and choose 'Assign to view...'. Views are Made up of Loops - sequences of sprites that animate the character when it's facing a cetain direction. Most Views will have 4 Loops, or 8 for diagonal movement, ordered like this: | |||
Loop 0 - down (towards screen) | |||
Loop 1 - left | |||
Loop 2 - right | |||
Loop 3 - up (away from screen) | |||
Loop 4 - diagonally down-right | |||
Loop 5 - diagonally up-right | |||
Loop 6 - diagonally down-left | |||
Loop 7 - diagonally up-left | |||
(Diagonal movement isn't required, so if you don't have those sprites - just don't create those Loops.) | |||
* Go back to the 'Character' pane of the editor, and set your character to use the Views you just set up for it. | |||
There are a lot of other options in the Character editor, which are explained [http://www.adventuregamestudio.co.uk/manual/ags10.htm#topic10 in the manual]. | |||
==Character speech problems; Creating talking views== | ==Character speech problems; Creating talking views== | ||
Line 88: | Line 100: | ||
''How large exactly can my scrolling room be? Is there a limit?'' | ''How large exactly can my scrolling room be? Is there a limit?'' | ||
Prior to AGS 3.1, the maximum room height was 1,400 pixels (at 320x200 res) or 2,800 pixels (at 640x400). There is no restriction on width. At least...I don't think so... | |||
As of AGS 3.1 and later, there is no hard limit on the size of rooms. Note that pathfinding for walkable areas may be slow if the room is large enough. | |||
==How to end your game (win/lose/die) or kill off your character== | ==How to end your game (win/lose/die) or kill off your character== | ||
Line 117: | Line 131: | ||
Above I mentioned that it doesn't make any sense to end a game once a certain score had been obtained. This is because a game usually ends when a certain point in the story has been reached -- usually the ending. Then, the score is displayed and the player is usually told how many points he missed, or if he got all the scores. I suppose this would work for non-adventure games or some unorthodox types of adventure games. But hey, it's your game; do whatever you want! ;) | Above I mentioned that it doesn't make any sense to end a game once a certain score had been obtained. This is because a game usually ends when a certain point in the story has been reached -- usually the ending. Then, the score is displayed and the player is usually told how many points he missed, or if he got all the scores. I suppose this would work for non-adventure games or some unorthodox types of adventure games. But hey, it's your game; do whatever you want! ;) | ||
==Character pops up in weird place or not on walkable area from room to room== | ==Character pops up in weird place or not on walkable area from room to room== | ||
''My character is going from one room to the next, and he isn't landing on a walkable area, OR he's popping up in weird places. What's wrong?'' | ''My character is going from one room to the next, and he isn't landing on a walkable area, OR he's popping up in weird places. What's wrong?'' | ||
You're probably not specifying the exact coordinates that the character will start on in the new room. There are several ways to do this, but one easy way is to just call '''NewRoomEx()''' (or '''cEgo.ChangeRoom()''' for AGS V2.7 and above) when the character walks off the screen edge or stands on a region. | You're probably not specifying the exact coordinates that the character will start on in the new room. There are several ways to do this, but one easy way is to just call '''NewRoomEx()''' (or '''cEgo.ChangeRoom()''' for AGS V2.7 and above) when the character walks off the screen edge or stands on a region. | ||
Another way is to set up the ''Player enters room (before fadein)'' interaction in the new room to check player.PreviousRoom to see which room they just came from and set their x and y coordinates appropriately. This can also be done in the global script in the on_event function if you check for the room entering event and the current and previous rooms. | |||
==Character does not walk on any walkable areas== | ==Character does not walk on any walkable areas== | ||
Line 141: | Line 154: | ||
''What size do my characters have to be? Do they have to be the size of Roger? Is there a required size for characters?'' | ''What size do my characters have to be? Do they have to be the size of Roger? Is there a required size for characters?'' | ||
The rule of thumb is to make your character a little smaller than the height of the doorways (if any) in your game. If there are no doorways (what! no doorways?), then the other rule of thumb is to size them as large as they will ever be in the game. | The rule of thumb is to make your character a little smaller than the height of the doorways (if any) in your game. For example, if the average door is 100 pixels tall, make your character's sprite about 90 pixels tall. If there are no doorways (what! no doorways?), then the other rule of thumb is to size them as large as they will ever be in the game. | ||
By importing bigger sprites (images), you can resize the characters to whatever size you want. Although you can technically scale characters to values above 100%, up to 200%, doing so will result in blocky-lookng characters. If your character will never be larger than half of the game's screen height (say, half of 480), then you must scale your character to be about 240 pixels tall. | By importing bigger sprites (images), you can resize the characters to whatever size you want. Although you can technically scale characters to values above 100%, up to 200%, doing so will result in blocky-lookng characters. If your character will never be larger than half of the game's screen height (say, half of 480), then you must scale your character to be about 240 pixels tall. | ||
Line 161: | Line 174: | ||
''How do I display the left bracket ( [ )? Do I have to encapsulate this character or use some other special characters to show it?''' | ''How do I display the left bracket ( [ )? Do I have to encapsulate this character or use some other special characters to show it?''' | ||
If you're using AGS V2.62 or earlier, it's not possible, we're afraid. Since "[" is used to add a line break, you can't normally display the left bracket symbol. You must sacrifice one of your characters in that font to use as a left bracket. | |||
If you're using AGS V2.7 and above, simply precede the [ with a backslash: \[. For more on "escaping" characters, see [[String formatting]] | |||
==Having multiple characters in your game== | ==Having multiple characters in your game== | ||
Line 212: | Line 227: | ||
Also, bear in mind that you didn't save the images as JPEG or any other lossy formats during a step in the creation of them, since those lossy compressions will alter your images so '''flat''' colours may not be flat anymore. | Also, bear in mind that you didn't save the images as JPEG or any other lossy formats during a step in the creation of them, since those lossy compressions will alter your images so '''flat''' colours may not be flat anymore. | ||
Alternately, since AGS currently supports Alpha-blended sprites when running at 32-bit colour mode, you may just save your images as PNG format with transparency, and then just import them, to save you from having to do all the hard works of refining the edges. | |||
==Disabling diagonal walking altogether (only walk up/down/sideways)== | ==Disabling diagonal walking altogether (only walk up/down/sideways)== | ||
Line 218: | Line 235: | ||
Well, this is a tough one. Although it is currently not an option in AGS, it is being worked on and can be found in the [http://www.bigbluecup.com/tracker.php?action=detail&id=224 AGS bug/feature tracker]. Please check there frequently about this feature's status. | Well, this is a tough one. Although it is currently not an option in AGS, it is being worked on and can be found in the [http://www.bigbluecup.com/tracker.php?action=detail&id=224 AGS bug/feature tracker]. Please check there frequently about this feature's status. | ||
Now, with most things not officially supported by AGS, there is probably a way to do this using some very advanced, troublesome, and frustrating script that even '''*I*''' don't know. Your best bet is to either search the [http://www. | Now, with most things not officially supported by AGS, there is probably a way to do this using some very advanced, troublesome, and frustrating script that even '''*I*''' don't know. Your best bet is to either search the [http://www.adventuregamestudio.co.uk/forums/index.php?board=10.0 Technical Archive] or ask somebody in the [http://www.adventuregamestudio.co.uk/forums/index.php?board=2.0 Technical Questions forum] about a script that will not allow any walking outside of pure up/down/sideways. | ||
==Animating your background images== | ==Animating your background images== | ||
Line 226: | Line 243: | ||
==Having a character continuously animated in the background== | ==Having a character continuously animated in the background== | ||
Please refer to [[Scripting, Code & Interaction#Having a character continuously animated in the background|this entry]]. | |||
==Jerky character/sprite animation== | ==Jerky character/sprite animation== | ||
Line 265: | Line 278: | ||
''How would I add an intro and/or a cutscene to my game? Like with characters walking around, talking to each other, animating, and moving the story along?'' | ''How would I add an intro and/or a cutscene to my game? Like with characters walking around, talking to each other, animating, and moving the story along?'' | ||
First off, this is an easy one, only because it's not that hard to figure out on your own. If you want your characters to animate and talk and all that, just do it! If you want to add an intro, make it so that the starting room of the player character has the intro/cutscene in the "'''Player enters room (after fade-in)'''" interaction. Scripting is a better choice than using the pre-made interaction commands, because it gives you better control and it's better organized that way. Check out all the scripting commands in the AGS manual, such as '''MoveCharacter()''', '''DisplaySpeech()''', and '''AnimateObject()''' (''' | First off, this is an easy one, only because it's not that hard to figure out on your own. If you want your characters to animate and talk and all that, just do it! If you want to add an intro, make it so that the starting room of the player character has the intro/cutscene in the "'''Player enters room (after fade-in)'''" interaction. Scripting is a better choice than using the pre-made interaction commands, because it gives you better control and it's better organized that way. Check out all the scripting commands in the AGS manual, such as '''MoveCharacter()''', '''DisplaySpeech()''', and '''AnimateObject()''' ('''cGuy.Walk()''', '''cGuy.Say()''', and '''oBird.Animate()''' for AGS V2.7 and above). Using those commands and others like them will greatly help you with your cutscene. | ||
As for non-intro cutscenes, simply add the cutscene script to whatever event will trigger it. For example, if you want a cutscene to occur when you talk to character "'''OLDMAN'''", then go to his interaction editor, add an interaction under the appropriate event, and add the script there. | As for non-intro cutscenes, simply add the cutscene script to whatever event will trigger it. For example, if you want a cutscene to occur when you talk to character "'''OLDMAN'''", then go to his interaction editor, add an interaction under the appropriate event, and add the script there. | ||
Line 271: | Line 284: | ||
Now, say you want to have a starting screen with "'''New Game'''", "'''Intro'''", "'''Load Game'''" and "'''Quit'''"... the usual menu buttons. Well, the easiest way to do it (if you want non-interactive buttons) is to draw them as part of the starting room's (usually '''INTRO.CRM''' or '''ROOM1.CRM''', whichever you prefer, note that you have to use '''ROOM0.CRM''' instead of '''INTRO.CRM''' since AGS V2.7) background. Then, create hotspots to represent each of the buttons. For "'''any click on hotspot'''" interaction, use code for each button. First of all, however, decide in which room the intro starts, and in which room actual gameplay begins. Let's say the menu screen is '''INTRO.CRM''', the intro begins with Room #1, and actual gameplay begins in Room #6... | Now, say you want to have a starting screen with "'''New Game'''", "'''Intro'''", "'''Load Game'''" and "'''Quit'''"... the usual menu buttons. Well, the easiest way to do it (if you want non-interactive buttons) is to draw them as part of the starting room's (usually '''INTRO.CRM''' or '''ROOM1.CRM''', whichever you prefer, note that you have to use '''ROOM0.CRM''' instead of '''INTRO.CRM''' since AGS V2.7) background. Then, create hotspots to represent each of the buttons. For "'''any click on hotspot'''" interaction, use code for each button. First of all, however, decide in which room the intro starts, and in which room actual gameplay begins. Let's say the menu screen is '''INTRO.CRM''', the intro begins with Room #1, and actual gameplay begins in Room #6... | ||
For the "'''New Game'''" button, make it so that it moves the player character to room #6. For "'''Intro'''", move the player character to room #1. For "'''Load Game'''" look up ''' | For the "'''New Game'''" button, make it so that it moves the player character to room #6. For "'''Intro'''", move the player character to room #1. For "'''Load Game'''" look up '''RestoreGameDialog()''' in the manual, and for "'''Quit'''" check the manual for '''QuitGame()'''. | ||
That's basically it. It's pretty much common sense and very rudimentary scripting knowledge. | That's basically it. It's pretty much common sense and very rudimentary scripting knowledge. | ||
Line 278: | Line 291: | ||
''Is it possible to let the player choose the main character's name, and have that name be used throughout the entire game?''' | ''Is it possible to let the player choose the main character's name, and have that name be used throughout the entire game?''' | ||
It is indeed possible, and very easy. First off, to ask the player for the name... | It is indeed possible, and very easy. First off, to ask the player for the name... | ||
For AGS pre 2.71: | |||
// Declares a string to store the player's reply | // Declares a string to store the player's reply | ||
string buffer; | string buffer; | ||
Line 285: | Line 299: | ||
// Transfers the content of "buffer" (the name) to the global variable character[...].name | // Transfers the content of "buffer" (the name) to the global variable character[...].name | ||
StrCopy(character[EGO].name, buffer); | StrCopy(character[EGO].name, buffer); | ||
For AGS 2.71 and later: | |||
player.Name=Game.InputBox("What is your name?"); | |||
Be sure to understand the above script in case you make an error and it does not work for you. Then, to call the name in, say, a Display box, just call up the '''character[EGO].name''' variable in any script, like so... | Be sure to understand the above script in case you make an error and it does not work for you. Then, to call the name in, say, a Display box, just call up the '''character[EGO].name''' variable in any script, like so... | ||
DisplaySpeech(EGO, "My name is %s!", character[EGO].name); //V2.6 and below | DisplaySpeech(EGO, "My name is %s!", character[EGO].name); //V2.6 and below | ||
cEgo.Say("My name is %s!", character[EGO].name//V2.7+, or... | cEgo.Say("My name is %s!", character[EGO].name);//V2.7+, or... | ||
Display("Your name is %s.", character[EGO].name); | Display("Your name is %s.", character[EGO].name); | ||
Line 306: | Line 322: | ||
Alternatively, you could simply test in windowed mode, or place a shortcut to your game's EXE file on your desktop and run that after saving instead of testing within the AGS editor. | Alternatively, you could simply test in windowed mode, or place a shortcut to your game's EXE file on your desktop and run that after saving instead of testing within the AGS editor. | ||
Note:This bug is probably fixed in recent versions of AGS, if the problem persists, you may report it in the [http://www. | Note:This bug is probably fixed in recent versions of AGS, if the problem persists, you may report it in the [http://www.adventuregamestudio.co.uk/forums/index.php?board=2.0 Technical Forum]. | ||
==Objects don't align properly in high-res mode== | |||
''My game is in high-resolution (640 x 400, 640 x 480 or 800 x 600 graphics), and most of my objects do not align properly on my background images like I want them to. They're usually off by a pixel or two, and this occurs with scripting and manually. What am I doing wrong?'' | |||
Nothing. AGS uses a low resolution grid (320 x 200, 320 x 240 or 400 x 300) even for high-resolution games. Therefore, you can only place objects on every other pixel (even-numbered, if going from 0 to 319 or 239). You will have to keep that in mind when designing your backgrounds and object placement. | |||
However, with characters, the Character.LockViewOffset function does allow an offset in actual pixels to be specified for X and Y, so this may offer a way around the problem. | |||
Also, you can have high resolution masks for the walkbehind areas, but not for the other types of masks. | |||
There is [http://www.bigbluecup.com/tracker.php?action=detail&id=434 an entry] in the AGS Bug/Suggestion Tracker about a more accurate positioning system. In the mean time, if you grab images from your background using a rectangular marquee/selection tool, remember to make sure that the program's status bar shows even-numbered pixels for your starting and ending points (and height/width as well). | There is [http://www.bigbluecup.com/tracker.php?action=detail&id=434 an entry] in the AGS Bug/Suggestion Tracker about a more accurate positioning system. In the mean time, if you grab images from your background using a rectangular marquee/selection tool, remember to make sure that the program's status bar shows even-numbered pixels for your starting and ending points (and height/width as well). | ||
Line 340: | Line 359: | ||
rawcol = (r1 * 2048) + (g1 * 64) + (b1); | rawcol = (r1 * 2048) + (g1 * 64) + (b1); | ||
'''<u>WARNING | '''<u>WARNING</u>: You would think that, under this scheme, that colours 0 through 31 would be shades of pure blue. However, AGS also uses the original 8-bit DOS colour scheme for 0-31. 16-31 are shades of gray, while 0-15 are listed below:''' | ||
# Dark Blue | 0. <font color="000000">Black</font> | ||
# Dark Green | |||
# Dark Cyan | 1. <font color="#000099">Dark Blue</font> | ||
# Dark Red | |||
# Dark Purple | 2. <font color="#009900">Dark Green</font> | ||
# Dark Yellow | |||
# Gray | 3. <font color="#009999">Dark Cyan</font> | ||
# Dark Gray | |||
# Blue | 4. <font color="#990000">Dark Red</font> | ||
# Green | |||
# Cyan | 5. <font color="#990099">Dark Purple</font> | ||
# Red | |||
# Purple | 6. <font color="#999900">Dark Yellow</font> | ||
# Yellow | |||
# White | 7. <font color="#CCCCCC">Gray</font> | ||
8. <font color="#666666">Dark Gray</font> | |||
9. <font color="#0000FF">Blue</font> | |||
10. <font color="#00FF00">Green</font> | |||
11. <font color="#00FFFF">Cyan</font> | |||
12. <font color="#FF0000">Red</font> | |||
13. <font color="#FF00FF">Purple</font> | |||
14. <font color="#FFFF00">Yellow</font> | |||
15. <span style="background-color:#999;"><font color="#FFFFFF">White</font></span> | |||
So keep this in mind when finding out palette colour codes. | So keep this in mind when finding out palette colour codes. | ||
==Imported background images just won't show up in the editor== | ==Imported background images just won't show up in the editor== | ||
''Whenever I import my background image into AGS, it doesn't show up. What am I doing wrong?'' | |||
Probably nothing, albeit unintentionally. If your '''.BMP''' file was saved as a '''16-bit''' image (which it probably was), save it as a '''24-bit''' image instead. That should work. Even though your game might be set to 16 bits, AGS will still import 24-bit images. | |||
==Why isn't JPEG supported?== | |||
''Why is it not possible to import JPEG images as backgrounds? That would really help to keep games small and downloadable.'' | |||
It is because the backgrounds in room files are all compressed with ''one single'' lossless scheme, '''no matter what format of images you used for import the resulting file size of the room is still the same'''. So there's no advantage in using JPEG at the time being (unless of course the room files can also store lossy native JPEG compressed images as bg, which is not implemented at the moment). Moreover, JPEG compression is ''lossy'', storing an image which had details lost in a lossless format is not encouraged. | |||
So, using different image formats only affects your working files, not the ''resultant'' filesize. If you're really low on hard disk space, just save your working files as PCXs and PNGs. | |||
[[Category: | [[Category:Beginner Tutorials]] |