Jibble

Author Topic: using inventory in dialogue  (Read 952 times)

using inventory in dialogue
« on: 09 May 2016, 13:51 »
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.

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: using inventory in dialogue
« Reply #1 on: 09 May 2016, 14: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
« Last Edit: 09 May 2016, 14:18 by Monsieur OUXX »
 

Khris

  • partook in silencing a crtitc despite facts
    • Lifetime Achievement Award Winner
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Khris worked on one or more games that was nominated for an AGS Award!
Re: using inventory in dialogue
« Reply #2 on: 09 May 2016, 14:21 »
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.
Fail at Floaty Rog' now!  still having to deal with what games are going through

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: using inventory in dialogue
« Reply #3 on: 09 May 2016, 14:51 »
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!