Hello everyone,
I've been enjoying using Adventure Creator so far, and surprised at just how much I can do without scripting, but I think I've come across something I want to do that will require it and I'm just not sure where to start.
Ideally I'd like to create the following behavior.
Direct control of the player, with hotspots detected by proximity. This I've got working.
I'd like InteractionA to always be the normal 'use' interaction, regardless of whether an inventory item is slected.
And I'd like InteractionB to always use attempt to the currently selected inventory item.
With the default behaviors it seems when an inventory item is selected you can't use the 'use' interaction at all unless unhandled behaviors deselect the inventory item first.
I've also tried reversing this since inventory items always want to use InteractionA by default and programming everything else to use 'examine' (IneractionB) but it seems whenever an inventory item is selected, the 'examine' behavior is locked out as well.
Can this be done without getting deep into coding? And if coding is required, are there any good guides for getting started with customizing interactions for Adventure Creator? So far anything I've found assume a bit more familiarity with Unity coding than I currently possess. (I'm fairly adept at Bolt, but haven't dug into using scripts directly in Unity yet)
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @Wogoat.
The way Hotspots are interacted with is set your Settings Manager's Interaction method. I assume you've currently got this set to Context Sensitive?
You're right about the way it behaves - this mode goes for a "one-click" interface (with the optional exception of a secondary examine interaction).
In this situation, you'd typically want to set this field to Custom Script, and then write a script that runs interactions based on custom needs. The Manual's "Custom interaction systems" chapter, and the included CustomInteractionSystemExample.cs script, cover how this can be done.
However, I see your point about not wanting to be able to examine Hotspots while an item is selected. Here's a quick hack to get such behaviour: open up the PlayerInteraction script and replace the line (around 94):
with:
Then go to your Settings Manager's "Inventory settings" panel, make sure Right-click active item is set to Examine Item, and uncheck Defined interactions deselect active item?.
That should then give you that particular behaviour. I shall give it some proper investigation to see if such a feature can be incorporated officially as part of the next update.
If you still want to see about a custom script, have a look at the resources I've mentioned, and let me know if you need more specific help with it - we can look into working something out together.
One last thing, for completeness: it is also possible to use the Inventory: Check selected Action in a "Use" Interaction to work out if a given item is currently selected, which you could also use to instead run a separate "Use with inventory" ActionList instead of the regaular "Use" behaviour.