Forum rules - please read before posting.

Showing Use Icons When Using Inventory Items

How can I keep icons displayed while also displaying the selected inventory icon when hovering it over a hotspot in a point & click setup? Currently, if I select an inventory icon in order to use it on a hotspot, the use icon (or whatever icon is set to display) no longer shows, so it's not clear whether the player is hovering over the hotspot or not (I do not display labels).

Comments

  • edited July 2018
    Basically, I want it like this: https://imgur.com/a/25Vftwx
  • The cursor display reflects the available interactivity - you could (through script) change the cursor's display accordingly, but it wouldn't change the behaviour of LMB/RMB clicks.

    What is it you're trying to achieve, exactly, in terms of interactivity once an item is selected?  Please give full details regarding your interaction method etc.
  • Sorry, I should have explained better in the Broken Sword image above:
     
    So, you see the magnifying glass (Broken Sword's examine icon) next to the inventory item down in the alley below the character? That alley is a hotspot that the player is using an item on. The player knows he is going to use the item on the hotspot because, after selecting the item from the inventory and moving the cursor over the hotspot, the "magnifying glass" icon is shown beside the inventory item - this is what I want to recreate. In my setup right now, If I were to select an item and hover over the hotspot with it, the interaction icon would not show, only the inventory item graphic, so I would not know if I was over the hotspot or not.

    My interaction method is set to context sensitive, in 3d using point & click movement method.
    Hotspot detection is set to mouse over, hotspot icons are set to never display (I prefer to use interaction icons as defined in the cursor settings).


    *In short: I'd like the option to display inventory graphics and interaction icons simultaneously, if possible.
  • Sorry, I'm still not clear.  That it shows a magnifiying glass suggests that e.g. a left-click would cause the Hotspot's examine/use interaction to run, and not anything to do with the inventory item (eg. combine with Hotspot).

    From your description, that it shows a magnifying glass is because that's the type of interaction you'd make with no item selected - but doesn't actually have a bearing on the effect of clicking when an item is selected.

    Essentially, is the behaviour you're looking for purely visual, with the actual click behaviour already correct?

    If so, there'd be less to do but either way - custom scripting would be necessary.  Presumably, that "magnifiying glass + item" cursor could change to a "talk + item" if hovering over a character - so it needs to be dynamic to avoid the need to supply all possible combinations as separate assets.

    Basically (and bear in mind I'm only thinking aloud here) you'd have to first uncheck Change cursor based on Interaction?, and then prevent the inventory item from becoming the cursor graphic when selected, so that again you can control it manually - by setting When inventory selected to Change Hotspot Label.

    You should then be able to dynamically change the "Main cursor"'s graphic based on the active Hotspot so that it shows up the correct cursor icon - only this time it can be when an item is selected as well.

    The currently-active Hotspot can be retrieved with:

       AC.KickStarter.playerInteraction.GetActiveHotspot ();

    To get a Hotspot's first "Use" interaction's icon:

      int iconID = myHotspot.GetFirstUseIcon ();
      CursorIcon cursorIcon = KickStarter.cursorManager.GetCursorIconFromID (iconID);
      Texture cursorTexture = cursorIcon.texture;

    And the main cursor's texture can be set via:

       AC.KickStarter.cursorManager.pointerIcon.texture

    (Just right-click the Manager field to get the API reference to it).

    You can then, separately, render the item itself as a "side" cursor in a separate OnGUI call.  OnGUI would only be appropriate if you're relying on Software cursor rendering of course - but you can get the selected item's texture with:

      AC.KickStarter.runtimeInventory.SelectedItem.tex;

    And the position of the AC cursor with:

      AC.KickStarter.playerInput.GetMousePosition ();
  • Thanks for the detailed response Chris. I think though, it's probably more effort than it's really worth, as I've realised I can get pretty much the same mechanic by using the highlighting feature, set to only show hotspot icons when they are highlighted by the cursor - it still works when hovering inventory item graphics over the hotspot.

    I have one question about this though: There's an option to only display hotspot icons when flashing. What is meant by "only when flashing?"
  • If the player invokes an input named "FlashHotspots", then all Hotspot Highlight effects will flash briefly - allowing the player to see what's interactive all at once.

    The Highlight effect defaults to the Hotspot's model brightening, but it can be replaced or supplemented by an icon with that option.
  • Oh okay, yeah. I remember playing a game that did that recently actually, you press a button and all interactive objects would flash / "sparkle" though I can't remember what game it actually was.
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.