Adventure Game Studio | Forums

AGS Support => Beginners' Technical Questions => Topic started by: Blue Bee on Mon 09/05/2016 13:51:03

Title: using inventory in dialogue
Post by: Blue Bee on Mon 09/05/2016 13:51:03
Hi all,

I'm wondering what the easiest way to implement a broken sword style dialogue system where the inventory is displayed during a conversation with an NPC and clicking on the inventory starts a conversation around the item?

Can't seem to find anything covering this.

Thanks in advance.
Title: Re: using inventory in dialogue
Post by: Monsieur OUXX on Mon 09/05/2016 14:15:15
I would proceed like this but I can't guarantee it's the best way (and it's only a rough explanation anyways)
1) I would search a custom dialogs module that allows to display custom, icon-based dialog options.
2) I would check how to add dialog options into this (does it work based on actual dialog trees from the Dialogs section of the AGS Editor?, or are they added through scripting?)
3) If the dialog options are added through script, then you can just iterate through the belongings of the player (I think it's the "inventory" array. Or the "items" array, something like that) and just add them one by one.

To be honest that's more of an Advanced technical Questions topic.


============

EDIT: some people have already asked your question :
Here http://www.adventuregamestudio.co.uk/forums/index.php?topic=5634.msg68209#msg68209
and here http://www.adventuregamestudio.co.uk/forums/index.php?topic=39193.msg515766#msg515766
Title: Re: using inventory in dialogue
Post by: Khris on Mon 09/05/2016 14:21:20
Here's an older module: http://www.adventuregamestudio.co.uk/forums/index.php?topic=25866
It most likely won't work as-is with current AGS versions though. Use it as guide to how something like that can be implemented.

The short answer is: learn the scripting language and implement it yourself.
AGS has no native support for icon based dialogs, but you can script pretty much anything yourself.

The basic idea is to store the NPC in a variable before the dialog is opened, then show the inventory window during the dialog.
In General settings, if you set the game to keep running during dialogs, you should be able to process inventory clicks while the dialog is active. React to clicks based on the clicked items and the NPC variable.
Title: Re: using inventory in dialogue
Post by: Monsieur OUXX on Mon 09/05/2016 14:51:55
Quote from: Khris on Mon 09/05/2016 14:21:20
Here's an older module: http://www.adventuregamestudio.co.uk/forums/index.php?topic=25866
It most likely won't work as-is with current AGS versions though.

Older scripts actually work quite well with just a limited amount of change, provided that don't do incredible graphical stuff (it's usually the string/String conversion that requires a bit of rework)

I would definitely give it a try!