GUI, Inventory & Menu: Difference between revisions
m
no edit summary
mNo edit summary |
|||
(13 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{deprecated}} | |||
==Getting rid of that big gray status bar at the top== | ==Getting rid of that big gray status bar at the top== | ||
''When I test my game, there is this gray box at the very top of the screen that I can't get rid of. I don't want it there. What is it, and how do I get rid of it?'' | ''When I test my game, there is this gray box at the very top of the screen that I can't get rid of. I don't want it there. What is it, and how do I get rid of it?'' | ||
Line 37: | Line 39: | ||
'''Example:''' You have @SCORE@ out of @TOTALSCORE@ possible points.<br><br> | '''Example:''' You have @SCORE@ out of @TOTALSCORE@ possible points.<br><br> | ||
The Properties window also allows you to align the text to the left, right, or centre, as well as change its font and colour.</blockquote> | The Properties window also allows you to align the text to the left, right, or centre, as well as change its font and colour.</blockquote> | ||
It may also be helpful to use the [[Description Module]]. | |||
==Using a specific inventory item to trigger an action== | ==Using a specific inventory item to trigger an action== | ||
Line 59: | Line 61: | ||
This will detect whether the player's current inventory item selected is iItem. | This will detect whether the player's current inventory item selected is iItem. | ||
Rather than using the item numbers, AGS now uses ''' | Rather than using the item numbers, AGS now uses '''script O-Names''': usually ''i'' followed by the item name for inventory items(so, if the item is called ''Key'' the script O-Name will be ''iKey''), which are shown on the 'Inventory Items' window of the editor). | ||
==Customizing graphics of AGS default GUIs; Creating your own GUIs== | ==Customizing graphics of AGS default GUIs; Creating your own GUIs== | ||
Line 93: | Line 95: | ||
''How would I go about creating my own custom inventory GUI? I don't much like the default AGS one. OR, I have a problem creating my own inventory GUI. HELP!'' | ''How would I go about creating my own custom inventory GUI? I don't much like the default AGS one. OR, I have a problem creating my own inventory GUI. HELP!'' | ||
Everything you need to know about custom inventory GUIs can be found in [http://www. | Everything you need to know about custom inventory GUIs can be found in [http://www.adventuregamestudio.co.uk/forums/index.php?topic=10946.0 this thread]. | ||
==Inventory items don't show up== | ==Inventory items don't show up== | ||
Line 158: | Line 160: | ||
==Changing AGS's default speech/narrator dialog boxes to your own== | ==Changing AGS's default speech/narrator dialog boxes to your own== | ||
''How would I change AGS's default black-and-white dialog boxes into something more colourful? I want to | ''How would I change AGS's default black-and-white dialog boxes into something more colourful? I want to customize the narrator/speech GUIs!'' | ||
This is found in the AGS manual, albeit a bit hidden: | This is found in the AGS manual, albeit a bit hidden: | ||
Line 170: | Line 172: | ||
</blockquote> | </blockquote> | ||
[[Category: | |||
=="Error: InventoryScreen: one or more of the inventory screen graphics have been deleted"== | |||
''Every time I try to open my Inventory GUI I get this error. What's going on here?'' | |||
This is most likely to happen if you've started a game using the 'Empty' template. This starts a game with NO existing sprites - which includes the ones needed by the default Inventory GUI. You'll need to import three sprites to be used for the 'Look at', 'Use' and 'OK' buttons. Then, right-click them, select 'Change sprite number ...' and renumber them to 2041, 2042 and 2043 respectively. | |||
==Checking if the player has a certain Inventory Item== | |||
''I want an interaction to happen only when the player has an Inventory Item (like a key to open a door) OR something not to happen when the player has an Item. How do I do that?'' | |||
Simply use the [http://www.adventuregamestudio.co.uk/manual/ags49.htm#character.inventoryquantity InventoryQuantity] property, e.g.: | |||
if (player.InventoryQuantity[iKey.ID] == 0) | |||
Display("You don't have the key."); | |||
Or: | |||
if (player.InventoryQuantity[iStolen.ID] != 0) | |||
Display("You can't go in there carrying Stolen goods."); | |||
If you want to stop the player from taking an Item multiple times (like taking someting out of a drawer), you're better using a variable. If you use InventoryQuantity and the player can lose the Item later in the game, they'll be able to go back and pick it up again. | |||
'''Note:''' | |||
* The InventoryQuantity property was introduced in V2.7. Before that, use the ''character[].inv'' array. | |||
[[Category:Beginner Tutorials]] |