Items dragging not working as expected

  • #1, by dionousWednesday, 26. April 2017, 11:09 7 years ago
    Hi allo,

    Have the following issue (verified in 4.2.5 and 5rc0):

    I have a use command which works ok with inventory items (USE ... WITH.. ). However when i enable 'Items can be dragged with this command' i can see the cursor changing to the inv item, but when trying to use this item i get a reply from the default comment set. I have also played around with the global option 'Allow dragging items from inventory' but no luck. Maybe i'm missing smth here?

    Thanks!

    Forum Fan

    246 Posts


  • #2, by afrlmeWednesday, 26. April 2017, 11:37 7 years ago
    Quick note: just woke up, so my head's a bit muggy at the minute.

    dragged items require item dropped actions in scene objects/characters as they have no command attached to them. If you manually create an action inside of an item, say: left click > set command x, set item y then only an action like command x, item y (executed at destination or immediate) would work on scene objects/characters, but if you changed the active command then it would no longer register correctly.

    Personally I'm not a fan of the built in item system; especially the dragged item system. I use a custom command based system for both commands & items because it's much easier to work with & I can use custom mouse cursors which I can assign to each command.

    Imperator

    7278 Posts

  • #3, by NigecWednesday, 26. April 2017, 11:47 7 years ago
    in the old days of early version 3 you could mix commands and onclick and the inventory worked fine, honestly I can't remember which version it changed.

    I've never tried to achieve the same thing via script, I usually use the onclick and totally ignore the command system

    Key Killer

    628 Posts

  • #4, by afrlmeWednesday, 26. April 2017, 12:46 7 years ago
    in the old days of early version 3 you could mix commands and onclick and the inventory worked fine, honestly I can't remember which version it changed.

    I've never tried to achieve the same thing via script, I usually use the onclick and totally ignore the command system
    There's a reason I use commands. If you use a broken sword (single command interface) which a lot of people tend to do these days, then it's likely you have created mouse enters/leaves actions for each of your scene objects/characters which change the mouse cursor. Now, the problem with single command interface & using dragged items is that there's no if query action part to check if you are holding a dragged item (without scripting), & most people probably just add the change cursor action part into the mouse enter/leaves actions which causes the mouse cursor to be forced to whatever is specified, but if a dragged item is in hand the item remains while the cursor is now set to the examine, look, take, etc. cursor.

    I use the broken sword interface myself - I have a single interaction command called "left_click", the rest of the commands I created are for items. On mouse enters/leaves I can query if command is "left_click" change cursor to "examine" end, which prevents cursor from being changed unless my standard command is the current command as all other commands = item. I use the same approach for right click (examine) scene objects/characters too, as I can query if command is "left_click" to perform some character observation actions/display texts otherwise it resets the command to standard command because an item must be in hand.

    The other reason I use commands is because I can assign custom cursors into the properties section of each command which means I don't have to use the over-sized inventory item sprites nor suffer the animation center position (which coincidentally is in the exact center of dragged item cursor sprites rather than the top left).

    https://i.gyazo.com/a362c3ffd18f6db875b6663cb00f527a.png

    versus...

    https://i.gyazo.com/ba4d709039f4836d71a1965701e62c9e.png

    Imperator

    7278 Posts

  • #5, by NigecWednesday, 26. April 2017, 16:30 7 years ago
    Everything I've done in recent years was 1st person and quite simple

    But I maybe going over to the darkside and a playerable character .. probably MI1 GUI affair, I don't know for sure yet

    Key Killer

    628 Posts

  • #6, by dionousThursday, 27. April 2017, 08:19 7 years ago
    Thanks all,

    AFRLme's suggestion works ok and for sure better than the built-in one so we will stick to this.

    As we are using a verb-driven interface we have found the following to work best for mouse enters/leaves (so that your inventory item cursor won't change):

    1. Assign a condition to your character named e.g. 'holding_item' with initial value FALSE.
    2. In your items's actions panel, every time you set the command to use/give this item, make sure you change 'holding_item' to TRUE.
    3. So now, for every mouse enter/leave, make sure you check if your character is holding this item and change the cursors accordingly:

    Cursor enters or leaves object area: if 'holding_item' is false set cursor **your cursor**

    So it will only change cursor if you are not holding an item.

    Important note: make sure you set 'holding_item' back to FALSE when you drop/put the item back to your inventory

    Forum Fan

    246 Posts