Forum rules - please read before posting.

Cursor Movement

2»

Comments

  • :)

    It's a finnicky trick to be sure, but a necessary one so far as I can tell.  I'll be adding a note to the Manual about this, and a dedicated section to the manual regarding direct-control of Menus, to hopefully help others who may have this issue.
  • @ChrisIceBox

    Back again sorry lol. I've hit a snag when it comes to combining inventory items.

    Just a recap of where I am summarising the above, if the player is controlling with a Mouse then everything is set to Mouse control and everything works perfectly as required. If the player chooses controller or keyboard then I've managed to get everything to work (Direct-navigation for all menus including the Inventory as well as a custom menu which is the players Laptop/Tablet).

    One of the Inventory items is a camera which the player needs to select and then drag the camera (once selected) over to an area to take a picture with. Again I've managed to get this working with some custom scripts - whilst in Mouse this works as normal however whilst in Controller or Keyboard I have to get creative by changing the cursor lock state and visibility whilst forcing the item to be selected (the player can then move the camera image component with the analog stick exactly as they do with the mouse to click on the area where a picture can be taken).

    The above works because the camera is clicking on a hotspot so AC recognises the custom in-game cursor (the camera graphic) when it is on the hotspot. The current problem I'm having though is similar to the problem I ran into above in this post with regards to clicking on a Unity UI button using the in-game cursor. It was found this wasn't possible hence why I had to go for the Direct-navigation route for all menus when keyboard/controller controlled. Any advice then on how I can combine Inventory items whilst in direct-navigation? Simply clicking on the Inventory Item A and then onto Item B nothing happens (just to clarify I've tested this in mouse control and everything works as desired so the combination action list etc is working fine).

    I've played around with this and got to a point where I was doing what I was doing when clicking on the Camera inventory item (unlocking the cursor and visibility so that the player can move the Inventory image with the analog stick) however that is when the familiar problem of clicking a Unity UI with an AC in-game cursor cropped up again.

    p.s. I'm still rocking 2017.1.1f1 and 1.59f however considering the previous posts I don't believe what I'm encountering is any bug of any kind, just a limitation(?) I need to somehow overcome.
  • You should be able to select/combine items with direct-controlled Menus.

    1) When any issue with Unity UI comes up, I always recommend that the first thing to do is switch the Menu's Source back to Adventure Creator so that we can see if the problem lies with AC, or with Unity UI.  Does the issue persist?

    2) What is the game state when your inventory menu is active?  You can find out by checking List active ActionLists in Game window? at the bottom of the Settings Manager - it'll then show in the top-left corner at runtime.

    3) When the item A is clicked on, is it becoming selected, i.e. the cursor is changing to its graphic?  (If you aren't making use of inventory cursors, enable them temporarily so that we can check for this).

    4) Is the Drag and drop inventory interface? option checked in the Settings Manager?
  • @ChrisIceBox

    Seems to be solved, thanks again for the great help. The Inventory items I'm clicking on for the combination are text only (they are notes that the player must combine in order to deduce a key piece of info/clue) so there are no graphics for these Inventory items since they are simply text. I did test out giving them a main graphic (of an '+' symbol) so that when the clue is selected then the '+' symbol will replace the in-game cursor and then the player 'combines' the notes by clicking on the second note with that '+' symbol. As mentioned above this worked perfectly whilst in Mouse control however not in Controller - upon your advice in point 3 above I tried clearing the main graphic and putting that '+' symbol in the Inventory cursor section. The whole combination gameplay aspect now works in controller method as when I click on the first note and then on the second note they do combine properly.

    The drag and drop option also worked by the way however I preferred the functionality of clicking on the first note then clicking on the second note to combine rather than clicking and holding on the first note and releasing on the second note.

    There is still the minor issue that the Inventory cursor (the '+' symbol that I setup) doesn't show for the controller because whilst in this setup I disable the cursor and lock it because the controller/keyboard controls everything (I sometimes unlock the cursor and make it visible for certain situations for interactions with hotspots however not for Unity UI sections because of the aforementioned problem with the Unity UI not responding to the AC in game cursor position). So everything is functioning as it should (have to say a big thanks again) however any advice/ideas on displaying the '+' symbol whilst in controller so that the symbol is on the selected note that you're trying to combine?

    This is currently very low priority, I'm just thankful everything is functioning! Thanks again Chris.
  • This '+' would be over the second item's name?  If you could show a mockup image, I'd appreciate it - I'm a little uncertain.

    It may be that you have to use the OnMouseOverMenu custom event, which can be used to trigger custom code when highlighting a menu element.
  • @ChrisIceBox

    Yeah sorry, without screenshots or images I can appreciate it must always be difficult to follow exactly what I'm thinking lol. I did think about triggering some custom code when highlighted over however it should only do it when the player first clicks on a previous note for them to combine the second one with (in this particular example I could always check if they are holding an Inventory item (so the first Note they clicked on) however this is currently the prologue - for the main game I'll have a lot more notes and clues so checking if any of the applicable items are carried each time seems too much.

    Anyway below is what happens whilst in mouse control, so working perfectly and I'm guessing the same happens in controller however because I lock and hide the cursor then the player can't see the combine symbol (and even if I unlocked/unhidden the cursor it would not be at the position of the direct-navigated UI so it's position wouldn't be correct i.e it wouldn't over the second note that you're clicking on to combine the notes to deduce a clue.

    Image 01 - Shows notes before being clicked on

    Image 02 - Shows '+' symbol cursor change after clicking on the first note

    Image 03 - Not really important but shows the end result of a 'clue' being deduced after combining the correct notes

    Please ignore the awful green colour of the players HUD Tablet, definitely something I'll be updating (currently going for functionality over looks obviously lol).
  • I suppose one thing you could try is to create a second InventoryBox element of the type Display Selected, which is non-interactive and will only show the currently-selected item as a single slot.  If you make that display Icon Only, and each of your Inventory items have the '+' icon as their Main graphic, then that ought to show
  • edited October 2017
    @ChrisIceBox

    Got it working, I might be going a long winded and wrong way about this (please if anyone has a more streamlined idea please let me know). Your suggestion above regarding a Display Selected Inventory Box was something that I couldn't fully understand how to implement as I was struggling how to position this second Inventory Box so that the '+' icon would marry up correctly to the highlighted/selected note.

    Anyway as mentioned I've got a workaround. I went into the transition section of the button component on each of the 'Notes' and changed the transition from Colour Tint to Animation. This gave the usual Normal, Highlighted, Pressed and Disabled animations and triggers which I setup then to do exactly what I'd previously setup with the Colour Tint. However I also added a 5th Animation called 'HighlightedCombine' as well as a bool in the animator for 'InventorySelected' and so if the bool is false and the Highlight trigger is triggered then the normal Highlight animation is played however if the bool is true whilst the highlight trigger is played then the HighlightedCombine animation is played.

    I therefore added an image component as a child to each of the 'Notes' which was the '+' symbol and position these at the start of each Note text. The image starts disabled and is kept disabled by each animation state except obviously for the HighlightCombined which then enables the image.

    The way I'm setting the bool is something that originally crashed my editor so any advice with how to make this better/improved would be appreciated. When the player opens up the Notes/Clues section of their Tablet UI I run an action list asset that checks if no inventory item is selected, if true then it sets the bools for each note as false and then checks again and continues infinitely through that loop (and then obviously when it picks up that an Inventory item is selected then it sets the bool to true but then keeps running through the endless loop). When the player exits from the Notes/Clues section then I kill the Action List so it isn't running all the time and in this screen the player can only click on and therefore select notes and clues so I don't need to check for specific notes/clues to be selected, only whether either nothing or something is selected.

    As mentioned this did crash my Unity at first so I added a 0.5 second wait at the end of each check which stopped the crash but the delay is noticeable in game - nothing too breaking and I'll look to reduce this potentially down to 0.1 seconds however any advice on streamlining this process would still be appreciated from those a lot more programmer savvy than myself lol.

    Just out of interest here is how it now looks, very simple screenshot but shows the notes before you click and then afterwards when you highlight the second note to show the '+' symbol.


    I still need to decide how this will now look whilst mouse controlled. As mentioned previously I did change the mouse cursor icon to the '+' symbol however I'm not sure whether to keep this as well as the above animation change or do away with the cursor change altogether and just have the animation change. Purely cosmetic, at least I now have the functionality I want :)

    Thanks again Chris for your help and patience with all of this. I'll no doubt be back in touch with another roadblock I hit later in my journey lol.
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.