Forum rules - please read before posting.

A hybrid interaction method


I'm studying Adventure Creator, looks like it's a really powerful tool! But I've got some questions.

I'm developing a 2D point'n'click adventure game and I need some kind of a hybrid interaction method. My interactions are: use (by default), bite, smell, hear, etc. I like the Context Sensitive (CS) interaction method, it provides almost all I need, but I'd like to be able to choose some additional interactions: cursors of mouth, nose, ear.

1) Can I choose these interaction cursors in the CS interaction mode? I've created a menu with these cursors and I can choose them in Choose Interaction then Hotspot (CITH) mode with no problem, but not in the CS mode.
2) Can I make "use" cursor as default in the CITH mode? So player won't choose it specially all the time, but this cursor will be chosen automatically when a hotspot is highlighted if no special interaction were chosen, like in CS mode?
3) How can I make deselecting current interaction cursor or resetting it to default by right click (like the inventory option "Deselects Item") in CITH mode?
4) How can I move player with an interaction cursor (like the inventory option "Can move player if an Item is active") in CITH mode?

Questions 1-2 are really important to me, 3-4 are of lesser importance.

I've read the 12.12 chapter of the manual and looked through the Custom Interaction System Example script, but maybe there is another way? Maybe I shouldn't code a whole interaction system from scratch, but can modify one of the existing methods or just toggle some checks? Maybe there are some useful code examples or forum topics? Could you please point me in the right direction?



  • edited July 2017
    Welcome to the community, @Neurosaur.

    1) No - CS mode works on the basis that each Hotspot only has one possible "Use" interaction at a time.  This allows for a more streamlined interface if you don't want players to have to decide in what way they will interact witha Hotspot.

    However, a Hotspot can have multiple "Use" interactions - it's just that only the first-enabled one can be triggered.  If you wanted to explore scripting with this mode, you could consider dynamically enabling/disabling a Hotspot's Use interactions at runtime:

    myHotspot.useButtons[0].isDisabled = true;

    The API reference for the Hotspot component can be found here.

    2) This falls into the behaviour of Choose Hotspot Then Interaction mode, in which the selected icon is based on the active Hotspot.  CHTI mode traditionally involves choosing an icon within an Interaction menu, but this can be changed in favour of cursor-icon-swapping by setting the Select Interactions with field to Cycling Cursor And Clicking Hotspot.

    This mode is similar to CITH mode, except only the cursors relevant to the Hotspot in question are available in the icon-cycle (which occurs when invoking the CycleCursor input button).

    3) The cursor can be reset with:

    KickStarter.playerCursor.ResetSelectedCursor ();

    4) As that involves the movement code, a custom interaction system would still not be able to allow for that.  I would have to look into how that might be done.

    However, if you use the mode I described in 2) then cursors would only be selected when hovering over Hotspot anyway - so this would be unnecessary.  Have a look into it and see if that works for you.
  • Thanks a lot for your answer, @ChrisIceBox!

    Looks like the 2) is easier to implement than the 1). Which approach would you recommend me to follow first of all?

    Just to be clear, I'll try to summarise what I'm trying to achieve. "Use" interaction is the most commonly, er, used, so I want it to be default, I don't want to make my players perform additional mouse clicks to choose it. But also I have some auxiliary interactions, which can be selected by clicking them in the menu bar (similar to the inventory bar in the 2D demo), I guess cycling the cursors is a bit less convenient than choosing them right from the screen menu.

    I've seen some kind of a workaround somewhere at this forum: convert these additional interactions to the inventory items. What do think of it? And how should I make them fixed and unscrollable in the invenory in this case?
  • If you want icons to be selected via a Menu before clicking the Hotspot, then CITH is more suited.

    If you wanted to control which cursor is active when hovering over a Hotspot, then you could make use of the OnHotspotSelect custom event to change it to the default, i.e.:

    void OnEnable ()
      EventManager.OnHotspotSelect += My_OnHotspotSelect;

    void My_OnHotspotSelect (Hotspot hotspot)
      KickStarter.playerCursor.SetCursorFromID (0); // 0 = ID of the interaction icon

    A similar OnHotspotDeselect event also exists for you to reset the cursor when leaving it, if need be.  More on custom events can be found in this tutorial.

    Faking interaction icons through items isn't actually a bad idea - at least worth a try, and likely wouldn't involve custom code.

    Items can be categorised within the Inventory Manager, and InventoryBox menu elements (which is where they are displayed at runtime) have a Limit by category? option.  You'd use CS mode in that case, since that would allow the Use icon to appear as the default.

    InventoryBox elements are only scrollable if your Menu features Button elements that have a Click type of Offset Element Slot.  You could duplicate the default Inventory menu, remove the ShiftLeft/ShiftRight buttons, limit the InventoryBox to only display your "icons" category, and you'd be most of the way there.  Making interactions for each Hotspot would then be a case of defining Inventory interactions rather than "Use" ones.
  • Thank you, @ChrisIceBox, you're so helpful! Looks like either changing cursor in the custom event handler or using interaction icons as items will solve my problem!

    I keep in mind a CHTI mode with a on-screen menu (aka verb coin) as an option too. But there are only interactions that are set with a hotspot in this menu. Can I show all my "verbs" in this menu (with some default behaviour to unhandled cases similar to CITH mode) even if the certain interaction is missing in the hotspot? Like in Curse of Monkey Island or Full Throttle. It's not a big deal though, since I can just set some default interaction for every hotspot manually, but maybe there's a time-saving shortcut =).
  • Actually, the upcoming v1.58 update is set to include the ability to prevent Interaction elements not associated with the clicked Hotspot from automatically hiding themselves - this should allow you to recreate exactly that.
  • That's great news! Thank you!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.