Forum rules - please read before posting.

Nine-verb hover inventory "look at" default?

2

Comments

  • Edit: I've uploaded the most recent version of the package I keep referring to for various issues, and PM-ed you it. This should help exemplifying this issue a little easier!

  • Here's a test replacement for the ItemSetLabel script:
    http://pasteall.org/1400033/csharp

    How does it compare?

  • Much better, however if I click it whilst it's playing, there's a strange glitch on the verb menu as it flashes off for a frame. There's also a double speech line when right-clicking on the inventory item that appears underneath and to the left if you lmb or rmb on the inventory item whilst it's still playing the speech, and the sentence seems to display glitch slightly too during clicking. This can be seen on the example same project I sent if you change ItemSetLabel, and it happens both in build and preview.

  • If you're referring to the subtitles glitch brought on by the Canvas Scaler, that will be addressed in the next release.

    The glitch with the verb line occurs because the ActionList's When running field is set to Block Gameplay. Though your speech within it is set to run in the background, the ActionList itself will still cause the game to momentarily enter "cutscene" mode.

  • edited January 2019

    I've split my inventory and verbs menu into two separate UnityUI components and AC menu definitions, for the reason that I need to send my verb buttons and sentence line into overlay and the rest of the inventory into camera sapce. I'm not sure, but I think it's causing left-clicking to break and I'm wondering if this is because I have two different defined menus, should I modify the ItemSetLabel script?

    I don't believe it is an issue with this, but here's what's happening. At first I'm alternating left and right clicks, which is working as intended. However, with the script on, all interactions are reset for some reason: https://gfycat.com/AdorableSevereCentipede

  • The ItemSetLabel script assumes that your Verbs menu contains an InventoryBox element named Inventory. You can amend the "Verbs" string to have it be expected in another if necessary via the script's Start function.

  • So:
    verbsMenu = PlayerMenus.GetMenuWithName("Inventory"); inventoryElement = verbsMenu.GetElementWithName("Inventory") as MenuInventoryBox;
    Needs to become:
    verbsMenu = PlayerMenus.GetMenuWithName("Verbs"); inventoryElement = verbsMenu.GetElementWithName("Inventory") as MenuInventoryBox;
    The only problem I can't figure out is how to get left-click use with to work with this script on: https://gfycat.com/MajesticKlutzyCommongonolek - as you can see, it works fine with it off, but it doesn't seem to allow for combine inventory with it on?

  • 404 error on the link, and your "needs to become" code is what it already is - did you mean those to be the other way around?

    Was inventory combining working before you moved the InventoryBox to another Menu?

  • edited January 2019
    Sorry I'll fix the link. No, I tested with another project and combine spears to be broken with this script on?

    Ahh yeah, do I need to define the actual menu differently rather than just the elements?
  • I'll attempt a recreation with the default template, then.

    do I need to define the actual menu differently rather than just the elements?

    GetMenuWithName requires the name of the menu passed as a parameter - see its scripting guide entry here.

  • Thanks, i'd appreciate that! So in this case, they can both be inventory (as I posted back to front!) since I don't think my split verbs menu is needed to be referenced in this situation?
  • edited January 2019
  • Updated the package with a corrected ItemSetLabel script.

  • edited January 2019

    EDIT: the bug was related to auto-walk to, thanks this works great now!

  • It works perfectly set-up ala Monkey Island 2, whereby both buttons trigger DefaultInteraction, but is it possible to have DOTT-style, whereby right-click triggers DefaultInteraction and left-click (almost, besides the coat that triggers Use dialog instead of Use With combine) always triggers "Use with"? I think it may be a case of setting up inputs properly, but I'm not certain if it would be a case of hard-wiring one of the inputs to a particular interaction?

  • Here's an example of it, I left-click first to "use with", then I right-click to "look at": https://gfycat.com/SomberFarawayGermanwirehairedpointer

    This may well be hard wired for right-click inventory items to always "look at" but, as I mentioned, due to the fact that the coat runs a "use" rather than a "use with", I assume it works using some kind of default interaction method, here's an example: https://gfycat.com/PlaintiveFortunateAegeancat - I'm left-clicking first each item, then right-clicking each item.

  • I've updated the template once again.

    In ItemSetLabel's Inspector, you can now dictate the interaction index of the item to auto-select when hovering over it (by default, it's 0).

    Set it to 1, and then set up your inventory item's interactions:

    0 - Look at - An ActionList that examines the item
    1 - Use - An ActionList that selects the item (Inventory: Select)

  • Thank you so incredibly much for all the hard work you've put into this template, I couldn't have dreamed it would behave so closely to the games I grew up with (DOTT was the first game I ever owned on CD back in 1994!) and you've been exceptionally kind to keep tweaking it like this, really REALLY appreciate it!

  • edited April 2020

    One more thing, is it possible to have the text not default to just the name of the object when the mouse hovers over itself?
    Currently, it is appearing like this:
    https://gfycat.com/fixedflippantblackfish

    Whereas it should still show "Use *** with" when hovering over itself.

    It's also not possible to cancel the "use with" selection by right-clicking over the inventory section, the mouse must be moved above into the gameplay area for it to work, is there a reason for this?

  • Whereas it should still show "Use *** with" when hovering over itself.

    I would say that's a matter of opinion. Clicking at that moment would merely deselect the item - not combine it with itself.

    However, it is possible to override the "Hotspot label" when over any given menu element by hooking into the OnRequestMenuElementHotspotLabel event, i.e.:

    using UnityEngine;
    using AC;
    
    public class UseItemOnSelfLabel : MonoBehaviour
    {
    
        private void OnEnable () { EventManager.OnRequestMenuElementHotspotLabel += My_Override; }
    
        private void OnDisable () { EventManager.OnRequestMenuElementHotspotLabel -= My_Override; 
    
        private string My_Override (Menu menu, MenuElement element, int slot, int language)
        {
            if (menu.title == "Inventory" && element is MenuInventoryBox)
            {
                MenuInventoryBox inventoryBox = (MenuInventoryBox) element;
                InvItem selectedItem = KickStarter.runtimeInventory.SelectedItem;
                if (selectedItem != null)
                {
                    InvItem slotItem = inventoryBox.GetItem (slot);
                    if (slotItem.id == selectedItem.id)
                    {
                        string prefix = KickStarter.runtimeInventory.GetHotspotPrefixLabel (selectedItem, selectedItem.GetLabel (language), language);
                        return prefix + " " + slotItem.GetLabel (language);
                    }
                }
            }
            return string.Empty;
        }
    
    }
    

    It's also not possible to cancel the "use with" selection by right-clicking over the inventory section, the mouse must be moved above into the gameplay area for it to work

    I can't recreate such an issue. Be sure to try the latest release.

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.