Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Visible_Stalker on Fri 13/02/2015 17:02:27

Title: Scripting Question about Items
Post by: Visible_Stalker on Fri 13/02/2015 17:02:27
Hey I am a noob so sorry if my question is very basic.
I want a character to give another character an item while they are talking.
Something like
Fox: You need a dictionary?
(character gets dictionary)
Fox: You should use it sometimes

PS:One of the characters in my game is a fox
Title: Re: Scripting Question about Items
Post by: Cassiebsg on Fri 13/02/2015 17:07:38
Here you go: https://www.youtube.com/watch?v=1Ml_DR76Cl4&list=PL21DB402CB4DAEAEF (https://www.youtube.com/watch?v=1Ml_DR76Cl4&list=PL21DB402CB4DAEAEF)

Just find the relevant video on the list... though, since you call your self a "noob" I would recommend you watch them all. ;-D
Title: Re: Scripting Question about Items
Post by: Adeel on Mon 16/02/2015 14:11:10
What a sheer coincidence! Two years before (more or less), I was asking the same question. And that happened to be my first post as well!

The link Cassie has provided you will, surely, more than help you. To add cherry on the top, here's a little (and embarrassing!) tutorial I wrote when I stumbled upon the same problem: http://www.adventuregamestudio.co.uk/forums/index.php?topic=47801.msg636448364#msg636448364
Title: Re: Scripting Question about Items
Post by: HAL on Tue 17/02/2015 03:07:26
Quote from: Visible_Stalker on Fri 13/02/2015 17:02:27

Something like
Fox: You need a dictionary?
(character gets dictionary)
Fox: You should use it sometimes

I'm a noob myself, but this is something I can do so I think I'll get suck in with helping others out :grin:

In the dialog creation box, you can press tab to intend the code and revert it back to being read as normal game script.

I would do something like this.


Quote
FOX: You need a dictionary?
  player.AddInventory(iDictionary);       //Note how this line is indented
  Display("Fox gave you a dictionary");   //And this line. The font turns black so you know it's code and not dialog.
FOX: You should use it sometime.


   
Title: Re: Scripting Question about Items
Post by: Visible_Stalker on Sun 22/02/2015 23:02:10
Thanks everyone! :)
I goofed but you really saved me :tongue: