Love working with adventure creator. Long time lurker, first time poster. But I've finally run into a task that seems fairly specific to my needs. In short, the design I'm going for has inventory items appearing on the same UI as conversations, and clicking on the various inventory items activates dialogue in the same way as conversation options do.
I'm after this specific design as I'm making a mystery detective game, and I'm handling clues like suspects and locations as different categories of inventory items. Any help would be much appreciated!
Pictured: Dialogue scene with normal, perfectly functional dialogue in the bottom left, and non-functional "inventory items" on the bottom right.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @aardvark4lunch.
It's possible to limit a dialogue option's display to only show when a particular item is held, and options can also be assigned icon textures that match that item.
The tricky part is getting two different types of option display (text vs icon) to show simultaneously.
One approach you could try would be to use a separate DialogList element (and Menu) for the "icon" options, and also house those options in a separate Conversation.
AC lets you manually override which Conversation a DialogList element displays for, so it might be possible to have two Conversations active at a time - each being displayed in a separate menu.
Try this:
1) Move your "inventory options" to a separate Conversation, giving them appropriate icons and linking them to inventory items.
2) Create a second Menu + DialogList element to display this Conversation in.
3) Set this new Menu's Appear type to Manual, and have it turn on and off (using the Menu: Change state Action) when the original Conversation menu is turned on and off (by assigning ActionLists in that menu's properties panel)
4) Attach a simple custom script to the second Conversation that causes it to show up in this second menu when the first Conversation is run:
In the Inspector, assign the "main" Conversation that should bring up the second as well.
Wow, awesome stuff! You really are a god among men
I'll get started looking into all that now.
I just had another idea (and I have no idea if this is feasible) but I'm using the Unity UI Prefabs to power the menus through Adventure Creator, and I was wondering if:
A. A script on a button could get a reference for what inventory item is assigned to it
B. If that same script could get a reference to who is currently being conversed with.
C. If through code I could then use inventory item A on hotspot B
And run something like this psuedo code when you press a button.
As in, keep icons in an InventoryBox element, and run Hotspot interactions when clicking them?
That would be possible, yes. If you set the element's Inventory box type setting to Custom Script, then its click handling is left entirely to script.
Conversations aren't "associated" with a character, though - they're detached from the specific situation they're used for. To work out which character you're talking to, you could move the Conversation component to the NPC's Hotspot, so that they're both the same GameObject.
To run a Hotspot interaction when clicking an item, you could then use something like this:
Change the strings to match your own menu/element, and attach to your UI prefab.
Absolute LEGEND works amazing! Been tearing my hair out all day. It works perfectly for handled inventory items, but seems to be having some issues with unhandled (unless I'm doing something wrong which, let's face it. I most likely am.)
I have this set up on my Cop so when faced with an inventory item he's unfamiliar with he has a specific line of dialogue based on if the item is in the physical, KnowledgePerson, or KnowledgeOther categories. But even though the unhandled item is a KnowledgePerson, it seems to fail all three inventory checks.
If you're overriding the click behaviour of the InventoryBox, an item won't become selected automatically upon clicking it. Try inserting the following before the Hotspot's RunInventoryInteraction call:
You're a damn legend, you know that?

Five star review coming your way! I'll have to send a tip your way too, do you have a donation link?
No worries