Change cursor to Item and afterwards back to normal

  • #1, by anna-arnoldSaturday, 07. July 2018, 16:23 2 years ago
    Hi there, 
    long time no type, but here I am. I know I even saw a video tutorial for this but now I can't find it: how can I change the cursor to the dragged Item manually?
    Once it worked fine on this way (see screenshot) for a while ;D (though this surely is not the right way to do that), but now I noticed that the arrow in the sprite is useless, because you need to put the center of the active Item at the destiny, so my plan doesn't work anymore. I can't tell you when it worked; maybe in visionaire 4?? No Idea. Maybe I was to dazed to figure that out earlier?

    Well, that doesn't work and I really dislike the casual way of a dragged Item; the Items are too big and often it feels like a game of skill to face the destinated object. I even think it should be integrated into Visionaires Interface to set a custom cursor to every single item.

    I found this post https://www.visionaire-studio.net/forum/thread/change-cursor... but I can't figure out some things; I tried to do that like this but now I can't use the Items anymore. ;D I can't put the information together in a logical way, I would really need kind of a tutorial. Any volunteers?

    And if it's important in any way: my mouse interface is absolutely simple: just left click for action and right click for "looking"/describing.

    Thank you for your help in advance! smile

    Newbie

    94 Posts


  • #2, by NigecSaturday, 07. July 2018, 17:07 2 years ago
    The order you have stuff is important

    If you look at the picture the inventory interaction is in the list first, if it was anywhere else it would get overrided, in my game "Cursor enter object area" changes the cursor to a magnifying glass, the leave changes it back to the pointer

    You have to be really careful if you mix commands and cursor enter actions, at one time you could mix them but I think something change around version 3.4

    Key Killer

    565 Posts

  • #3, by anna-arnoldSaturday, 07. July 2018, 17:36 2 years ago
    Well, that's not what I meant. I don't need cursor enter actions until now. I would like my cursor to change to the inventory item that is dragged, but not the usual way. I'd like to change the cursor manually when the item is dragged and change it back to normal when it's not.
    So far I know that I have to create one cursor per item and must not allow items to be dragged.  But that's not the whole way. And so far it doesn't work as I imagined.

    Newbie

    94 Posts

  • #4, by afrlmeSaturday, 07. July 2018, 18:06 2 years ago
    I actually recommend using commands. It's much easier to manage & you can assign a cursor to each command.

    Alternatively since 5.x you could also use the current command & link an item to it as it's now possible to create custom Lua queries with the "if lua result" action part.

    You need to create the cursors in the actual mouse cursors section of the editor. If you use the actual dragged item system then it will automatically use the item image & the interaction position will be in the center of the sprite, which isn't particularly great.

    Here is the system I use for items.






    You should be able to figure it out from the screenshots I have provided.

    Imperator

    6845 Posts

  • #5, by anna-arnoldSaturday, 07. July 2018, 21:15 2 years ago
    Ah okay, that's clever smile Thank you, it works so far.

    I added a little "if query" in the right click mouse options to set the command back to normal if right click is used.

    if leftclick is actual command 
    (do nothing)
    else change command to leftclick

    Doesn't interrupt right click interactions so far.

    Newbie

    94 Posts

  • #6, by afrlmeSaturday, 07. July 2018, 22:02 2 years ago
    Yeah that's correct. You also want the same query inside of the mouse leaves action for your scene objects/characters to set cursor back to default cursor if the current command is your default command - mine is called "left_click".

    Also you should add the same if query into right click actions for your objects/characters. This will prevent it from executing right click actions on objects/characters if left_click isn't the current command, otherwise it will set current command to left click & execute the right click action even though you might have just been trying to reset the command back to the default command. It's just a nice little fallback to prevent unwanted behaviour.

    Imperator

    6845 Posts

  • #7, by anna-arnoldSaturday, 07. July 2018, 22:22 2 years ago
    Oh... that's much work. ;D But you're probably right: that may be important.

    Maybe it's just because I'm tired, but I'm currently wondering how I do combine two Items with this strategy: 

    "ItemCommand" executed ->
    or
    "ItemCommand" executed <->
    or
    "ItemCommand" executed 

    Or is there an absolute other way to do that? I would say it's the last one, but I'll have to use it in both Items that I would like to combine, but I can't try that out now, I'll try next session.

    Edit:
    Okay I was too curious: yes, ' "ItemCommand" executed' works fine. smile

    Newbie

    94 Posts

  • #8, by afrlmeSaturday, 07. July 2018, 22:34 2 years ago
    Aye, just executed command "command name" (under immediate section). I don't use any of the other event types, except maybe mouse enters/leaves.

    Imperator

    6845 Posts

Write post