Right mouse button kills item while dragging

  • #1, by DerNarrThursday, 09. April 2015, 13:16 9 years ago
    Hi there,
    I have a bad issue with dragging items out of the inventory (to combine them with stage objects for example). When I accidently hit the right mouse button while I have an item attached then the cursor changes back from the image of the dragged item to its original appearance and then the item is gone. I tried to get this under control this via actions in the mouse properties but nothing seems to work. Is there a possibility to disable the right mouse button while the condition (in this example "An item is dragging") is set to true? I found a similar question in the forum (http://www.visionaire-studio.net/forum/thread/drag-and-drop/) but it was left unanswered.
    Thanks for your help.

    P.S.: I hope this post is set right in the category "General".

    Newbie

    8 Posts


  • #2, by afrlmeThursday, 09. April 2015, 15:27 9 years ago
    Right click is generally used as a cancel button or for examining objects / items or characters.

    There used to be some options in the data structure under VGameRightMouseClick, but that table doesn't seem to exist anymore, as it returns an error when I try to access it.

    Imperator

    7278 Posts

  • #3, by DerNarrThursday, 09. April 2015, 18:10 9 years ago
    Hi, thank you for your quick response. That´s sad that the relevant table is gone. Isn´t there any other possible solution to set the function of the right mouse button =0? How do others handle this issue when the right click means a clear cancel?
    Thank you very much in advance.

    Newbie

    8 Posts

  • #4, by afrlmeThursday, 09. April 2015, 18:58 9 years ago
    There also used to be the option in the actual mouse settings tab in the editor too, but that was replaced with the current system in 4.x.

    Why does it matter if someone right clicks to cancel anyway? Left click is the typical interaction button in pretty much all games that use a mouse. I suppose the devs could remove cancel from the source as there is the set item action part which allows you to clear the held item by setting it to empty, so in a way it would be possible to assign the clear function to any key or button combination you like.

    Imperator

    7278 Posts

  • #5, by DerNarrThursday, 09. April 2015, 23:58 9 years ago
    Hi, I´m sorry but I´m not really sure what mean by that.
    But anyway I got the problem fixed. Here´s what I did (just in case somebody else runs in the same situation): I realised that the right click is JUST in it´s item-killing-mood when an item was set as a 'dragged item' (via action with the box checked). But it doesn´t have any effect on the cursors. I checked that with cases when my cursor is changing (for example to show that certain areas on the screen are there for leaving the canvas). So long story short: I removed all action where the items were set as 'dragged'. Afterwards I created a new cursor for each item with a scaled down image of the item. So if you now click an item in the inventory the cursor changes to the new item cursor (and it looks like as I had used 'dragged item'). Now I can accidently hit the right mouse button until my fingers will start bleeding (or I can use a useful action instead wink ) but it will no longer break the game.
    Kind regards.

    Newbie

    8 Posts

  • #6, by DerNarrFriday, 10. April 2015, 00:07 9 years ago
    Ok, I have to admit that this more a workaround than a solution for the genral problem. But hey it works smile.

    Newbie

    8 Posts

  • #7, by afrlmeFriday, 10. April 2015, 01:41 9 years ago
    Sure I could have told you that, but I figured you were after a quick & dirty method as opposed to having to go about creating actions for each of your items.

    I actually do recommend the method you've decided to use though, because it allows you to create neater animations / images to use for the cursors instead of the default item image / animations which are often too large & don't really make much sense as cursor items.

    By the way, if you have created on mouse enter / leaves action parts for your scene objects that are used to set the cursor then they will still set the cursor regardless of whether or not you are currently holding an item. However the item will still be held, even though the cursor will have changed. To counteract this I ended up writing a small Lua script function to check if I was holding an item & if I wasn't then I would have it execute a called by other action containing the specified set cursor action part.

    Imperator

    7278 Posts

  • #8, by DerNarrFriday, 10. April 2015, 08:09 9 years ago
    Hi. I think I saw your post about that script where you check if an item is holding or or not. I didn´t realised that issue with the mouse enter / leaves areas because I was going a different way. My Inventory is at the bottom of the screen and I don´t wanted that the objects on the screen are clickable when the inventory is open. So I set them all to false. When I now wan´t to combine an inventory item with scene objects I just enable the relevant ones (after the inventory item was clicked) because it hasn't made sense to me to combine an item with a 'Go to' area in the first place.

    Newbie

    8 Posts