Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: kantor_98 on Mon 13/11/2006 08:51:16

Title: Look on inventory Items
Post by: kantor_98 on Mon 13/11/2006 08:51:16
I want that when I look (use look icon) on an inventory item, something to happen - a message displayed, a GUI activation, etc. To be honnest, I did not find something like this in the help file. I try also to use the "interact" option on on the inventory  item, I put there "run script", in the script I put display message, and after that activate GUI, but none of them work.
What should I do ?
Title: Re: Look on inventory Items
Post by: SSH on Mon 13/11/2006 08:53:36
Since interaction scripts are in the global script, you should use Global messages for any Dsiplay message commands. Although if you're using a script function you may as well say,

Display("It's a very interesting inventory item");
Title: Re: Look on inventory Items
Post by: kantor_98 on Mon 13/11/2006 09:06:21
I try this, but the inventory window is over the text !
Title: Re: Look on inventory Items
Post by: SSH on Mon 13/11/2006 09:51:54
Why didn't you mention that to start with?   ::)

Turn off the inventory window, display your text, then turn it back on (if you want it to stay on). Or put the text on a gui with a higher Z property
Title: Re: Look on inventory Items
Post by: Ashen on Mon 13/11/2006 12:01:52
You should mention tings you've already tried and what was wrong with them in your first post - it'll save everyone's time.

Unless you've checked the 'Display all text as speech' option, Display commands should be on top of all GUIs.
In addition toSSH's suggestions, check the manual (http://www.adventuregamestudio.co.uk/manual/Text%20display%20_%20Speech%20functions.htm) - DisplayAt/DisplayAtY/DisplayMessageAtY could all be used to move the message to somewhere it can be seen (Or SayAt (http://www.adventuregamestudio.co.uk/manual/Character.SayAt.htm) for character speech.).