Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: cRonald on Wed 29/08/2012 11:16:34

Title: Сombine three or more inventory items
Post by: cRonald on Wed 29/08/2012 11:16:34
Hi all!
I need some help with combining inventory items. I know how to combine two items. But i want something like that: ItemA+ItemB+ItemC=ItemD.
Title: Re: Сombine three or more inventory items
Post by: Khris on Wed 29/08/2012 11:22:28
Do you want a method to combine three items at once?
Because what we usually do is either force the player to do it in a specific order or use several intermediary items.
Basically, you allow to combine:
A+B, then AB+C
A+C, then AC+B
B+C, then BC+A

It also depends on the items, combining a shaft, a blade and duct tape doesn't really make sense if the tape comes last.
Title: Re: Сombine three or more inventory items
Post by: cRonald on Wed 29/08/2012 11:53:54
Yes, i want to combine three or more items at once.
For example: to make fishing rod, player need to combine hook+fishing line+stick+coil+worm. In this method i need 6 inventory items.
Otherwise: hook+fishing line=hook&fishing line(1), fishing line+stick=fishing line&stick(2), stick+coil=stick&coil(3), line+coil=line&coil(4), and so on. So, i need a lot of auxiliary inventory items, which will create a mess in inventory. It's bad solution.

Ideally, i want something like this:
(http://i42.fastpic.ru/big/2012/0829/95/6b95650fee44527cfc78536cbdaf7895.jpg)
Title: Re: Сombine three or more inventory items
Post by: cat on Wed 29/08/2012 13:22:23
Other options are
*) as soon as the player has all required items and you combine any of them, all are automatically combined
*) make a separate "workplace" where the player has to put all the items he wants to combine
*) make some kind of shape where the player has to put each item on a certain spot (see http://www.youtube.com/watch?v=KPLkS9DLUzU (http://www.youtube.com/watch?v=KPLkS9DLUzU))
*) let the player only combine certain items (line + stick, hook + worm,...) and then those items have to be combined again.
Title: Re: Сombine three or more inventory items
Post by: Andail on Wed 29/08/2012 13:24:34
Nice gui!
If I understand you correctly, you have a system where you can add any given number of inventories to a "recipe", where they'll appear in a special window, and when you hit a button you get a result?

Do the items appear in a dummy inventory (the "combo" window)? In that case you can try if this character has the inventory items needed
if (cDummyinventory.HasInventory (iRod) //etc), {
and if the conditions are met when clicking the "Combine" button, you will get a certain result.

Title: Re: Сombine three or more inventory items
Post by: Khris on Wed 29/08/2012 13:55:56
I started to write example code and soon thought wth and wrote a module.
I'll post a thread in Advanced Tech within the next hour.

The designer can
-conveniently add item "recipes" to the game

The player can
-move items to the "pot" by dropping them in a 2nd inventory
-put back single items or clear the entire "pot"
-finally craft the item with the push of a button
Title: Re: Сombine three or more inventory items
Post by: steptoe on Wed 29/08/2012 17:34:20
Sounds good Khris  (nod)
Title: Re: Сombine three or more inventory items
Post by: Khris on Wed 29/08/2012 18:10:27
Alright, here's the thread:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=46706.0

Have at it :)
Title: Re: Сombine three or more inventory items
Post by: CaptainD on Wed 29/08/2012 22:46:07
It would be cool to see Mysterious Island style inventory management in an AGS game!  Just please don't make the puzzles so preposterously difficult as in the Mysterious Island games or Journey to the Moon (much as I love those games, the difficulty level was very steep... well, at least to me!)