Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sun 26/11/2006 22:13:25

Title: Simple Inventory Question Regarding Main Tutorial...
Post by: on Sun 26/11/2006 22:13:25
I did multiple searches to find a possile answer to this but couldn't find anything. I am following the main tutorial step by step and I am on part 4. I am trying to get Roger to pick up the key and put it in his inventory. I am following the instructions in the tutorial exactly as stated. I've tried it like 15 times and when I test the game Roger will not pick up the key. This is the instruction:

Object - Remove an object from the room (0)
Player - Give the player an inventory item (1)

I have checked my key/object on the screen is 0 and my inventory key is in fact 1.

I am not sure if the newer version has been changed but I just want to move forward on the tutorial and can't get this function to work. I tinkered with the tutorial a few years back and was able to do this but now I can't seem to get it to work, even after restarting from scratch a few times.

Any help would be appreciated.

Thanks!

Also... I can't get the Demo Quest game to work at all... It gives me an error when I try to run it and I have two versions of AGS on my computer (2.60 and 2.72 I think). The older version says the game was created with a newer version of AGS and the new version gives me an error...
Title: Re: Simple Inventory Question Regarding Main Tutorial...
Post by: monkey0506 on Sun 26/11/2006 22:29:49
Some seemingly obvious questions:

1) What interaction are you putting this under?
2) Is an error message generated?
3) Is the object actually turned off?
4) Does the player actually receive the inventory item?
Title: Re: Simple Inventory Question Regarding Main Tutorial...
Post by: on Sun 26/11/2006 22:40:31
I have the program open as we speak...

"1) What interaction are you putting this under?"

As the tutorial states... I have it under Object 0 (Key) and both commands are under the flag Interact Object. The tutorial also had a third command to give 5 points. I tried it with that and without. But nothing happens. The key is on the ground and I set the baseline to the top of the screen as the tutorial states.

"2) Is an error message generated?"

No error message is generated. When I test the game nothing happpens when I click the hand on the screen. The tutorial says the key should dissapear when any portion of the screen is clicked (as it would get into specifics on how to make just key clickable at a later time).

"3) Is the object actually turned off?"

Object initially visable is checked... As what you mean by turned off I am not sure what you mean.

"4) Does the player actually receive the inventory item?"

No. Nothing at all happens when I click the screen/key with the hand (or any other icon for that matter). No key appears in inventory.

Thanks for the reply! :)
Title: Re: Simple Inventory Question Regarding Main Tutorial...
Post by: Ashen on Sun 26/11/2006 23:16:36
By 'turned off', I think monkey means 'Does the object graphic disappear'. I.e., is the problem with the entire interaction, or just the Add Inventory part.

Reading your post:
Quote
The tutorial says the key should dissapear when any portion of the screen is clicked (as it would get into specifics on how to make just key clickable at a later time).

I don't think it does. Are you refering to this part:
Quote from: The Tutorial
Note that our solution is not perfect - the player can click the hand icon on the key from anywhere in the room and it will disappear.

What this means is wherever the player is in the room, if you click on the key, it will disappear - as in you don't have to be standing near the key to pick it up. It doesn't mean you can click anywhere on the screen and pick up the key.
(If you didn't mean that bit - where did you read that you could click anywhere?)

And if that's not the problem:
Title: Re: Simple Inventory Question Regarding Main Tutorial...
Post by: monkey0506 on Sun 26/11/2006 23:40:37
As Ashen says, by "turned off," I was asking if the object's graphic was removed from the screen.

Pretty much everything Ashen said is the way to go. Particularly the bit about displaying a message to see if the interaction is actually being run. And the bit about cursors only having a single-pixel hotspot for use with click-detection.
Title: Re: Simple Inventory Question Regarding Main Tutorial...
Post by: on Mon 27/11/2006 23:27:55
AH! Thank you!!! I have to say I took the hand icon and clicked the key after reading your posts with the fingers and all over to no avail but kept trying other areas of the hand. Eventually it worked. Apparently (like you said) it has to hit the object just the right way (kind of in the center of the hand as there is no clear point). I think this combined with the key graphic's small skinny nature was making it seem unclickable to me.

"What error(s) do you get using Demo quest in 2.72? I think the current version of DQ was made with 2.7 and already there's been a few major changes in the language (particularly in string vs String handling). It's probably all fixable, with time and patience, but first you need to identify where the errors are."

For the Demo Quest when I open the game it moves the music and sound files to a new folder saying the newer version does this to cut clutter.

After that when I test the game it gives the following error -


There was an error compiling your script. The problam was:
In: 'Global script'

Error (line 485): Type mismatch: cannot convert 'const string' to string'

Do you want to fix the script now? (Your game has not been saved).