I want to make a game where the character picks up items from other characters and trades them, but doesn't actually use them. How can I make it so that, after talking to the person who has it, you can "gain" the item and then you can opt to "give" it to another character. Basically, if you haven't obtained the item yet, you can't give it to another character. That's the only issue involved, not picking up the items, using them, etc. So its a small dialog- based game. Any ideas on some simple ways to do this? New to Unity, here. Thanks!
I’m sure there are many ways to do this but I attempted a game like this a while back. The way I worked it was using many tutorials I found. I’ll post them below and tell you how I did it.
I used a Gui for the menu sytem, and used Gui Buttons as images.
I just picked up items by using OnTriggerEnter() codes since I had 2D dialogue/ characters. You could also use a GetKeyDown button for talking to someone. I would also turn off my movement script when in dialogue/ in your menu.
Basically use if statements that " if the character completes the trade/dialogue"
then the button image would change from being “empty/blank” to being your 2D image you wanted.
Hope this helps at least a little.
Dialogue Scripting help:
http://answers.unity3d.com/questions/21584/button-pressed-twice-conversation-text-skip.html
Changing cameras:
http://wiki.unity3d.com/index.php?title=MultipleCameraSwitcher
Toggling/ turning off a script with another script:
http://answers.unity3d.com/questions/39889/turn-off-a-script.html
At a high level:
When the player talks to another character, you’ll need a way to communicate that conversation. I suggest creating a GUI that opens up when a player talks to a character.
In that GUI have buttons & text for conversation options. Once the player finishes clicking through, add whatever item to their inventory.
There are many ways to create an inventory system, and many tutorials with details on how to do it.