Having an item dragged out of inventory and right clicking an object that can be examined.

  • #20, by stered86Wednesday, 11. April 2018, 15:04 6 years ago
    This is becoming stranger and stranger. Before trying your suggestions, I tried removing EVERY definition script to understand if there was a conflict going on and... nothing, the behaviour of the right click is still the same.

    Then I proceeded to download one of the templates in the downloads section (magical potions) and I found out that there is exactly the same problem in that game. Can it be that there is a problem when using a "broken sword" kind of interface?


    Newbie

    62 Posts


  • #21, by esmeraldaWednesday, 11. April 2018, 15:58 6 years ago
    I have the same behavior in my game. Broken sword interface, standard drag&drop, vis 5.04. Rightclicking on an object while dragging an item results in triggering the right-click-action (and canceling the item).

    Key Killer

    513 Posts

  • #22, by sebastianWednesday, 11. April 2018, 17:22 6 years ago
    tested it:
    it seems that right clicking on an item is still handled normal (item gets cleared, no right click interaction in the item.
    Doing the same on a scene object will trigger object clearing AND right click action on the scene object.

    Seems to be a bug

    Thread Captain

    2346 Posts

  • #23, by stered86Thursday, 12. April 2018, 10:29 6 years ago
    I think I should report this, because the problem is still there in V5!

    I never thought the Broken Sword interface could be the problem.

    Newbie

    62 Posts

  • #24, by afrlmeThursday, 12. April 2018, 12:33 6 years ago
    I have the same behavior in my game. Broken sword interface, standard drag&drop, vis 5.04. Rightclicking on an object while dragging an item results in triggering the right-click-action (and canceling the item).
    This is why I swapped over to a pure command based system. I have a single command for left click & a command for every single item the character can pick up with a unique cursor for each. This gave me much more flexibility than the built in drag & drop system or command + item system as you can easily query in the right click action for a scene object or character, if command is x do something, else set command back to default end. This prevented right click actions from being triggered if the command in my case wasn't "left_click" as that meant my character was holding an item.

    Technically this method is no longer needed since Simon implemented the if Lua result query action part to VS5 as you can now use that to query if the character is holding an item by returning the UsedItem datastructure field.

    return game.UsedItem:isEmpty()


    If it returns true then the character is not holding an item. If it's true you would trigger the default right click actions, else you would drop the item instead & no actions would be executed.

    P.S: these methods are only valid on execute at destination commands when the character is already standing at the interaction position & for immediate execution commands.

    Imperator

    7278 Posts

  • #25, by esmeraldaThursday, 12. April 2018, 15:38 6 years ago

    return game.UsedItem:isEmpty()


    If it returns true then the character is not holding an item. If it's true you would trigger the default right click actions, else you would drop the item instead & no actions would be executed.
    I'm not sure how to drop the item. I tried set cursor and set command. Both actions drop the item allright. It looks like this:
    Right click (immediate):
     if 'return game....'
      display text "Blah blah"
    else
     set standard command
    end if

     But my right click action is still partly executed. It consists in displaying a text with a linked soundfile. The sound is playing even when the text is not displayed. Very strange.

    Edit: the not displaying the text was a fault on my side (wrong character) - the text (and sound) gets displayed with dragged item or without.

    Key Killer

    513 Posts

  • #26, by sebastianThursday, 12. April 2018, 15:59 6 years ago
    changing the control scheme doesnt change the (presumed) issue with right click triggering both: item clearance and execution of command at the same time. I assume that we should get rid of "RIGHT CLICK" as an execution method on objects/items and use a command here. Not sure if setting a different command for right click is possible without problems.

    Thread Captain

    2346 Posts

  • #27, by stered86Saturday, 14. April 2018, 10:26 6 years ago
    I tried doing that. I created a command in my interface associated with right click. In this way I could use a normal "right click" and a "right click + item" on scene objects. In theory the problem should be solved, but it's not working. I think it is how Sebastian said, first I should get rid of the standard right click. I don't know if it's possible, though.

    Newbie

    62 Posts